Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt multiple QGLShaderProgram for one texture

Qt multiple QGLShaderProgram for one texture

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dmitry89
    wrote on 19 Jun 2013, 17:13 last edited by
    #1

    I use two QGLShaderProgram's for processing the texture.

    @
    ShaderProgram1->bind(); // QGLShaderProgram
    ShaderProgram2->bind();

    glBegin(GL_TRIANGLE_STRIP);
    ...
    glEnd();

    ShaderProgram1->release();
    ShaderProgram2->release();
    @

    The texture should be processed with Shaderprogram1 and then ShaderProgram2. But when I call ShaderProgram2->bind() automatically fires ShaderProgram1->release() and only one shader works. How do I bind both shaders?

    1 Reply Last reply
    0
    • 8 Offline
      8 Offline
      8majkel8
      wrote on 19 Jun 2013, 20:58 last edited by
      #2

      as long as i know you cannot bind multiple fragment shaders or vertex shaders at once (maybe in some new high performacne GPUs). You have to either combine shaders into one or execute them sequentially.

      ShaderProgram1 is released becouse qt detects that another shader is beeing attached (ShaderProgram2).

      Read more about OpenGL functions:
      "glUseProgram":http://www.opengl.org/sdk/docs/man/xhtml/glUseProgram.xml
      "glAttachShader":http://www.opengl.org/sdk/docs/man/xhtml/glAttachShader.xml

      1 Reply Last reply
      0

      1/2

      19 Jun 2013, 17:13

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved