- Home /
Two cameras depth-sorting correctly (for use with blur etc.)
Hi,
Is there any way I can use two cameras by having a Canvas set up to render the second camera - and still have depth sorting stay intact across both?
I'm trying to use a second camera with a blur effect that renders just one item (just one item for now), while another camera renders the rest.
I've tried combinations of different settings for Clear Flags on each camera, and changing the overall depth of each camera to change which camera renders first.
The best combination I could find was to render the main camera first, without skybox, and render the blur camera second. That way, the blur would appear behind objects like a glow (which still isn't completely right, really), but if I have a large plane for a floor, it should be showing underneath, but because it's still being rendered as part of the main camera, it's showing above the blurred object in the second camera.
I don't want to keep deciding on an ad-hoc basis the layer & camera that should be used for each object in a scene - this would change based on where the player's standing, surely.
Hence the question: Is there any way I can use two cameras by having a Canvas set up to render the second camera - and still have depth sorting stay intact across both?
Thanks
EDIT: I found a near perfect example of this - Kyle Halladay's selective blur.
http://kylehalladay.com/all/graphics/2013/07/02/Selective-Blur.html
However, there are still some things I'll need to work out, like a way to reintroduce shadows, since the material provided doesn't support both.
Your answer
Follow this Question
Related Questions
Psychedelic camera effect 2 Answers
UI Camera Doesn't Render UI Elements When Blur Effect is Added on Main Camera 0 Answers
Multiple camera question 2 Answers