Right now, you can select an object in our game, and it gets a nice green outline. And that’s great.
We do that by having the green emissive material in the PostProcessVolume, as item index 0 in our Blendables list, and then we call SetRenderCustomDepth(true) for anything we want to outline.
The problem is, while also outlining some things in green, we also sometimes want to outline other things in blue.
How can we do this? SetCustomRenderDepth() only takes a boolean, not an index into the Blendables list.
And if we add another element to the Blendables list, how will we tell the game which one to use?
Obviously we can’t modify the one material in the Blendables list, since we need one object to have a green highlight and the other to be blue – and the same material can’t do both.