LayeredFog is a Unity 3d package available for free in the asset store.
Installation – preparations
This post process effect depends on the built-in post process effect stack in Unity, that must be installed separately.
- Install the standard Unity post processing stack from the Package Manager.
- Add a Post Process Layer component to the camera. Ensure that the Post Process Layer has a layer set – create a new layer if a suitable one does not already exist. Ensure the camera game object has the same layer selected in the top of the properties list.
- Add a Post Process Volume to the scene. Set the Post Process Volume to Is Global = 1. Create a new empty post process Profile by clicking New.
Installation – setting up LayeredFog
- In the Post Process Volume, click “Add effect…” and add a new effect Voodoocado -> Layered Fog.
- Enable all settings to be able to change them.
- Set Fog Height Min/Max to suitable values for your scene. These values are in the same unit of measurement as your scene – for example 10 could mean 10 meters.
- For low fog, set Fog Density Below Min to 1, and Fog Density Above Max to a small value like 0.01.
- Experiment with Fog Mode and Fog Distance until it suits your scene.
- Check out the Demo scene to see how to control the fog runtime from script.