Apply post processing to objects rendered by a specific camera only

Hello everyone,

I’m just trying to use the post processing stack of Unity for the first time, with the preview package version 2.0.17 and even with the help of the documentation I’m not able to achieve what I would like to do.

My example is simple, I have a scene with 2 cubes:

And I want to apply a bloom effect to the cube to the right only. So what I’ve done is:

  • Change the layer of the right cube to PostProcessing
  • Update the Main Camera culling mask to only render Default layer
  • Create a copy of the Main Camera and change its culling mask to only render PostProcessing layer + the clear flags to Don’t clear + change the depth from -1 to 1 to render after the Main Camera

Now, for the post processing part, I’ve added a Post Process Layer component to the PostProcessCamera:

3927574--335443--unity-pp-4.jpg

Then I’ve created a new game object with the PostProcessing layer on which I’ve added a Post Process Volume with its Is Global checkbox ticked. I then created a post process profile file with a bloom effect like that:

But in my scene, both cube are bloomed (I will ask you to believe me, I can’t post more image :s).

Do you know why? Did I do something wrong? How can I achieve what I want to do?

The “Don’t clear” option means whatever was rendered by previous cameras is used as the background. Thus, the second camera starts with the first cube and background already visible and the second cube just gets rendered on top. The post process effect still applies to everything, because everything is what the camera sees.

Try stepping through using the Frame Debugger.

There are a ton of threads on how to apply post processing to a limited set of objects on screen, but the TLDR version is you need to write custom post process effects to do this.

Thank you for your answer @bgolus .

Now that you said it, it’s pretty logical indeed. If it’s a hot topic, I will perform some searches, thank you again.

1 Like

Did you find a good way to solve this?

Sorry, I don’t remember why I needed to do that and how I fixed it.

But if I had to apply bloom on a specific object today, I will probably use HDR with an Emissive color!

I will learn this.

I wanted to blur only one specific camera or sorting layer. It’s a really hard problem.