draw fog of war using shaders

Posted by lezebulon on Game Development See other posts from Game Development or by lezebulon
Published on 2014-06-01T14:08:57Z Indexed on 2014/06/01 22:01 UTC
Read the original article Hit count: 357

Filed under:
|
|
|

I am making a RTS game, and I'd like some advice on how to best render fog of wars, given what I'm already doing.

You can imagine this game as being a classic RTS like Age of Empires 2, where the fog of war will basically be handled by a 2D array telling if a given "tile" is explored or not. The specific things to consider here are :

1) I'm only doing a few draw calls to draw the whole screen, using shaders, and I'm not drawing "tile by tile" in a 2D loop

2) The whole map is much bigger than the screen, and the screen can move every frame or so

In that case, how could I draw the fog of war ? I have no issue maintaining on the CPU-side a 2D array giving the fog of war for each tile, but what would be the best way to actually display it dynamically ? thanks!

© Game Development or respective owner

Related posts about opengl

Related posts about shaders