Sign in to follow this  
SymLinked

Printf-like debugging of HLSL?

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this