advanced

#24 Fog & Atmosphere

Exponential fog and volumetric atmosphere

Fog blends distant objects toward a horizon color based on ray travel distance. Exponential fog uses exp(-distance * density) for a natural falloff. Apply it with mix(fogColor, objectColor, fogFactor). Adding height-based fog via exp(-height * falloff) creates a ground-hugging mist effect for atmospheric depth.

Key Concepts

Try this shader live in the Shader Sandbox editor with real-time preview.
Open in Sandbox

Source Code


    
← Previous Soft Shadows Next → Mandelbrot Fractal

All Tutorials