Video:
https://streamable.com/jzrk6s
AI written summary:
New Rendering Pillar: Sky, Clouds, Fog & Weather
I've merged a full atmosphere/weather stack into my fork. It's five independent
systems that share one physically-based sky, plus a unified wind bus that ties the
whole scene together. Everything below is
opt-in and default-OFF - if you
enable none of it, your project renders exactly as before (
bit-identical, verified
against the stock Sky tutorial). It's
Vulkan-first: where a system's shaders
or compute support aren't present, it falls back to the classic path automatically.
The five systems at a glance
- Physical Sky Atmosphere (Hillaire 2020) - Sky.atmosphericPhysical() / SkyAtmo
- Dynamic Environment Capture (sky-derived ambient + reflections) D.envMapDynamic(true) / EnvCapture - Vulkan only
- Volumetric Clouds V2 (Nubis-lineage GPU raymarch) - Clouds.v2.create()
- Froxel Volumetric Fog (Wronski/Hillaire) - D.volumetricFog(true) / VolFog
- Weather + Unified Wind Bus - Weather.enable() / Wind
...plus a
linear (start/end-distance) global fog mode you can use on its own.
What each system does
Physical Sky Atmosphere
A Hillaire-style atmosphere with Rayleigh, Mie and ozone scattering, multiple
scattering with ground bounce, a physical sun disc, and stars that fade out with sky
luminance. It also drives
aerial perspective - distant geometry picks up the
correct atmospheric tint. Presentation knobs (sky radiance, saturation, sun-disc size,
star fade) grade the result without rebuilding the scattering LUTs, so tweaking the
look is cheap.
Code:
Sky.atmosphericPhysical(true);
Dynamic Environment Capture
Instead of a static cubemap, this captures one cube face per frame from the physical
sky into an HDR cube with prefiltered mips, feeding ambient light, reflections and the
water cube. Reflections and ambient warm-shift at dusk on their own. (Vulkan only;
disabling it restores the static env map.)
Code:
D.envMapDynamic(true);
Volumetric Clouds V2
A real GPU cloud raymarcher - Perlin-Worley + Worley noise, Henyey-Greenstein phase,
powder and multi-scatter - with amortized temporal reconstruction and a deterministic
per-pixel ray phase so the clouds stay stable instead of boiling. A clear sky costs
almost nothing (CPU early-out); a full overcast deck is a few ms at 3/4 trace res.
Coverage, type, density and wind are all driven per-frame with
zero shader
rebuilds.
Code:
Clouds.v2.create();
Clouds.v2.crispness(0.3); // trim thin wisps into crisper shapes
Froxel Volumetric Fog
A camera-frustum froxel fog volume with height fog and sun in-scatter lit
through
the cascade shadow map - so you get real light shafts / god rays, not a flat tint.
Transparent surfaces sample the same volume at their own depth, so there are no fog
halos around alpha geometry. Coexists with the classic analytic fog.
Code:
D.volumetricFog(true);
Weather + Unified Wind Bus
Presets (
CLEAR ... STORM ... SNOW / FOG / CUSTOM) blend over timed transitions
and drive cloud coverage/type/density, fog, and sun/ambient/sky as
multipliers on
your authored values - all restored exactly when you disable it. A single
Wind
bus feeds grass, cloth, water, particles and cloud advection from one source. On top of
that: camera-locked rain/snow, a global wetness pass (up-facing surfaces get more
reflective), lightning flash + delayed thunder, and rain/wind audio.
Code:
Weather.enable();
Weather.preset(WEATHER_STORM);
Tutorials - new "23 - Weather" category
Five new tutorials under
Tutorials/Source/23 - Weather/. They're
not gated
on Vulkan the sky degrades to the classic gradient when its shaders are absent, so
they build and run on every backend.
- Tutorial_23_SkyAtmosphere - the physical sky/atmosphere on its own: sun disc, stars, aerial perspective, and the grading knobs.
- Tutorial_23_SkyAmbient - dynamic environment capture: watch reflections and ambient shift as the sun moves through the day.
- Tutorial_23_VolumetricClouds2 - the cloud raymarcher, with test scenes and a live crispness control.
- Tutorial_23_FroxelFog - volumetric fog and sun shafts / god rays.
- Tutorial_23_Weather - the whole thing together: toggle CLEAR vs STORM and watch clouds, fog, rain, wet ground and lightning respond in one scene.
Build any of them the usual way:
Code:
cmake --build cmake-build-debug --target Tutorial_23_Weather
Notes
- Every system is default-OFF existing projects are untouched until you opt in.
- Vulkan gives the full effect; other backends fall back gracefully.
- Weather is the only system that hooks core per-frame code (a wetness hook + a wind-update hook), and both short-circuit when Weather is disabled.
Full design + frame-composition write-ups are in the repo:
docs/sky-fog-weather-design.md and
docs/clouds-v2-handoff.md.
In this fork:
https://github.com/DrewGilpin/EsenthelEngine