General shaders discussion (Warning: Not so good question!)



  • Hi everyone,

    Before I start let me say that this is probably a bad question and if you are new to Qt, or hoping to learn anything for shaders or OpenGL by reading this, I am afraid you will lose your time.

    That said, I moved into learning a bit more about OpenGl and shaders, by studying some of the examples. The easiest of which, and thus more interesting for me, being the 'openglunderqml' one. It renders a 'squircle' in a qml window.

    I did understand that it does so by using vertex and fragment shaders, that are compiled at runtime, in order to directly access the pixel colour values.

    Inspired by this I did a little search on finding other shaders and ended up "here":https://www.youtube.com/watch?v=cZeCgOutZHE

    which eventually led me to the shaders used by the author "here":http://pastebin.com/UwDaqNxq

    How can one implement those shaders?
    Could it be possible that by using those I would be able not to see the squircle, but the ocean shown on the video?

    I do realise that it probably is not that simple, and it would need a lot of work to do it. Something that would be unpractical, or impossible for someone to explain on a forum post, but any useful comment or resourse is welcomed.


  • Moderators

    Hi,

    you've chosen an interesting and quite challenging topic. You could start by replacing the squircle by a flat rectancled matrix of points and add gui options to manipulate the "camera" pose. When you got that working you could implement a geometry shader to create something like a "flying carpet of dots".

    Happy coding :-)



  • I see where you are going, I could after that make the dots position change according to some function. That of curse in the case that I do manage to make the flying carpet in the first place.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.