How does one make Fog of War?

I’m sure that many of you have seen fog of war in an RTS game, like Starcraft or Civilization. For those of you who haven’t, fog of war hides everything farther than some pre-determined radius from any one of your units so that you can’t see what your opponents are doing. How would I achieve such an effect with Unity? I think it may involve a dynamic shader, somehow, but I really don’t know.

This has come up a couple of times. There are, at the very least, some decent starting points out there.

Let me google that for you :slight_smile:

http://www.google.com/search?gcx=c&sourceid=chrome&ie=UTF-8&q=unity+fog+of+war

There’s probably some built in method of doing that but I would probably just do a range check and set objects visible or not visible.

Edit: I just looked at some in-game footage videos - my suggestion doesn’t help. I agree with the dynamic shader approach. I almost wonder if you could darken your whole scene to pitch black and give each of your players lights.