- Home /
How to apply post processing only to objects drawn by that camera?
I'm trying to get specific objects to glow on mouseover or selection. But the glow post processing assigned to my glow camera is being applied to the results of all cameras.
I have a main camera, and a "Glow" camera. The glow camera only displays items on the glow layer. The camera has the "Glow" post process effect assigned to it. Any item that I want to glow, I assign it to the glow layer, and the glow camera draws it and applies the post processing effect.
My glow camera is rendered after the main camera. The problem: The glow is applied to the entire scene, not just assigned to the glow layer. My main camera renders the environment, and the glow camera renders the glow object...but it also applies the glow effect to the scene rendered by the main camera.
It seems that ideally, I could draw items on a separate camera, with a transparent background, apply the post processing effects, and THEN overlay that onto my previous camera scene. Any suggestions/thoughts?
Should the topic be reworded: How to apply post processing effects ONLY to objects drawn by that camera?
Answer by hydrix · Jan 30, 2017 at 07:39 AM
here's how I did this:
main camera:
"clear flags": depth only
"culling mask": layer I named "PrePostProcess"
"depth": higher than other camera- 2
secondary camera with postprocessing effects:
"clear flags": skybox
"culling mask": everything I want postprocessed- "Everything" except "PrePostProcess"
"depth": lower than other camera- 1
finally:
I went around marking everything I wanted not to be postprocessed with the layer "PrePostProcess"
In your example the postprocessing camera is rendering the background. So this doesn't work if you want to apply postprocessing to 3d objects above a 2d background.
Your answer
![](https://koobas.hobune.stream/wayback/20220613073404im_/https://answers.unity.com/themes/thub/images/avi.jpg)