bevy_exponential_height_fog
Standalone Bevy extension crate that renders Unreal-style exponential height fog as a dedicated post-process pipeline.
Bevy Version
This crate requires Bevy 0.18.1 or higher.
Quick start
Add the crate and plugin:
[]
= { = "crates/bevy_exponential_height_fog" }
use *;
use ExponentialHeightFogPlugin;
new
.add_plugins
.run;
Add ExponentialHeightFog to a Camera3d:
use *;
use ;
commands.spawn;
No fog-volume entities and no shader patching are required.
Distance modes
The distance terms (start_distance, cutoff_distance, distance_fade) can be evaluated from:
ExponentialHeightFogDistanceMode::Camera: world point to camera position.ExponentialHeightFogDistanceMode::SuppliedWorldCoordinates: world point todistance_reference_world_position.
For camera-target based gameplay fog, set distance_mode to SuppliedWorldCoordinates and update distance_reference_world_position every frame:
Features
- Separate render pipeline and render graph node (no Bevy shader overrides).
- Per-camera fog settings via
ExponentialHeightFogcomponent. - Primary and secondary exponential height layers.
- Start/cutoff distance shaping.
- Max opacity and small-cost early-out optimization parameters.
- Automatic camera requirements:
DepthPrepassis required by the fog component.- depth texture usage is configured by the plugin.
Public API
ExponentialHeightFogPluginExponentialHeightFogExponentialHeightFogDistanceModeExponentialHeightFogLayer
License
MIT License