feat(renderer): Horizon two-level cloud density model (ADR-0036) #101

Merged
akadmin merged 1 commit from feat/cloud-density-model into main 2026-07-10 02:50:27 +00:00
Owner

Implements the Horizon Zero Dawn two-level cloud sampling technique (Schneider 2015) on top of the ADR-0034 ray march and the ADR-0035 noise textures. ADR-0036.

What

  • Base shape: Perlin-Worley R remapped by the low-frequency Worley FBM (dot(gba, (0.625, 0.25, 0.125))), normalized to the texture's measured p5/p95 band.
  • Height gradients: stratus / stratocumulus / cumulus bands, blended by a cloud_type parameter (0..1).
  • Coverage: remap + multiply; scrubs naturally from clear through scattered/broken to overcast.
  • Detail erosion: high-frequency Worley sampled only where base density survives (edge-only for free), inverted near the cloud base for wispy bottoms and billowing tops.
  • Curl distortion: the ADR-0035 curl map is now uploaded (first Dim2d noise texture, set 0 binding 2) and bends sample positions, strongest at the base.
  • Scene data + UI: coverage / cloud_type live on the Sky component (serde defaults keep old scenes loading), forwarded via SkyDraw::Atmosphere into CloudPush (still 48 bytes); inspector gets drag-batched sliders with live preview.

Verification

  • CPU-decoded the committed base DDS and replayed the shader march in Python: coverage 0.4/0.6/0.8 give scattered/broken/overcast skies with alpha sd up to 0.41 (vs a uniform 0.10 veil before the scale + normalization fix).
  • 449 tests pass (new: curl decode, push packing, Sky serde-default compat, gather_sky forwarding); clippy/fmt clean.
  • Standalone runtime rendered a cloudy test scene with no panics or validation errors; visually confirmed distinct billowing clouds and natural coverage/type transitions.

Closes #24

🤖 Generated with Claude Code

Implements the Horizon Zero Dawn two-level cloud sampling technique (Schneider 2015) on top of the ADR-0034 ray march and the ADR-0035 noise textures. ADR-0036. ## What - **Base shape**: Perlin-Worley R remapped by the low-frequency Worley FBM (`dot(gba, (0.625, 0.25, 0.125))`), normalized to the texture's measured p5/p95 band. - **Height gradients**: stratus / stratocumulus / cumulus bands, blended by a `cloud_type` parameter (0..1). - **Coverage**: remap + multiply; scrubs naturally from clear through scattered/broken to overcast. - **Detail erosion**: high-frequency Worley sampled only where base density survives (edge-only for free), inverted near the cloud base for wispy bottoms and billowing tops. - **Curl distortion**: the ADR-0035 curl map is now uploaded (first Dim2d noise texture, set 0 binding 2) and bends sample positions, strongest at the base. - **Scene data + UI**: `coverage` / `cloud_type` live on the `Sky` component (serde defaults keep old scenes loading), forwarded via `SkyDraw::Atmosphere` into `CloudPush` (still 48 bytes); inspector gets drag-batched sliders with live preview. ## Verification - CPU-decoded the committed base DDS and replayed the shader march in Python: coverage 0.4/0.6/0.8 give scattered/broken/overcast skies with alpha sd up to 0.41 (vs a uniform 0.10 veil before the scale + normalization fix). - 449 tests pass (new: curl decode, push packing, Sky serde-default compat, gather_sky forwarding); clippy/fmt clean. - Standalone runtime rendered a cloudy test scene with no panics or validation errors; visually confirmed distinct billowing clouds and natural coverage/type transitions. Closes #24 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(renderer): Horizon two-level cloud density model (ADR-0036)
All checks were successful
CI / build (pull_request) Successful in 3m17s
d9376101eb
Replaces the ADR-0034 placeholder FBM with the Schneider 2015 sampler:
Perlin-Worley base shape x blendable stratus/stratocumulus/cumulus height
gradients x coverage remap, eroded at cloud edges by high-frequency Worley
detail (inverted near the base for wispy bottoms), sample position
distorted by the 2D curl map (now uploaded, set 0 binding 2 — the first
Dim2d noise texture).

Coverage and cloud type are scene data on the Sky component
(#[serde(default)], old scenes load unchanged), forwarded through
SkyDraw::Atmosphere into CloudPush (still 48 bytes), with drag-batched
inspector sliders and live preview.

The default noise scale is 1/6000 m and the shader normalizes the base
shape to the texture's measured p5/p95 band — verified by CPU-decoding the
committed DDS and replaying the march: without these the sky renders as a
uniform veil (alpha sd ~0.10 in all directions) and the coverage slider is
nearly binary.

Closes #24

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
akadmin deleted branch feat/cloud-density-model 2026-07-10 02:50:27 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
akadmin/NemesisEngine!101
No description provided.