Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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.

share|improve this answer
    
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 '10 at 16:31
add comment

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

share|improve this answer
    
typo: its specs –  Lohoris Nov 10 '10 at 14:20
    
thx. =) I get those right 70% of the time. I blame DainBramage. –  Nailer Nov 10 '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 '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 '10 at 19:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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