- Home /
Unity - blur on one camera effects the other as well
I'm trying to fake a DOF effect for Sprites by using 2 cameras, one for the sharp objects, one for the blurred ones. I have set up the layers like Blur and Sharp accordingly.
So I have these 2 cameras, and I use Unity's Blur (optimized) script to blur things, and I have this script on only one camera, the one that is responsible for the blurred render.
I have the cameras like:
Cam 1:
Clear flags: Don't clear (this is the main, sharp cam)
Culling mask: sharp layer
has no blur effect (or any other post proc effect).
Cam 2:
Clear flags: don't clear (this is the blur cam)
culling mask: blur
Has Blur (optimized).
Now, if this blur cam is on the back, meaning its depth is LESS than the main cam's depth, I have a sharp player ground and a blurry background. However, I need a blurry foreground too that should be on top of the player ground.
The issue starts when I set the blur camera's depth higher than the main cam's. In this case, everything gets blurred, no matter that the main cam has no blur effect on it.
Question is, how to set this up so only the desired layers get the blur?
Your answer
Follow this Question
Related Questions
Render tooltip on top of everything with MRTK 0 Answers
Multiple image effects for different objects? 0 Answers
Best way to access RenderTexture immediately after camera render 0 Answers
Approach(es) to remove solid color background 1 Answer
Grab a texture from camera, before it adds the skybox? 0 Answers