Vision Fog Renderer Feature
A URP renderer feature that draws every shown Fog Of War over the rendered frame, in 2D, isometric and 3D, with all styles. It works with the 2D Renderer and the Universal Renderer, and uses the Render Graph.
How to add it is described in Installation.
Settings
| Setting | Default | Description |
|---|---|---|
| Shader | Assigned automatically | The fog shader. It is saved into the renderer asset, so it is included in builds |
| Injection Point | Before Rendering Post Processing | When in the frame the fog is drawn |
With the default injection point, bloom, color grading and other post-processing apply on top of the fog, and the fog looks like part of the scene. UI on a Screen Space - Overlay canvas is always drawn after it, so it stays above the fog. Screen Space - Camera and World Space canvases are drawn with the scene and get covered.
What needs it
| With the feature | Without it (fallback overlay) | |
|---|---|---|
| Color and Texture styles | Yes | Yes |
| Blur style | Yes | No |
| 3D Flat display | Yes | Yes |
| 3D On geometry display | Yes | No |
For On geometry the feature requests the camera depth texture itself, so you do not need to turn on Depth Texture in the URP asset.
Several renderers and cameras
Add the feature to every renderer your cameras use. Many projects have one renderer per quality level, and a camera can use a different renderer than the default. Each camera that uses a renderer with the feature draws the fog.
Checking that it works
In Play mode, a Fog Of War that is drawn with the fallback overlay shows a message in its Inspector after a moment. For the Blur style and On geometry display the message is a warning, because those do not work without the feature.
If the fog shader cannot run on the current platform, the feature draws nothing and the fallback overlay shows the fog instead.