Help coming up with a performance light visualization method

Hello!

In my game Atmocity, buildings have an efficiency variable that determines stuff like population capacity, resource output etc. I would like to somehow make a visualization mode so that players can easily find areas that are underperforming.

Essentially what I would like to accomplish is to lerp from this:

To something like this:


(naturally with all buildings colored)

Since my knowledge of shaders and image effects is pretty limited I’m open to ideas on how to do this in a performant way. I have to keep using the standard shader and don’t want to switch materials, since we’re talking about potentially hundreds or thousands of buildings.

Any ideas?

Ok, managed. :slight_smile:
For those interested:
Make a replacement shader, feed it with some values for color code.

Turns this:

Into:

In action:


How did you solve this problem? Screen space and mapping world pos of the point to the correct building/parcel? Or any other approach? Thank you so much!

A replacement shader replaces the standard shader. The replacement shader is pretty much just a gradient with shadows and lighting turned off.
Buildings can inhabit the same space (building origin is in the center of a 1x1x1 space, so several buildings can have the same location). Because of this I pass the building’s efficiency variable via a material property block to the shader instead of using world pos. This 0-1 variable is then interpreted as a red to green color that is added on top of the gradient.

I will be doing a short tutorial on this fairly soon.

1 Like