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?

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.

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.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.