I've been recently tossing around the idea of making a game with XNA 4.0. One feature I really wanted was the ability to move between night and day and have darkness in caves, etc. Having never messed with shaders before I spent a good amount of time playing with HLSL and learned how to do the effect apparently known as "fog of war."
While researching this technique I ran across many people asking for help with this and most of the help was pointing to broken links or deprecated information. While I make no claims about the quality of the code I do imagine that this will be useful to someone searching for this technique.
If you're just looking to get your feet wet you can download a working demo here.
The following images were used to render the scene:
Background courtesy of Open Game Art
This scene without any effects applied.
The lighting mask dynamically created with additive blending.
The final rendered scene.