Fog of War

How can i fog out portions of the screen? I want it to be like any other RTS or top down RPG where you can’t see much distance beyond the player(s). I can technically do it with verrtex colors, and getting vertex relation to the player objects and then setting an alpha material, but with a large grid mesh and only a few characters, i begin lagging immediately as it has to make (chars)x(vertex) calculations/tic. Pretty much, i just want a non-resource intensive way to do fog of war. doesn’t have to be pretty, just black out things is fine. ty.

o/ -Scalia

I believe smoking_mirror has done extensive research into this. Hopefully he will pop buy and offer advice.

I would implement this with a dynamic texture so you can use the plot command and blanket whole areas at the same time with a single distance check. Coupled with some optimization (such as not bothering to check objects that are known to be a long way inside the already seen area) this should be fast enough for a hundred or so objects.
In CaveX 16 a similar method was used to black-out areas the player wasn’t able to see.

Another idea: the scene is lit using spot lights above each units. Turn off specularity on those lamps to boost performance hugely.