flight-simulator-enhancements-and-mods
The Best Settings for Realistic Fog and Visibility Effects in Weather Engines
Table of Contents
Introduction: Why Realistic Fog Matters
Fog is one of the most powerful atmospheric tools in any weather engine. It shapes mood, defines depth, and directly controls what a player can see—and what they cannot. A well-tuned fog system transforms a flat, static scene into a living environment that reacts to weather, time of day, and storytelling needs. Whether you are building a driving simulator, an open-world RPG, or a flight training tool, mastering fog and visibility settings separates a believable world from a cartoonish one.
Weather engines model fog by simulating how airborne water droplets, dust, or pollution scatter light. The result is a gradual reduction in contrast and color saturation over distance. To achieve realism, you must balance multiple parameters: density, color, falloff curves, lighting interaction, and dynamic transitions. This guide walks through every critical setting, explains how they interact, and provides actionable advice for fine-tuning them in modern weather systems.
Core Fog Parameters and How They Work
Fog Density
Density is the most intuitive control. It defines how quickly fog accumulates as distance from the viewer increases. A low density (e.g., 0.01 to 0.02) produces a light haze that softens distant objects without hiding them. Medium density (0.05 to 0.1) creates noticeable fog banks that obscure terrain beyond a few hundred meters. High density (0.2 and above) yields thick, impenetrable fog suitable for heavy mist or marine layers. The key is to match density to the weather scenario: morning radiation fog requires lower density than a coastal advection fog event.
Most engines allow density to be expressed either as a linear factor or a exponential curve. For realistic behavior, use exponential falloff—natural fog scatters light exponentially with distance, so objects disappear more gradually than a linear ramp would produce.
Fog Color and Albedo
Fog is never pure white. In reality, fog takes its color from ambient light, the sun’s position, and the particles themselves. During sunrise, fog picks up warm orange and pink tones. Under overcast skies, it appears cool gray or blue. At night, artificial lights tint the fog yellow or red. Set your fog color to a hue that complements the time of day and weather type. Avoid high-saturation colors; subtle shifts of ±10% on the hue wheel are usually enough.
Some advanced engines support fog albedo—a separate color that represents how much of the scattered light is bounced back toward the viewer. This is useful for simulating heavy pollution or dust storms where the fog itself becomes a light source. In most cases, keep albedo within 0.3 to 0.7 of the base color.
Start Distance and End Distance
These two settings define where the fog effect begins and where it reaches full opacity. A start distance of zero causes fog to affect even nearby objects, which can make scenes feel claustrophobic. More natural setups use a start distance of 10 to 50 meters for light fog, letting foreground elements remain crisp. The end distance determines the range at which objects become completely invisible. For a draw distance of 2 kilometers, set the end distance slightly beyond that to avoid harsh cutoffs.
Use height-based start/end distances when simulating ground fog. For instance, set start distance to 0 at ground level but increase it with altitude, so fog clears as the viewer rises.
Height Fog and Layering
Real fog is rarely uniform in height. Ground fog sits in valleys, while stratus clouds create a distinct ceiling. Implement height fog by defining a lower and upper altitude boundary. Below the lower boundary, fog is at full density. Between the boundaries, density fades linearly or exponentially. Above the upper boundary, no fog exists. This is critical for flying scenes or mountainous terrain where pilots or hikers climb above the fog layer.
Layering multiple fog volumes (e.g., a shallow ground layer and a higher mist layer) adds complexity. Each layer can have independent density, color, and start/end distances. Combined with dynamic weather, layered fog produces stunning, ever-changing vistas.
Visibility Distance: Controlling What Players See
Maximum Visibility Distance
The maximum visibility distance sets an absolute cap on how far the engine renders objects, irrespective of fog. In clear weather, set this to the horizon limit (usually 10–20 km). In foggy conditions, reduce it to match the fog’s end distance or slightly beyond. A common mistake is leaving the max visibility distance high even during thick fog, causing the engine to waste resources on objects that the fog would hide anyway. Always adjust this parameter together with fog density and end distance.
Transition Curves and Smoothing
Abrupt visibility changes when entering or exiting a fog patch ruin immersion. Use transition curves—often implemented as cubic or sigmoid functions—to ramp visibility up or down over time. For weather transitions (e.g., fog rolling in), a transition duration of 10–30 seconds feels natural. For area-based fog volumes (e.g., a misty forest), use a spatial gradient that blends fog density over a distance of 50–100 meters.
Dynamic Visibility Adjustment
Scripted or parameter-driven visibility changes make weather feel alive. Link visibility distance to rain intensity, time of day, or altitude. For example, as rain increases, gradually reduce max visibility and increase fog density. Use a simple multiplier: when rain rate hits 10 mm/h, reduce visibility to 30% of clear-weather values. Conversely, at night, increase fog density slightly to mimic radiative cooling.
Volumetric Fog vs. Traditional Fog
When to Use Volumetric Fog
Volumetric fog is a physically-based rendering technique that treats fog as a participating medium. It scatters light from multiple sources, creates realistic light shafts (god rays), and casts shadows. Use volumetric fog when you need high cinematic quality: cutscenes, low-light scenes with dynamic light sources, or environments where fog interacts with moving objects. The downside is performance cost—volumetric rendering is expensive on GPU.
When Traditional Fog Suffices
Traditional fog (pixel-based or linear/exponential) is far cheaper and works well for most open-world or mobile applications. It lacks three-dimensional depth but still produces acceptable results for distant haze. Many engines combine both: use traditional fog for large-scale distant obscuration and volumetric fog for close-range atmospheric effects near the camera.
Performance Trade-offs
If you enable volumetric fog, reduce its resolution (e.g., use half-resolution or quarter-resolution for the fog volume) and limit the number of light sources that interact with it. Set a maximum distance beyond which volumetric fog is disabled. For hardcore realism, consider temporal upsampling to keep quality high while maintaining frame rate.
Lighting Integration: How Fog Interacts with Light
Sun and Moon Direction
The sun’s position relative to the viewer massively affects fog appearance. Backlit fog (sun behind the viewer) appears brighter and more uniform. Fog lit from the side reveals texture and depth. Frontlit fog (sun in front) creates a dramatic, hazy look with strong light scattering. Adjust fog density and color slightly based on sun angle—many engines do this automatically, but you can override for artistic effect.
Scattering and Absorption
Physically accurate fog scatters short wavelengths (blue) more than long wavelengths (red). This is why distant objects appear bluish. Implement Rayleigh scattering coefficients in your fog shader for natural color gradients. Absorption is less critical for fog, but in heavy rain or smoke, increase absorption to darken the fog near its source.
God Rays and Light Beams
Light beams (also called crepuscular rays) are a hallmark of realistic fog. They occur when sunlight or moonlight passes through gaps in clouds or trees. Enable volumetric fog with a dedicated god-ray pass. Tune the intensity: strong rays for dramatic moments, subtle rays for everyday mist. Ensure that rays fade naturally as fog density increases.
Weather System Dynamics: Types of Fog and Transitions
Radiation Fog
Radiation fog forms on clear, calm nights when the ground cools rapidly. It is shallow (usually <50 meters) and burns off after sunrise. Model radiation fog with a low density, a start distance of 0 at ground level, and a height fog layer that clears above 50 meters. Transition in gradually over 30–60 minutes before dawn, then dissipate quickly in the first hour after sunrise.
Advection Fog
Advection fog forms when warm, moist air moves over a cold surface (sea or land). It is deep, persistent, and often accompanied by drizzle. Set high density with a tall fog layer (up to 300 meters). Keep color cool (blue-gray). Advection fog can last for days—avoid rapid transitions. Use a gentle fade-in over hours.
Upward and Frontal Fog
Upward fog occurs when moist air is forced up a mountain slope (orographic lift). It is localized to ridges and peaks. Frontal fog appears along weather fronts. For these, use zone-based volumes: define trigger areas where fog parameters change. Combine with wind direction to simulate fog spilling over terrain.
Practical Tips for Realism and Optimization
- Use logarithmic depth buffers when dealing with extreme draw distances (5+ km) to avoid z-fighting in distant fog.
- Test on target hardware: volumetric fog at high density can choke mid-range GPUs. Profile with representative scenes.
- LOD for fog: reduce fog resolution for objects beyond a certain distance, or use billboard sprites for distant fog layers.
- Avoid uniform fog across entire levels; use noise textures or procedural density maps to create patchy, natural-looking fog banks.
- Combine with particle effects: drifting mist particles add micro-scale movement that static fog misses.
- Use wind to animate fog: shift density noise textures over time to simulate advection.
- Integrate with precipitation: rain and snow should reduce visibility further; a common multiplier is 0.5–0.7 × base fog density.
Reference Settings for Common Engines
While each engine (Unreal, Unity, CryEngine, Godot) exposes fog parameters differently, the underlying principles are identical. In Unreal Engine, use the Exponential Height Fog component with Fog Density set to 0.02–0.1 for light haze, and enable Volumetric Fog via the Volumetric Fog plugin. In Unity, the Global Fog effect lets you set a height-based fog falloff; enable Directional Fog for scattering. For more details, consult the official documentation:
- Unreal Engine Fog Effects Documentation
- Unity Global Fog and Fog Effects
- NVIDIA God Rays and Scattering Resources
Conclusion: Bringing It All Together
Realistic fog and visibility are not single settings—they are a system of interdependent parameters that must be tuned as a whole. Start with a base fog density and end distance that match the desired weather scenario, then layer color, height, and dynamic transitions. Integrate lighting to give the fog depth and emotion. Optimize for performance without sacrificing the core illusion. By following the guidelines in this article, you can create weather environments that feel alive, immersive, and grounded in physics. Test, iterate, and always observe real-world fog for inspiration.