Jump to content
  • Advertisement
Sign in to follow this  
SymLinked

Printf-like debugging of HLSL?

This topic is 3698 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a (simpler) way to watch variables and numbers in your shaders? I've run into an issue where a normal is always passed as 0,0,0 but it's in the shader code somewhere and not in the C side of things. I suppose there's PIX/PerfHud but it seems so overkill. I would love a way to just print those variables somewhere or pass them back to my C code, if it was possible.

Share this post


Link to post
Share on other sites
Advertisement
Well you could just do something like


if(normal == float3(0,0,0))
return float4(1, 0, 0, 1);


and that would let you know. But I don't see why PIX is overkill for this at all...you'll be able to see very quickly and clear what values are passed to your shader.

Share this post


Link to post
Share on other sites
I took your advice and went with PIX again, guess I tried an old version before.
In any case, it was helpful :)
Thanks!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!