Hello there!
I’m currently working on recreating a Persona style battle system, and am currently in the process of recreating Persona 3 Reload’s battle intro animation, which looks like the following:
Currently I have a material and use URP settings (Render Objects) to make the silhouette appear when the player is behind objects, which looks as follows:
so that I can make the actual animation of the battle introduction showing the silhouette behind a black screen, where the black screen then pans away showing the actual scene in real-time.
If somebody could help me figure out how to get the silhouette to appear behind UI, I’d be very grateful!
Hey.
The effect works by reading the depth buffer to find out if anything is in front. That means that the geometry obscuring the model has to be rendered before the render objects pass runs.
UI is always rendered after the camera has finished and so would never be able to write to the depth buffer before render objects. Which means, UI can’t really be used in this scenario.
I would recommend to just put a quad with an unlit black material in front of the camera and use that to obscure and cause the blue silhouette to be rendered.
If you need to use UI for the black sprite then you would need some other way to render the blue silhouette.
wouldn’t screen space and playing with canvas renderer’s sorting layer (forgot what they’re called exactly) achieve this?
and/or just adding a material to that Image/RawImage and then it’s just a matter of playing with the material’s params or (more probably) finding/creating a shader for it
another option which I really like in terms of the applicability space is rendering a camera to a texture – you can use thistechnique in so many contexts