I have a plane mesh (a custom trail) that uses an advanced shader in URP and I need it to detect overlaps and change it's color to red.
The application is 3d and the trail is always drawn at y zero. The user needs to have visual feedback when the trails overlap so they can fix their route. I am trying to do it using a Stencil Shader but stencil for URP doesn't work like in built-in renderer.
This question has exactly what I need to do, but the shader doesn't work in URP. Whatever shader I try to do multiple passes of stencil it just renders the first pass and never detects the other passes.
In URP I was able to use stencil only with one writer shader and one reader shader and Replacing the stencil buffer (adding doesn't work).
Since it can't detect the two different passes I can't even do it using doubled objects with writer and readers and my reader having a pass for the advanced shader and one for the flat red color.
Remember, I need a bunch of plane trails to detect overlapping and self overlapping. Can anyone make it work or suggest another approach? (I must finish this at my job)