Debug / output / print / trace in HLSL script

Hi,

Sorry if this has been asked before, I can’t find an answer anywhere in the forums.

Is there any way to log/output a variable value from a shader script to the unity console?

Or any other way to expose the variable?

Thanks :slight_smile:

1 Like

No, there is no way to print from a shader (HLSL or other). Shaders run on the GPU, which does not support such concept. One way to at least get some information, is to output your values as a color in the fragment shader. This is a bit cumbersome, but it’s better than nothing.