[PR #2304] [MERGED] HDR: mark only the sun's and moon's discs, not their whole quads #4188

Closed
opened 2026-11-03 04:15:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2304
Author: @senjinthedragon
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: hdr-sun-mask


📝 Commits (1)

  • 8526305 HDR: mark only the sun's and moon's discs, not their whole quads

📊 Changes

2 files changed (+22 additions, -8 deletions)

View changed files

📝 crates/horizon-client/src/entity.wgsl (+15 -2)
📝 crates/horizon-client/src/gfx.rs (+7 -6)

📄 Description

🤖 Opened by Senjin's AI agent (Claude Code), not by Senjin.

What and why

Follows #2021. The celestial pass wrote alpha 0 over each sun and moon quad, so HDR output lifted a
square of bright daytime sky around the sun, rising with it.

  • fs_sky_celestial draws fs_celestial's light premultiplied, blended (one, one): the same colours
    as (src alpha, one).
  • Its alpha is how much a texel adds; the blend takes that off the frame's alpha (zero,
    one minus src alpha), so only the sun's and moon's discs shine. The dim End sky, drawn by the same
    pass, stays unmarked.
  • fs_celestial keeps its own blend for lightning and additive entities. The End sky tests keep their
    (src alpha, one) copy of the pipeline, which draws the same colours.

Vanilla reference

Horizon-only: the frame's alpha is read only by HDR output, off by default. With HDR off the colours
are unchanged.

Self-check

pr_ready (tools/pr_ready.py --quick, against origin/main at 21a89c2e7, Rust 1.99.1)

Check Result
Scope ✅ 2 files, +22 −8
rustfmt ✅
clippy ✅
tests: horizon-client ✅ 1335 passed
doc tests ✅

Testing

Linux, KWin 6.8.1 (HDR on), NVIDIA RTX 2080, AW3423DW, daytime: the square around the sun is gone and
only the sun is lifted; HORIZON_HDR_DEBUG=1 paints only its disc.

Screenshots

HDR can't be shown in an SDR screenshot.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2304 **Author:** [@senjinthedragon](https://github.com/senjinthedragon) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `hdr-sun-mask` --- ### 📝 Commits (1) - [`8526305`](https://github.com/horizon-rust/horizon/commit/8526305faa2a15aa0b3f737ad5b0c4ea5d0e9bc2) HDR: mark only the sun's and moon's discs, not their whole quads ### 📊 Changes **2 files changed** (+22 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity.wgsl` (+15 -2) 📝 `crates/horizon-client/src/gfx.rs` (+7 -6) </details> ### 📄 Description > 🤖 Opened by Senjin's AI agent (Claude Code), not by Senjin. ## What and why Follows #2021. The celestial pass wrote alpha 0 over each sun and moon quad, so HDR output lifted a square of bright daytime sky around the sun, rising with it. - `fs_sky_celestial` draws `fs_celestial`'s light premultiplied, blended (one, one): the same colours as (src alpha, one). - Its alpha is how much a texel adds; the blend takes that off the frame's alpha (zero, one minus src alpha), so only the sun's and moon's discs shine. The dim End sky, drawn by the same pass, stays unmarked. - `fs_celestial` keeps its own blend for lightning and additive entities. The End sky tests keep their (src alpha, one) copy of the pipeline, which draws the same colours. ## Vanilla reference Horizon-only: the frame's alpha is read only by HDR output, off by default. With HDR off the colours are unchanged. ## Self-check **pr_ready** (`tools/pr_ready.py --quick`, against origin/main at 21a89c2e7, Rust 1.99.1) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +22 −8 | | rustfmt | ✅ | | clippy | ✅ | | tests: horizon-client | ✅ 1335 passed | | doc tests | ✅ | ## Testing Linux, KWin 6.8.1 (HDR on), NVIDIA RTX 2080, AW3423DW, daytime: the square around the sun is gone and only the sun is lifted; `HORIZON_HDR_DEBUG=1` paints only its disc. ## Screenshots HDR can't be shown in an SDR screenshot. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:15:20 +07:00
Sign in to join this conversation.
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
horizon-rust/horizon#4188
No description provided.