Renvix Assets

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

SettingDefaultDescription
ShaderAssigned automaticallyThe fog shader. It is saved into the renderer asset, so it is included in builds
Injection PointBefore Rendering Post ProcessingWhen 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 featureWithout it (fallback overlay)
Color and Texture stylesYesYes
Blur styleYesNo
3D Flat displayYesYes
3D On geometry displayYesNo

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.