Custom render pass: Culling layers blending

Hello,

I’m trying to achieve a custom render pass where I can ‘blend’ between two views of the same camera with different culling layers; do you know if that is possible?

I would like to have this effect: (2:35)

but without setting the material’s shader/alpha, since I’d like the character to fade without seeing the different renderers pixels multiplied one onto another while fading

Thanks :slight_smile:

Hm… just seeing at this image :

Feels like render passes won’t allow me to do that…
that means that I’ll have to make a custom shader for each shader I want to fade + be sure ZTest/Stencil works as I want (to avoid multiplies on the same Layer)

Sorry for the post, I’ll still read if you think that’s its possible or if that’s not or just a bad idea to begin with :stuck_out_tongue:

Okay, so I guess, what I want is something like that : AlphaVertexLitZ - Unify Community Wiki

but… it isn’t as easy at it seems with HDRP/Lit becoming Transparent : my color changes completely; the lighting isn’t kept…

If I had Camera stacking (URP-like), it would have been an easy trick ^^’

All right, so I managed to get it working with compositor (with an alpha of 0.5f)
It seems to have issues with Cinemachine though : cameras are being activated when they shouldn’t.
I’ll try to fix that and the set the alpha value (could use a static variable for that)
but I finally have the result I wanted :slight_smile:

Just… I won’t be able to use it as it takes too much perfs x)

since Compositor re-draws the sky, then I have to re-redraw everything else and lerping between the two cameras (and not just blitting a culled camera rendering); so… not effective

Hello,

Switching to a transparent material for your character fading is a bit tricky and it’ll probably not work for several features because transparent materials don’t write in the depth buffer we use in all our screen space effects (like SSR, etc.). So you’ll not get the same look as opaque even with an opacity of 1.

A simpler approach for this would be to do a single ShaderGraph for all the objects you want to fade and then do a dithered fade using an alpha clip instead of transparent objects.

Oh, nice idea :slight_smile:
I’ll try this :

1 Like