Debugging shaders
by Erik Madison · in Torque Game Engine Advanced · 03/12/2007 (1:26 pm) · 2 replies
Some of my custom shaders aren't producing what I expect. How, or perhaps, is it possible, to debug shaders from within TGEA? I can rendermonkey them all over, and everything is fine. I can ::errorf all my data I'm passing in, and see the values I expect. Yet somehow, what the shader is getting isn't proper. Is there any way to log or watch the values while the game is running?
A second question: Can a shader pass its results to another shader, other than the v->p pipe? At a slightly later date even? A few of the stock shaders do some things I will need a pass or two later on. How they got their input was pretty intensive, so I'd really hate to redo all that. It would greatly simplify and speed up, if that data could be passed on to my shaders that will be called shortly thereafter (yet from another func, so the inputs are no longer avail as is).
Sorry if this is 101 material, shaders weren't even considered when I was in school. Reading current books doesn't really help much, as TGEA is it's own beast.
A second question: Can a shader pass its results to another shader, other than the v->p pipe? At a slightly later date even? A few of the stock shaders do some things I will need a pass or two later on. How they got their input was pretty intensive, so I'd really hate to redo all that. It would greatly simplify and speed up, if that data could be passed on to my shaders that will be called shortly thereafter (yet from another func, so the inputs are no longer avail as is).
Sorry if this is 101 material, shaders weren't even considered when I was in school. Reading current books doesn't really help much, as TGEA is it's own beast.
About the author
#2
03/12/2007 (3:31 pm)
Hmm, I'll have to try those. I have used NVperfhud numerous times, but only to guage, well, performance :) I didn't realize it had other uses. Thanks.
Torque 3D Owner Phil Carlisle
Alternatively both ATI and NVIDIA have such tools I believe (NVPerfHud I think is NVIDIA's one). Alternatively, there is a program called d3dxripper or similar (its got dx and ripper in the title) that captures a single frame of output in its entirety into a seperate file (including shaders etc) and lets you look at it. Best bit is that you can import the scene into max and take a look at it :)