Creating fog

I’m making a game where most of the board is hidden and covered in fog, except for around the area you start out in. As you move your characters, more of the map is revealed. Is there a way to make all areas of the map white except for certain areas, and have it uncover in real time?

The only way I can think of is to make a completely white image, and edit each individual pixel to make them transparent, but that would be way too slow.

Why not make a full screen picture with a transparent area. The picture should be the last to be executed in the draw function. If the visible area is not static make a row of pictures with the hole animated, so it looks like moving fog.

That would work if the fog region was static or animated, but in my game the fog should uncover as you explore more of the map. The terrain can also change by user actions (placing buildings, moving vehicles).

Make a foggy image the size you need, with light gray and white zones, but not transparent. Make a regular mesh (take the code from my planet tutorial). Set the texture of the mesh to your image. Set the colors[i] of the vertices[i] that are in opaque region to color(255,255,255,255). Set those that are in a transparent region to color(0,0,0,0). You can have an intermediate region where the color is (255,255,255,x) to gradually remove the for. Draw the mesh on top of your game. That should do it.

you could also do it without texture image, but just settings thr colors of the vertices white and more or less transparent. This how i made the shadow on the planet (in my case the color was black).