- Home /
Blurring only the top camera
I am rendering light shafts and want to blur them to mask some edge artifacts. Enclosed is a picture of what it looks like now.
Basically my current set up is that I have one camera rendering the entire scene, except the light shafts, and then I have another camera in front of it that does not clear the depth or color buffers, that is rendering the light shafts.
I thought this would be relatively easy -- the camera previews show exactly what I would expect, and the final image is composited as it should be. The only problem is that once I apply the blur image effect to the light shaft camera, the entire scene is blurred, not just the light shafts.
In general terms, I want to be able to render a light effect that is masked by the z-buffer properly (but does not write to it), blur it, and composite it with the rest of the scene using simple additive blending. I've been searching for hours, and although I've found many questions similar to mine, I haven't found any answers.
Thanks so much!
Did you find a solution for this problem? I'm having the exact same issue in my project. Thanks for sharing
Answer by bernardfrancois · Sep 11, 2013 at 04:01 PM
Since blurring the scene is a post-screen effect, it blurs the entire view buffer.
I suggest the following solution:
Rendering the top camera to a MovieTexture (Unity Pro only)
Applying the blur to that camera
Showing the movieTexture on a plane
Having an orthographic camera render that plane. The Ortographic Size must then be set to half the height of that plane.
I didn't try if this works, but let me know if it worked or if you encountered any issues with it.
This doesn't work because the blurry camera only blurs between what it sees and a solid color (set by the clear flag color, usually black) and doesn't seem able to blur with transparency (setting alpha=0 on the clear flag color doesn't work, not does setting other clear flag options). The end result is strange looking colored blobs underneath the things the blurry camera renders.
Your answer
Follow this Question
Related Questions
Unity 5 image effects for multiple cameras 1 Answer
Make GameObjects dynamically visible/invisible for certain cameras 1 Answer
What are the performance issue of using multiple camera in layers (Mobile) 0 Answers
Render Splitscreen to RenderTexture 0 Answers
Unity - blur on one camera effects the other as well 0 Answers