NOTE: This package requires Unity Pro.
Ever wanted high-quality smooth fog of war for your strategy game? How about a line-of-sight revealing system for a heist game like Monaco? Well, now you can have it in 3 simple steps:
- Drag & drop the Fog of War prefab into your scene. You can find this prefab in Assets/Fog of War/FoW folder.
- Add FOWEffect script to your Main Camera. Make sure it references the "Image Effects/Fog of War" shader.
- Add FOWRevealer script to one or more game objects in your scene. It's best to add it to a game object located at around the unit's "eye level" in order for the fog of war to be accurate.
- Running on a mobile device or don't have Pro? You can adapt your object and environment shaders to eliminate the need for an image effect, making it perfectly suitable for mobile devices: http://forum.unity3d.com/threads/146...=1#post1022831
What makes it great?
- It's fast. If you already render to depth (for example using Tasharen Water), then you likely won't even notice a performance drop. In fact, with proper use of FOWRenderers hiding renderers hidden by fog you can actually increase performance.
- All line-of-sight calculations are done on a separate thread, so they don't affect your game's performance.
- It's smooth -- and level of smoothness also doesn't affect performance as it's done on another thread.
- You can specify how often it updates and how quickly it fades in and out, and the two work independently. Updating only twice per second will still give you perfectly smooth fading results.
- You can easily check to see if a point is visible, explored, or not.
- You can optimize the worker thread's performance even further by specifying that certain line-of-sight checks should only be performed once (stationary object).
- You get a script that can automatically hide all renderers under the game object that's hidden from view (FOWRenderers).
Play the Demo: http://www.tasharen.com/windward/fow/