0
\$\begingroup\$

I have a 2D game and I wanted to apply bloom to the main GameObjects so I attached the effect onto the main camera, however the background also gets affected by the bloom and it gets all shiny. How can I make it ignore the bloom effect?

\$\endgroup\$
  • \$\begingroup\$ I never did that with camera effects. But you can give a try to create a new camera, set culling mask only to background. background is the layer applied to your background. Also remove background from culling mask of Main Camera \$\endgroup\$ – Hamza Hasan Mar 9 '16 at 17:51
  • \$\begingroup\$ @HamzaHasan Isn't that how it's usually done? Anyway, I did what you said, but now the background is not shown on the main camera. The main camera's depth is 0 while the no-fx-camera's depth is 1 \$\endgroup\$ – Milen Mar 9 '16 at 17:59
  • \$\begingroup\$ Also set skybox to don't clear of second or both cameras. And revert the depth sequence. \$\endgroup\$ – Hamza Hasan Mar 9 '16 at 19:02
  • \$\begingroup\$ @HamzaHasan And now the GameObjects disappear \$\endgroup\$ – Milen Mar 10 '16 at 14:18
  • \$\begingroup\$ I can't say anything without having anything. But you can manage with it. Play with the attributes \$\endgroup\$ – Hamza Hasan Mar 10 '16 at 14:55
2
\$\begingroup\$

Bloom effect in Unity is actually a post effect which means it works after all the GameObjects have been rendered by the camera, and it can't be seperately affected.

The only way you can do this is use two cameras, one for the main GameObjects and one for the background, and properly set the layer and Camera's culling mask of the cameras

Check this doc for more detail http://docs.unity3d.com/Manual/Layers.html

\$\endgroup\$
-1
\$\begingroup\$

Since the Unity bloom effects are post processed, they apply to the whole screen, so they can't be controlled by camera layers. Fixed it by not using it.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.