How to add performant fog effects in Unity
Usually when you want to add fog to your game, you could think of using its built-in fog effect option. The problem of going this way is that the built-in fog solution is too simplistic. Another problem you can come into when trying to add more sophisticated effects is performance.
Dynamic Fog & Mist is a lightweight fog solution that adds moving and colored fog for games that require an optimal balance between performance and effect. It provides two ways to apply the effect to the scene.
The first one is a performant camera effect. Select the main camera and add the script in the inspector panel, but if you are creating a game for low resources devices, you may want to use a second option, which is by using materials with the fog already integrated to them. This implementation is even faster, because there is no full screen image effect involved, but instead the fog is calculated at the same time than the objects are rendered in the scene, resulting in higher rendering speed, perfect for low-end mobile games. You can find these premade materials with the fog integrated to them in the resources folder of the Asset.
From a visual point of view, one of the key differences between the built-in fog effect and Dynamic Fog & Mist is its ability adjust the animation way and speed of the applied fog.
Another important benefit is its flexibility and ease of use as Dynamic Fog & Mist allows you to choose a preset to start from, which you can select depending on the performance you want to obtain and the device you are creating the game for. Each preset has its values adjusted according to a level of optimization in particular, and of course you can leave the adjustments of the preset the way they are when selecting it, or keep changing them to adjust a particular value.
And if you want to go even further into fog options and realism, we invite your to check Volumetric Fog & Mist which also includes Dynamic Fog & Mist for free in the package. Volumetric Fog & Mist has been designed to provide a better looking and more flexible fog, including fog areas and cloud formations with support of lighting and glow effects.
Check out the video below for a more detailed look of Dynamic Fog & Mist interface and features: