Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Shader Information

  1. #1
    Intern Contributor
    Join Date
    Oct 2007
    Location
    persia,tabriz
    Posts
    71

    Shader Information

    hi

    can i get any information form shader, like as value of the variables?

    for example my GLSL shader read an texel of texture and return it to the program or program read it from shader?

  2. #2
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,367

    Re: Shader Information

    You can have some information in a shader like source code, active uniforms and attributes, program link state,... But AFAIK there is no way to know the value of a variable inside the shader that is not given by the application when shader is running like in a debugger.

    One thing you can do is writing it in a texture and then read it in your application or display it directly on the screen if the value don't really matter.

    There is gDEBugger that can do apparently amazing things. I don't if it can do such things.

  3. #3
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,270

    Re: Shader Information

    Create a FBO with 4 FP32 RGBA attachment textures. Write in your shader to gl_FragData[], on click with a mouse read the pixels (16 bytes each), and display the fp values.
    It's not really streamlined and perfectly comfortable, but can be set-up in a few minutes and then modified for seconds. And this way I managed to find maths formula values for some of my shaders.
    Ah, and I use Magnifier meanwhile.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •