How can I exclude certain objects from being black and white?

I am using a Post Process to make my level almost black and white, and I need certain things like my widgets or some meshes to be not affected by that but be in full color.

IMPORTANT NOTE: Links to tutorials about how to make objects visible through walls using custom depth are useless for this particular problem, I managed to make objects ignore Post Process using this method but turns out they can not be stopped from being visible through walls.

So can this thing actually happen?

UPDATE: Turns out the custom depth enabled objects STILL can be seen through walls, just very slightly unless a light hits them, then they go full on. Still looking for a solution.

FINAL UPDATE: If we activate custom depth to all the objects involved, the see-through effect stops. So now they all are depth-enabled, the colored objects have a value of 2, and the ones I want black and white 0.

  1. Set Custom Depth Stencil Pass to
    Enabled with Stencil in project settings.

  2. Set custom stencil value to 2 (just
    as an example) for objects that
    shouldn’t be affected by the post
    process.

Also, I’m pretty sure those tutorials are valid. The only difference is that you shouldn’t disable depth test in the material.

I found that my Material is different than yours. I am fixing it now. Can you please tell me what should I put where it says post-process effect? And “If” hooks where?

You plug the code that achieves the black and white look in Post process effect. If node is connected to Emissive input in the post process material.

Ok, I have this now, everything is black and white but the building I set as “2” is also black and white. I am close, but what am I doing wrong?

Can you see the building with custom stencil preview enabled?

This should work

No, everything is black :frowning:

Success! I had just “Enabled” in project settings, not “Enabled with stencil”. Testing now.

I can confirm Objects do not show through walls now, and the effect of colored objects in black and white world works perfectly! Thank you very much!

Any idea why I can’t control the amount of desaturation this way?

You need to use a component mask RGB for postprocessinput0

That stops the effect of colored building in desaturated world. So confusing!

Got it! The mask should be RGB, not just R!