How to implement Fog Of War with an shader?
- by Cambrano
Okay, I'm creating a RTS game and want to implement an AgeOfEmpires-like Fog Of War(FOW).
That means a tile(or pixel) can be:
0% transparent (unexplored)
50% transparent black (explored but not in viewrange)
100% transparent(explored and in viewrange)
RTS means I'll have many explorers (NPCs, buildings, ...). Okay, so I have an 2d array of bytes byte[,] explored. The byte value correlates the transparency.
The question is, how do I pass this array to my shader? Well I think it is not possible to pass an entire array. So: what technique shall I use to let my shader know if a pixel/tile is visible or not?