Page 1 of 1

How to Debug Shaders

PostPosted: Tue Jan 23, 2018 11:51 am
by JohnnyDalvi
Hello,

I was wondering if it would be possible to see the actual values of the variables within a shader while it is running, perhaps an option to choose a pixel in the screen/object so we can access all the values regarding the rendering of that specific pixel. Or any other way to do something that would allow me to check variable values in the middle of the node editor instead of just being able to see the debug input color. This would be great.

Re: How to Debug Shaders

PostPosted: Tue Jan 23, 2018 12:23 pm
by Amplify_Borba
Hello JohnnyDalvi, thank you for getting in touch!

We intend to provide a few related options in the future for value preview and debug, and although it might not seem like it, its in fact a complex subject.

Could you further elaborate on what specific values and effects you're looking to debug?

For now, feel free to make use of the Debug port in the Output Node, which allows you to preview connected nodes directly in the viewport on any assets using the shader.
Connecting wires to the Debug port will not break existing connections, so it's a great way to visualize what you are building without destroying existing complex connections.

You may also consider the following debugging options available through Unity and Visual Studio:
Unity - Frame Debugger
Unity - Debugging DirectX 11 shaders with Visual Studio
Unity Community - Debugging shaders in Visual Studio

Please let me know if the shared information helped, looking forward to your reply!

Re: How to Debug Shaders

PostPosted: Tue Jan 23, 2018 3:11 pm
by JohnnyDalvi
Thanks for the fast reply, amazing support service!

This indeed would be awesome. Isn't related to a specific shader or effect, overall I'd be able to figure way faster why a shader isn't giving me the expected result by being able to see the exact number that goes out from an "Multiply" node for example, or even the output displayed as float4 right after an "Add" node between two colors, just like the debugging tools available for scripts in some IDE.

The Debug input is indeed a very useful tool, but the ability to see variables within the nodes like I suggested would be priceless.

I've just browsed those links you've shared, that's helpful, stepping in through the shader like that is very powerful to whom use VS (which I do), I'll take a further look at this option. Thanks again!

Re: How to Debug Shaders

PostPosted: Tue Jan 23, 2018 4:57 pm
by Amplify_Borba
JohnnyDalvi wrote:Thanks for the fast reply, amazing support service!

This indeed would be awesome. Isn't related to a specific shader or effect, overall I'd be able to figure why a shader isn't giving me the expected result by being able to see the exact number that goes out from an "Multiply" node for example, or even the output displayed as float4 right after an "Add" node between two colors, just like the debugging tools available for scripts in some IDE.

The Debug input is indeed a very useful tool, but the ability to see variables within the nodes like I suggested would be priceless.

I've just browsed those links you've shared, that's helpful, stepping in through the shader that is very powerful to whom use VS (which I do), I'll take a further look at this option. Thanks again!


Thank you for the kind words and for providing additional details, we'll be sure to take your feedback into consideration as soon as we're able to look into this matter.

Have you had the chance to rate and review Amplify Shader Editor? It would be awesome if you could share your experience with the Unity community, the Unity Asset Store thrives on user interaction and direct feedback. Every bit helps, your feedback is extremely valuable to us!

Please don't hesitate to get back in touch if you have any further questions, thanks!

Re: How to Debug Shaders

PostPosted: Tue Jan 23, 2018 5:55 pm
by JohnnyDalvi
Just rated it over there :D

Re: How to Debug Shaders

PostPosted: Tue Jan 23, 2018 6:48 pm
by Amplify_Borba
JohnnyDalvi wrote:Just rated it over there :D


We are humbled by your kind words and support, thank you so much!

Please let us know when you have any further questions, we'll be glad to assist!