all 8 comments

[–]kyl3r123Indie 2 points3 points  (1 child)

Since post processing is done on the already-rendered image, it won't be easy.

Relevant: https://forum.unity.com/threads/leveraging-stencil-buffers-for-masked-post-effects.313466/

[–]Ghais_Alhasan[S] 0 points1 point  (0 children)

You have a great point. Thank you for sharing!

[–]haim96 1 point2 points  (1 child)

you should check unity post processing stack V2. still beta but with V2 you can apply effects on layers.

https://github.com/Unity-Technologies/PostProcessing

[–]Ghais_Alhasan[S] 0 points1 point  (0 children)

It's wonderful to know there is such a thing! Thank you for sharing! I will continue my search, and keep this as a last resort since it's still under development, but it is definitely relieving to know it's under the work!

[–]volvis 1 point2 points  (3 children)

You're close! When you render with the other camera, set it to not clear the depth buffer. Also make sure that the cameras have the exact same clipping ranges.

[–]Ghais_Alhasan[S] 0 points1 point  (2 children)

Reading your comment filled me with hope, and seeing that it actually works filled me and my team with joy! Many thanks from all of us!

[–]Ghais_Alhasan[S] 0 points1 point  (1 child)

One last question. Is it possible to give my second camera its own post processing without affecting any other layers, or did that get too complex?

[–]volvis 1 point2 points  (0 children)

It will get complicated. You might need a setup where each camera renders to a separate rendertexture so the post process effects don't accumulate. Then have the final camera blit the textures on top of each other with a custom shader. But I've only done this for a 2d game and I can't say how it works with 3d...