How to make a top down field of view similar to Monaco

I’m working on a 2D top down game, that’s supposed to be stealth oriented, but I don’t know how to make it so you can’t see what’s on the other side of walls/corners/etc, similar to Monaco’s style, where you can only see whats immediately around you, everything is covered in a sort of fog.

Even though this is a rather old post, it was the first one I found when searching for a similar mechanic for a project I am currently working on.
So I thought I would post the solution I uploaded to GitHub for others to use in the future:

Line of Sight/Field of View on GitHub

The most simple way is to use a projector light going downward from the camera. Then use a cookie to make the shape. The cookie is that black and white texture that makes the light round, square or else.

The example above uses the opposite effect you are looking for. The scene is fully lit and the projector is projecting a black halo. You want the opposite, no light in your scene and the projector projecting light so that only what is around is lit.

This Facebook post explains exactly how they implemented the effect in Monaco: Facebook

Hey i find this usefull.

actually MOnaco makes that.