Skip to content
  • 0 Votes
    10 Posts
    925 Views
    J

    For the purpouse of people who might search for an find this forum post, I put in a request with QT support and received the following.

    Hi Joe,

    Thank you for contacting Qt Support and for providing your sample project.

    There are 2 broad ways to specify the fragmentShader property, depending on which version of Qt you want to target:

    The Qt 5 way is to specify the shader's source code as a string. The Qt 6 way is to pre-compile your shader source code into a .qsb file, and specify a URL to that .qsb file

    See:

    https://doc.qt.io/qt-5/qml-qtquick-shadereffect.html#fragmentShader-prop https://doc.qt.io/qt-6/qml-qtquick-shadereffect.html#fragmentShader-prop

    To do it the Qt 5 way, the easiest approach is to copy the contents of your .frag file and paste it as a string literal (surrounded by quotation marks) to the RHS of the "fragmentShader" property.

    To do it the Qt 6 way, run the QSB tool to compile your shader source code. Unfortunately, the code of colour_wheel.frag is too old to be supported by QSB (for example, the "varying" keyword was deprecated long ago, and even removed for ES profiles)

    See:

    https://doc.qt.io/qt-6/qtshadertools-overview.html https://doc.qt.io/qt-6/qtshadertools-qsb.html

    I hope this helps.

  • 0 Votes
    2 Posts
    2k Views
    R

    Alright after developing spine problems from leaning into my screen for a week and losing more hair than my GPU has cores, I sort of fixed the issue.

    So for some reason when I was reading data into my textures without setting the active texture back to the GL_TEXTURE0 default, things were going sideways.

    So basically I had something like:

    glActiveTexture(GL_TEXTURE0 + inputTextureUnit[vid]); glBindTexture(GL_TEXTURE_2D, inputTextureID[vid]); glTexImage2D(GL_TEXTURE_2D, 0, GL_internalFormat[vid], videoSpecs[vid].videoWidth, videoSpecs[vid].videoHeight, 0, GL_format[vid], GL_UNSIGNED_BYTE, (const void*)(frame));

    But this was missing at the end:

    glBindTexture(GL_TEXTURE_2D, 0); glActiveTexture(GL_TEXTURE0);

    But I'm not 100% convinced that this is the cause because if I read still images, there is no issue. Its only when I read videos that I see the flickering and black texture issue. It seems like when other widgets start rendering and there is a texture active, they somehow corrupt it but I would certainly appreciate it if anyone has input on what actually might be happening.

  • 0 Votes
    3 Posts
    2k Views
    C

    Dear Alain38,

    Did you make it finally work? I got stocked with the exact same problem.

  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    2 Posts
    3k Views
    johngodJ

    Hi Clockwork

    I didnt read your code with much attention, but for starters if all you want is draw a triangle, check this tutorials I did https://bitbucket.org/joaodeusmorgado/opengltutorials
    I'm using vbos, to draw triangles. I'm using all OpenGL native calls, but should be pretty easy to convert to Qt OpenGL functions. I also recommend you this book wich is great, it has a lot of details that usually are ommited in other books http://alfonse.bitbucket.org/oldtut/index.html

  • Qt5.7 D3D shader error

    Unsolved General and Desktop
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    4 Posts
    2k Views
    SGaistS

    Then you should use the Qt resource system to embed the shader in your application. You current shader files are accessible on your host. When you start your application on your device, they won't be there.

  • 0 Votes
    1 Posts
    2k Views
    No one has replied