Overlapping Alphas in Unity 3D

In my last blog post, I unveiled the pheromone system and it’s accompanying overlay as a core game mechanic. The overlay was basic at best, and had one really irritating flaw – where two node’s pheromone indicators overlapped, the transparency is doubled. At best, this is pretty ugly, and at worst, it completely obscures the terrain behind it and ruins the data the overlay is trying to show altogether.

Note the hideous overlaps…

I searched high and low over the internet looking for an answer, but couldn’t find any decent solution to the problem. That is, until I posted on reddit asking for help, and a genius who goes by the name ‘Wompipomp’ came to my rescue. With his help, I came to a solution I’m pretty happy with.

Continue reading