- Home /
Best method for implementing alternative view modes? (like Cities: Skylines "Info View")
In Cities: Skylines, you're able to switch between various "Info Views" that give you a visual representation of different building attributes. For example, the Power View will color buildings based on if they're powered or not, Water View will show you if they're getting water or not they're getting water, etc. (I'm attaching some screenshots for those who haven't played the game).
I'm hoping to implement a similar feature in a game I'm working on, but have no idea where to start. My first thought was to replace the material of the object based on its status, but changing the material of hundreds if not thousands of objects at once is not particularly performant. I found a Reddit post suggesting that using replacement shaders would be a better way to go, but I can't figure out how to implement them in this way.
For example, he suggests creating a "BuildingType" tag, then creating sub shaders for Tags { "BuildingType"="Medical" }, Tags { "BuildingType"="Security" }, etc. My questions are:
1) How would you go about tagging a given building as Medical, Security, etc. so it uses the appropriate shader?
2) Let's say you needed to switch what tag a building has (i.e. it goes from "Powered" to "Unpowered") how would you go about switching that tag?
Thanks!
Hi there, did you ever find a solution? Looking for a solution myself @AdamBL
Your answer
Follow this Question
Related Questions
Changing HDRP Material's Texture At Runtime Not Working? 2 Answers
How to apply a color to the second texture in this shader? 1 Answer
How can I have a transparent ring around a transparent planet? 0 Answers
How to Properly create & apply a normalmap and specular? (Hard Surface Shader Free) 2 Answers
Set Material Texture Border 1 Answer