Now I need to expand my use case. I want to react to the eye (as found in unity_StereoEyeIndex) that is currently being rendered (URP with Single Pass Rendering). I want to set a different stencil value per eye. How would I do that? Is there some sort of “if” condition I can use in the stencil block so that I could declare two properties? I also tried passing a float array but I get an error when writing
That is a good hint already! In LWRP there is no multi-pass support though. That will probably make this not work. I could assign two materials to the object which would cause unity to iterate twice over the shader. That might do the trick at a bit higher cost. What does o.pos = float4(0,0,0,1); do exactly? Will it tell the shader not to set the stencil there?