[PR #6308] [MERGED] HDR: a light source lifts by its texel's own brightness, not the lit pixel's #6785

Closed
opened 2026-11-03 06:26:35 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6308
Author: @senjinthedragon
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: hdr-lift-2


📝 Commits (1)

  • 3451589 HDR: a light source lifts by its texel's own brightness, not the lit pixel's

📊 Changes

6 files changed (+77 additions, -46 deletions)

View changed files

📝 crates/horizon-client-render/src/entity.wgsl (+26 -12)
📝 crates/horizon-client-render/src/gfx.rs (+4 -0)
📝 crates/horizon-client-render/src/gfx/hdr.rs (+13 -9)
📝 crates/horizon-client-render/src/hdr.wgsl (+13 -17)
📝 crates/horizon-client-render/src/terrain.wgsl (+20 -7)
📝 docs/graphics.md (+1 -1)

📄 Description

🤖 Opened by senjinthedragon's AI agent (Claude Code, Claude Opus 5.5), not by senjinthedragon personally.

What and why

Follows the relative masks (#4922). A light source's lift depended on the lit pixel's brightness: the same lantern shone less in a dark cave than in daylight, and a dim light source in the sun could lift on the sunlight alone. Light sources give light whatever falls on them, so the lift now comes from the texel's own brightness, unlit.

  • The mark writers (terrain, entities, particles, sun and moon) work out the lift from the texel and write it into the frame's alpha, through one hdr_mark in each shader: alpha = 0.175 × (band of the tier) + 0.165 × (1 − lift). The HDR pass only decodes it, so its parameters shrink by the two window fields (Globals::hdr_windows carries them to the mark writers instead).
  • Geometry that sets no tier in the sky pass (the End sky, the End flash) stays at the brightest, as in #4908.
  • The native emissive overlays in terrain.wgsl wrote a fixed alpha of 0.1, which means something else in this encoding. They now use the incandescent tier at full lift (hdr_mark(3u, 1.0)), close to how they shone before. I haven't seen one in game: there's no pack using them here.

Tuned in game on an AW3423DW (KWin, Hyprland): the soul lantern and the like now shine the same in the dark as by day. Windows and macOS untested: testers welcome.

Vanilla reference

Horizon-only (HDR output). With HDR off, the windows are zero and nothing reads the alpha: nothing changes.

Self-check

tools/pr_ready.py --quick on this branch: rustfmt, clippy and 679 tests (horizon-client-render) pass.

🤖 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/6308 **Author:** [@senjinthedragon](https://github.com/senjinthedragon) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `hdr-lift-2` --- ### 📝 Commits (1) - [`3451589`](https://github.com/horizon-rust/horizon/commit/3451589c312489149b76f0f17a9f0294b110a31c) HDR: a light source lifts by its texel's own brightness, not the lit pixel's ### 📊 Changes **6 files changed** (+77 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/entity.wgsl` (+26 -12) 📝 `crates/horizon-client-render/src/gfx.rs` (+4 -0) 📝 `crates/horizon-client-render/src/gfx/hdr.rs` (+13 -9) 📝 `crates/horizon-client-render/src/hdr.wgsl` (+13 -17) 📝 `crates/horizon-client-render/src/terrain.wgsl` (+20 -7) 📝 `docs/graphics.md` (+1 -1) </details> ### 📄 Description > 🤖 Opened by senjinthedragon's AI agent (Claude Code, Claude Opus 5.5), not by senjinthedragon personally. ## What and why Follows the relative masks (#4922). A light source's lift depended on the **lit** pixel's brightness: the same lantern shone less in a dark cave than in daylight, and a dim light source in the sun could lift on the sunlight alone. Light sources give light whatever falls on them, so the lift now comes from the **texel's own brightness**, unlit. - The mark writers (terrain, entities, particles, sun and moon) work out the lift from the texel and write it into the frame's alpha, through one `hdr_mark` in each shader: alpha = 0.175 × (band of the tier) + 0.165 × (1 − lift). The HDR pass only decodes it, so its parameters shrink by the two window fields (`Globals::hdr_windows` carries them to the mark writers instead). - Geometry that sets no tier in the sky pass (the End sky, the End flash) stays at the brightest, as in #4908. - The native emissive overlays in `terrain.wgsl` wrote a fixed alpha of 0.1, which means something else in this encoding. They now use the incandescent tier at full lift (`hdr_mark(3u, 1.0)`), close to how they shone before. I haven't seen one in game: there's no pack using them here. Tuned in game on an AW3423DW (KWin, Hyprland): the soul lantern and the like now shine the same in the dark as by day. Windows and macOS untested: testers welcome. ## Vanilla reference Horizon-only (HDR output). With HDR off, the windows are zero and nothing reads the alpha: nothing changes. ## Self-check `tools/pr_ready.py --quick` on this branch: rustfmt, clippy and 679 tests (horizon-client-render) pass. 🤖 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 06:26:35 +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#6785
No description provided.