Hi, It’s great to see the ZTest option is available, but I’m wondering how to set them differently in shader graph, say I want to display one color for the LEqual part and another color for the Greater part of the object?
Shader Graph shaders are always only a single pass (for the main forward pass at least), and GPUs cannot change the ZTest mid-shader execution. If you want to have different ZTest settings, you’d need to have two separate shaders and materials applied to your object.
I’d like to understand what you mean by two separate materials. Let’s say the mesh is just a single triangle. That single triangle can’t have two materials, can it, rendered on different passes?
Yes, just add two materials to your object and it’ll render twice. Once with each material. It’ll also pop up a big warning on the renderer component about this that you can ignore.
Interesting. I didn’t know that. However, I assume there’s no way to fake a multi-pass shader using this approach, where the output of one shader gets passed into the second shader as input?