What the Fog Shader mode can do
In this recipe, we are going to create custom fog in the FogVolume node using visual shaders. We will make a greenish fog, which could be used for a poisonous area in a game.
Getting ready
For this recipe, click the + sign to the right of the UVFunc scene we just completed to add a new scene. In the Scene tab, click 3D Scene. Click on Scene in the top-left corner next to Project, then select Save Scene As, and name it FogShader
.
How to do it…
First, we will add a FogVolume node to the Scene tab and then add a visual shader to Material:
- Left-click on the three vertical dots in the toolbar above the viewport and left-click on Add Environment to Scene.
- Left-click on the WorldEnvironment node in the Scene tab.
- In the Inspector, left-click on Environment to the right of Environment to open its properties.
- Left-click on Volumetric Fog in the Inspector to open its properties.
- Check the On checkbox to the right of Enabled...