- Home /
How to change shader color based on collision layer or tag
I would like to render the scene to a camera, colored based on either collision layer or gameobject tag. Is there a way to do this with a shader?
If not, I guess I could create a script to run through all the gameobjects in the scene and change their materials, but that would affect all cameras. I want to do this for only one camera.
What I'm trying to do is create a simple way of doing image segmentation, which I could then use as an input for Unity ML Agents. The camera attached to the agent would view everything segmented, while the main camera would be able to view the scene normally.
image segmentation example:
image?
Your answer
Follow this Question
Related Questions
Question about setting layers. 1 Answer
UnityException: GameObject has undefined tag! 2 Answers
How to find one object in specific layer? 1 Answer
Okay This is Officially WEIRD! Layers flipping out by themselves. HELP 0 Answers
Objects not drawn with custom vertex/fragment shader when in any other layer than the default layer 1 Answer