Understanding Volumetric Fog and Haze

Volumetric fog and haze simulate how light interacts with particles suspended in air, such as water droplets, dust, or smoke. Unlike a flat fog overlay that uniformly reduces visibility, volumetric effects produce a three-dimensional sense of depth: objects farther away appear progressively softer, and light beams themselves become visible as they scatter within the volume. This technique is fundamental in achieving photorealistic atmospheric depth in games, visual effects, and architectural visualization. The key principle is that light rays are absorbed and scattered by the medium, creating gradients of intensity and color that vary with distance and angle.

There are two primary scattering behaviors used in volumetric rendering. Rayleigh scattering dominates for small particles (like air molecules) and is responsible for blue skies and red sunsets. Mie scattering applies to larger particles (water droplets, dust) and produces broader, more diffuse halos around light sources. Real-world haze blends both, and a realistic volumetric fog system must approximate this mix.

In practice, volumetric fog is computed either as a post-process effect (screen-space) or as a true 3D volume rendered with ray-marching. Screen-space methods are faster but limited to how much data is in the depth buffer. Ray-marched volumes—used in engines like Unreal Engine 5 or Blender’s Eevee—yield higher fidelity at a performance cost. For production work, a combination of both is often employed: a lightweight screen-space layer for general haze and a ray-marched volume near important light sources.

Key Components of Volumetric Fog

Lighting Interaction

Without lights, volumetric fog is just a uniform gray overlay. To feel real, fog must be lit by scene lights. Directional lights (sun) create god rays and crepuscular shafts. Point and spot lights produce visible cones and local glow. The most dramatic effects arise when light passes through the fog at an angle, scattering toward the camera. In game engines, you typically enable “volumetric scattering” on each light and adjust the scattering intensity and extinction parameters.

Density and Extinction

Density controls how much light is absorbed per unit distance. A high density fog appears thick and opaque; low density mimics thin haze. Extinction is the rate at which light is removed from the direct beam. In physically-based systems, the extinction coefficient σ is set in world units (e.g., 0.01 per meter). For atmospheric haze, density should also vary with height: denser near the ground and thinner aloft. This creates a horizon fog effect where distant objects dissolve into the background.

Anisotropy

Scattering is not uniform. The phase function (commonly Henyey-Greenstein) describes the directional bias. A positive g value (e.g., 0.6) means light mostly scatters forward—typical of haze. A negative value means back-scattering (fog). Adjusting this parameter changes the visible glow angle around light sources and the overall softness of shadows in the volume.

Color and Absorption

Real fog has a slight color from absorption by particles. For example, thick fog can appear bluish-gray or yellowish depending on particulate. In volumetric shaders, you can tint the fog by setting the absorption color per wavelength. A common trick is to use a light blue tint for distant fog to simulate sky color bleeding, or a warm orange for sunrise scenes.

Step-by-Step Workflow for Photorealistic Effects

The following workflow applies broadly across major 3D applications. The exact steps vary, but the principles remain consistent.

  1. Choose the Right Software Environment
    Select a renderer or engine that supports volumetric scattering natively. Unreal Engine’s Exponential Height Fog provides a fast, adjustable volumetric system. Blender’s Eevee offers real-time volumetrics with limitations, while Cycles supports true ray-traced volumes. Unity’s HDRP also has a robust volumetric fog component. For pure offline rendering, Arnold’s atmosphere shader or V-Ray’s Environment Fog are industry standards.
  2. Set Up Light Sources for Interaction
    Activate volumetric scattering on your primary lights. For a daylight scene, use a directional light with the sun angle set to produce visible shafts. For night interior shots, place several point or spot lights at different heights. Adjust each light’s volumetric scattering intensity separate from its diffuse/specular intensity. In real-time engines, be careful not to overload the scene—too many volumetric lights can tank frame rates. Prioritize one or two key lights.
  3. Create or Configure a Volume Shader
    In Unreal, this is built into the Exponential Height Fog. In Blender, add a Volume Scatter node to the World shader for a scene-wide effect, or attach a Principled Volume shader to an object for local clouds. In offline renderers like V-Ray, add the Environment Fog effect and set its global density. For custom shaders (e.g., in Unity using Shader Graph), you can write a ray-marcher. The volume shader must compute absorption, scattering, and the phase function.
  4. Adjust Density, Height Falloff, and Anisotropy
    Start with a low density (e.g., 0.002–0.01 per meter) to test. Set a height falloff (e.g., 50–200 meters in game units) so fog thins out with altitude. Adjust the phase function g value: 0.0 produces isotropic (uniform) scattering; 0.6–0.8 gives forward-dominant haze. Preview the effect from camera angles where light streams through the volume.
  5. Implement Atmospheric Scattering Models
    For advanced realism, go beyond a simple uniform fog. Use the Rayleigh and Mie scattering equations. The most common approach is to uses a physically-based sky atmosphere model (like Preetham or Hosek-Wilkie) that computes the sky color and then feeds into the fog color. Many engines have this built in. Alternatively, you can manually compute the scattering coefficients based on wavelength. For example, set Rayleigh scattering to vary with 1/λ⁴ and Mie to be nearly wavelength-independent.
  6. Render and Refine
    Do test renders at low resolution to iterate quickly. Check for artifacts: banding in fog gradients, unrealistic hard edges on light shafts, or overly bright fog near the camera. Reduce the step size in ray-marched volumes to improve quality. In real-time, increase the number of volumetric samples (temporal or spatial). Once satisfied, lock settings and do final high-quality renders.

Advanced Techniques for Hyper-Realism

God Rays and Crepuscular Shafts

These are iconic volumetric effects caused by sunlight streaming through gaps in clouds or foliage. To create realistic shafts, ensure your primary directional light is casting shadows from occluders (trees, buildings). Then enable volumetric scattering on that light. Adjust the shadow density to make the shafts pulse with the occlusion. In post-production, add a light wrap or bloom to enhance the glow.

Localized Fog and Mist

Rather than a global volume, place smaller volumetric zones—a misty hollow, a smoky campfire, a foggy riverbank. This adds environmental storytelling. In Unreal, use the Volumetric Cloud actor with custom materials. In Blender, use a Volume Scatter node on a separate object with an emission shader for self-illuminated smoke. Key parameters: density multiplier, temperature (for fire), and color ramp from warm to cool.

Temporal Stability and Denoising

Ray-marched volume noise can flicker. Apply temporal accumulation (frame blending) to stabilize, but watch for ghosting. Most modern engines include a temporal denoiser for volumetrics. Alternatively, use jittered sampling with a post-process temporal filter. For offline renders, increase sample counts and use a denoiser like OptiX or OIDN.

Atmospheric Perspective Integration

Volumetric fog should seamlessly integrate with the scene’s atmosphere. Match the fog’s color to the sky’s horizon color. If the sky is blue, make distant fog slightly blue. If sunset, warm it. Many engines offer an Auto-Color option that derives fog color from the sky light. Enable this if available. For custom work, sample the sky dome color at the horizon and set that as the fog tint.

Performance Optimization

Volumetric effects are expensive. To maintain real-time performance, limit the number of volumetric lights. Use the lowest acceptable resolution for the volume texture (e.g., 64x64x32 in Unreal). Set a max draw distance for volumetric fog beyond which it fades to a simple distance fog. Use in-scattering only near the camera and switch to a screen-space approximation for distant areas. For offline renders, optimize by using irradiance caching on volumetric objects or lowering the step count for objects far from the camera.

Common Pitfalls and How to Avoid Them

  • Overly Bright Fog: If the fog appears to glow unnaturally, your scattering or extinction coefficients are too high. Reduce the scattering intensity and increase absorption slightly.
  • Blocky Artifacts: Caused by too few volume samples. Increase the number of ray-march steps or the resolution of the 3D texture. In screen-space engines, reduce the step size.
  • Fog Cutting Off Suddenly: Ensure your volume bounds or fog distance is set high enough. Use an exponential falloff rather than a hard cutoff.
  • Color Mismatch with Sky: The horizon fog should blend into the sky, not form a sharp line. Adjust height falloff and color matching. In Unreal, set the “Atmosphere/Sky” component to auto-calculate fog color.
  • Performance Spikes: Check light culling. Disable volumetric scattering on small or unimportant lights. Use distance-based LOD for fog complexity.

Applications and Case Studies

Games

Volumetric fog is a staple in AAA games for mood and depth. Horizon Forbidden West uses layered volumetric clouds and ground mist to create its lush, realistic environments. Cyberpunk 2077 employs heavy volumetric haze with neon scattering to sell its rainy, polluted city. For mobile or older hardware, use a cheaper screen-space fog that samples the depth buffer and applies a gradient—less realistic but good enough for distant objects.

Visual Effects and Film

In VFX, volumetric fog often supplements CG integration with live-action plates. Tools like Houdini’s PyroFX allow creating extremely detailed volumetric clouds and smoke. The key to matching live-action is to match the real-world atmospheric conditions: measure the actual haze present on set and replicate its color and density. Use light linking to ensure only key lights affect the fog.

Architectural Visualization

Adding fog to archviz creates a sense of scale and environment. A light morning haze can make a skyscraper appear towering. A warm indoor volume from sunlight through a window softens shadows and adds coziness. Use very low density (0.001–0.003) to avoid obscuring geometry. A realistic approach: set the fog color to match the ambient light’s hue, and use a low height falloff (~100 meters).

Conclusion

Creating photorealistic volumetric fog and haze requires understanding both the physics of light scattering and the technical capabilities of your chosen software. By carefully controlling lighting, density, color, and anisotropy, you can add atmospheric depth that transforms a flat scene into an immersive world. Experiment with different combinations of Rayleigh and Mie scattering, leverage post-processing bloom and color grading, and always optimize for your target platform. With practice, these techniques become intuitive, allowing you to craft any mood—from a sunlit clearing through a misty forest to the smoky haze of a nighttime city.

For further reading on the underlying mathematics, refer to Scratchapixel’s tutorial on ray marching and the Wikipedia article on volumetric fog. For implementation details in popular engines, consult the official documentation: Unreal Engine Volumetric Fog and Unity HDRP Volumetric Fog.