Shader debuggers

Deano Calver

Newcomer
If you believe the hype, now that HLSL, Cg and GLSLang are here, writting complex shader is almost trivial.

They helped but writing shader is still a difficult process, the problem is lack of decent debuggers, as the shaders have got longer the chance of bugs entering the shader has increased and then the trouble begins. With no way of checking any data you're basically shooting in the dark.

Pixel shaders are easier to debug as you can just output a colour and check its roughly what you want but even this can be difficult (you have to know the range etc). With complex vertex shaders you get nothing.

I'm currently struggling with this issue, I'm working on a vertex shader (a barycentric surface basis thingy) that isn't working. I just get no output, ntothing nada. I don't have any way of checking except to randomly change bits of code and hoping something (even something wrong) appears on screen.

The debugger I do have (DirectX 9 shader debugger) is so tricky to get working, it never has for me. What I want is to to set a breakpoint in some HLSL code and have the debugger tell me whats in the registers at that point. Is that so much to ask?
 
Yah it works

It was a combination of data and shader problem. Forgot that one element of the packed D3DCOLOR vertex stream input didn't want normalising but the rest did.

And this is the result
surfacebasis1.JPG


I can tell your not impressed.... :p but it will get better, that cube will go on the better things like surfaces and displacement maps. (If your interested the colouring is the barycentric coodinates of the each triangle)
 
Back
Top