Custom render order for objects
In Robo Recall, when you pause the game, the widget stays on top of everything except the player's hands and the line trace. Example:
In order to replicate this feature, I've tried 2 things:
First: disable "Depth Test" on the widget material, so that it could be rendered on top of everything. This works, but it also stays on top of the hands.
Second: keep "Depth Test" disabled, and create a post process material that uses "Custom Stencil". Here's the material:
I explain my understanding of the material below.
Now, using that Robo Recall picture as a reference, in the hands mesh (controller), I enable "Render CustomDepth Pass" and set the "CustomDepth Stencil Value to 3", do the same for the particle system (ray tracer) but change the value to 2, and I also have a little sphere that is at the end of the particle system, in which I do the same and change the value to 1.
From my understanding, using the above material on a post process volume would allow the hand to be on top, the particle system next, and then the sphere (the bigger the CustomDepth Stencil Value, the object is rendered on top of the values below).
So, with what I currently have, only the sphere stays on top of the widget. Basically, only the object that has "CustomDepth Stencil Value to 1" is above the widget. But the hand is above the sphere and below the widget, which is not what I want.
Why is the hand mesh and the particle system not on top of the widget? If you know other way to accomplish this feature, I would be glad to hear it.
asked Sep 01 '17 at 11:46 AM in Rendering
I wanted to do the same thing and managed to accomplish this by simply setting the opacity to 0 for my indicator if there's anything in the custom depth pass closer than the horizon since (in my project) the hands are the only things that show up in the custom depth scene texture anyway.
answered Oct 24 '18 at 11:18 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here