Results 1 to 2 of 2

Thread: Is there a better way to write shaders

  1. #1
    Join Date
    Jun 2012
    Posts
    58
    Thanks
    13
    Qt products
    Qt4

    Default Is there a better way to write shaders

    {Qt/Qml 5.2.0, creator 3.0}

    The way to write the shader code in quotes for vertex and fragment shader properties of ShaderEffect seems a little inefficient for me. Lack indentation and other smart IDE features since it is after all a string. However i do see that I can create .vsh and .fsh files whenever i do add-new-files. Do you know how to use these in vertexshader and fragmentshader properties of ShaderEffect?

    eg.,
    Qt Code:
    1. shader file = VShader.vsh
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. ShaderEffect {
    2. vertexshader: VShader.vsh //how do i wirte this
    3. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is there a better way to write shaders

    Provide a function that will read the shader from file and expose it to QML (the function, of course).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    ustulation (28th February 2014)

Similar Threads

  1. QML Shaders
    By ustulation in forum Qt Quick
    Replies: 3
    Last Post: 29th December 2013, 16:34
  2. Problems with shaders and their context's
    By Elberion in forum Newbie
    Replies: 13
    Last Post: 21st June 2011, 15:34
  3. QT4.7 & QGLFormat::CoreProfile & shaders
    By saraksh in forum Qt Programming
    Replies: 3
    Last Post: 27th December 2010, 22:04
  4. Replies: 0
    Last Post: 10th November 2010, 13:56
  5. GLSL shaders, multitexturing and Qt
    By jcox23 in forum Qt Programming
    Replies: 0
    Last Post: 20th January 2010, 19:37

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.