Creating Fog and Fixing Cool Fog in Unity’s HDRP

Alberto Garcia
3 min readMay 31, 2023

To quickly create a Fog in my HDRP unity scene, I will use a Fog prefab that has particle system using a smoke texture and material.

Make sure that the Shader type is as Sprite/ Default and for the purposes of this scene, I will taint the Fog into a subtle green/blue tone of gray.

Dragging and dropping the prefab into the Hierarchy, selecting it should start simulating the Particle System.

I tweaked the general properties as such, mainly playing with Start Speed and Start Size, Start Color:

Pretty decent Fog, but let’s take a look at some cool effects and common issues that may occur when mixing light with Fog.

I’ve added a Point Light, make sure it has Volumetrics Enabled and placed the source somewhere at the highest part of the Fog, but still inside it’s range. Inside the Global Volume, add the Fog override and only enable the following parameters. Afterwards, you may see a spherical aura of light:

Fog parameters inside Global Volume
Point Light with volumetric aura seen inside the fog

Fog can sometimes be a pain if the current settings are not well adjusted and the light emitted on top of the fog makes it look odd or funny. It may look pixelated and squared ghosts that may look more like a thruster tray instead of a light trail in fog. To quickly fix this, there are various settings that can be enabled. First go to Project > Settings > HDRenderPipelineAssets and inside Lighting, enable High Quality.

HQ Lighting

When toggled on and off, we may see how quickly the pixelated light on Fog changes to a better resolution.

HQ Lighting being toggled on and off perspective on spot light on Fog

Another great thing to do inside the HDRP Default Settings, inside Fog, is to click on the gear-plus icon on the right-top corner to bring out More Options. Turn on the Filter and Slice Distribution Uniformity to adjust the light inside the fog with better quality.

Afterwards, open Project Settings, HDRP Default Settings, Lighting and toggle off Reprojection under Fog/ volumetrics. This will prevent your real-time lights from creating a light trail calculated from previous frames as the light source moves around the map. This can be useful to create better movement of flashlights or turning the angle of spotlights in foggy areas.

These settings are essential to keep in mind when creating Fog in HDRP, making Fog quickly look quite realistic and less simulated in virtual environments.

--

--