feat(renderer): Beer's Law cloud lighting (ADR-0037) #102

Merged
akadmin merged 1 commit from feat/cloud-beers-law into main 2026-07-10 03:09:09 +00:00
Owner

Implements #25: Beer's Law transmittance for cloud lighting.

  • Per-sample secondary march toward the sun (sun_transmittance_at, 6 steps to the slab exit, capped for near-horizontal suns), optical depth accumulated with the same density_at extinction as the view ray, direct sun attenuated by exp(-od).
  • Small height-tinted ambient floor so shadowed cloud bases don't go pitch black; the existing sun-elevation dim is kept as the sun energy scale (no midnight glow).
  • Shader-only change: CloudPush stays 48 bytes, no Rust plumbing. Sun color, phase function, and powder term are deferred per ADR-0037.
  • ADR-0037 added (Accepted), ADR index updated, CLAUDE.md cloud paragraph extended. Also flipped ADR-0036's stale Proposed status to Accepted (README already listed it as Accepted).

Verification: cargo build compile-checks the GLSL (vulkano-shaders); cargo test / fmt --check / clippy -D warnings all green. Visual check per ADR acceptance criteria: enable Clouds on a Sky entity, scrub coverage/cloud-type (thicker clouds darker underneath) and a TimeOfDay hour slider (low sun darkens undersides, no glow at midnight).

🤖 Generated with Claude Code

Implements #25: Beer's Law transmittance for cloud lighting. - Per-sample secondary march toward the sun (`sun_transmittance_at`, 6 steps to the slab exit, capped for near-horizontal suns), optical depth accumulated with the same `density_at` extinction as the view ray, direct sun attenuated by `exp(-od)`. - Small height-tinted ambient floor so shadowed cloud bases don't go pitch black; the existing sun-elevation dim is kept as the sun energy scale (no midnight glow). - Shader-only change: `CloudPush` stays 48 bytes, no Rust plumbing. Sun color, phase function, and powder term are deferred per ADR-0037. - ADR-0037 added (Accepted), ADR index updated, CLAUDE.md cloud paragraph extended. Also flipped ADR-0036's stale `Proposed` status to `Accepted` (README already listed it as Accepted). Verification: `cargo build` compile-checks the GLSL (vulkano-shaders); `cargo test` / `fmt --check` / `clippy -D warnings` all green. Visual check per ADR acceptance criteria: enable Clouds on a Sky entity, scrub coverage/cloud-type (thicker clouds darker underneath) and a TimeOfDay hour slider (low sun darkens undersides, no glow at midnight). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(renderer): Beer's Law cloud lighting (ADR-0037)
All checks were successful
CI / build (pull_request) Successful in 3m23s
799485c6d8
Replace the placeholder cloud lighting (height gradient x sun elevation)
with a per-sample secondary march toward the sun: 6 steps from each
view-ray sample to the slab exit, optical depth accumulated with the
same density_at extinction, direct sun attenuated by exp(-od) plus a
small height-tinted ambient. Shader-only; CloudPush stays 48 bytes.

Closes #25.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
akadmin deleted branch feat/cloud-beers-law 2026-07-10 03:09:09 +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!102
No description provided.