up vote 7 down vote favorite
1
Share on Facebook

I'm in the process of debugging GLSL vertex shaders and I can't shake the feeling that I'm doing it wrong.

In general I have two strategies to make up for the lack of tracing

  • I stuff values into a debug color varying that I pass to the fragment shader and then try to interpret the colors.
  • I change the vertex shader code and see what happens.

I'm thinking that ideally I could make up for the lack of tracing by writing values to a texture somehow, reading the texture from the GPU and printed the values stuffed in the texture.

My guess is that there might be way better ways. Any suggestions?

link|flag

2 Answers

nVidia has an awesome shader debugger. You can find it, and its specs, HERE

link|flag
typo: its specs – Lo'oris Nov 10 at 14:20
thx. =) I get those right 70% of the time. I blame DainBramage. – Nailer Nov 10 at 15:35
no GLSL support though :(, but it looks like I can convert cg shaders to glsl automatically, might give that a try. – Jonathan Fischoff Nov 10 at 16:30
You're right about that, but I think the advantages outweights the disadvantages. Besides, FX composer is a pretty nifty app. – Nailer Nov 10 at 19:53

A friend of mine has used glslDevil for this, and said it was okay.

If you're not tied to GLSL, Microsoft has an incredible tool for DirectX called PIX, but I don't think there's anything equivalent for OpenGL.

link|flag
I've downloaded glslDevil but I can't get most of the features to work. The tracing works, and the stepping through shaders but I can't see the values of variables. – Jonathan Fischoff Nov 10 at 16:31

Your Answer

 
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.