Global Shader Question

Right now Im applying a global shader that looks like overdraw mode using


That works fine, I can temporarily change everything in the scene to render with my overdraw shader when the function is utilized.

However, Now I have 2 gameobjects in the scene that are a type of tactical overlay. I dont want them to be rendered with my global overdraw shader like every other gameobject in the scene.

So is there a way to use Camera.SetReplacementShader() or something similar to apply a global shader to everything except one or two game objects? or am I out of luck because of the nature of using a global replacement shader?

There are a couple options I know of. The easiest is probably to just use a separate camera that renders only the tactical overlay mesh.

The other option involves a couple steps: you have to give your tactical overlay material a new replacement tag. (e.g. “RenderType”=“TacticalOverlay”). In your replacement shader, you have to copy the SubShader(s) the tactical overlay is using. That way, the shader replaces the SubShader it had been using with identical code, and it only happens for that material.