[PR #4922] [MERGED] HDR: light sources shine where their own sprite is bright #5943

Closed
opened 2026-11-03 05:16:05 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: hdr-masks


📝 Commits (6)

  • aad1fdf HDR: light sources shine where their own sprite is bright
  • 6c9d809 HDR: tiers and masks from a round in the gallery
  • 95d98ae Merge origin/main into hdr light masks
  • 47690b7 Merge origin/main (picks up #5304's hub.rs build fix)
  • 171b667 Merge origin/main: the water mirror's terrain group gets the emission thresholds too
  • d172962 Merge main into #4922

📊 Changes

7 files changed (+358 additions, -30 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+32 -0)
📝 crates/horizon-client-render/src/gfx/hdr.rs (+17 -0)
➕ crates/horizon-client-render/src/gfx/hdr_stats.rs (+158 -0)
➕ crates/horizon-client-render/src/hdr_stats.wgsl (+73 -0)
📝 crates/horizon-client-render/src/mesher.rs (+49 -23)
📝 crates/horizon-client-render/src/mesher/fluid.rs (+1 -1)
📝 crates/horizon-client-render/src/terrain.wgsl (+28 -6)

📄 Description

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

What and why

Follows #2705 and #4062 (light sources by kind). The tier windows judge a pixel by a fixed brightness, tuned on vanilla's textures, so a resource pack with a lighter torch handle lifted the handle too. Nearly no pack maker has an HDR display, so nothing here may depend on tuning for HDR: the game now measures each texture itself.

  • gfx/hdr_stats.rs + hdr_stats.wgsl: when HDR output turns on, a small GPU pass measures every block sprite's darkest and brightest opaque pixel, and writes thresholds between the two into a texture terrain reads. Nothing is measured with HDR off.
  • Bright parts or the whole block: terrain marks a light source's pixel only when it reaches its sprite's threshold. Most light sources shine in their bright parts (a torch's flame, not its handle). Those marked mesher::WHOLE shine all over.
  • The tier windows still decide how much, so particles, eyes, the sun and the moon are unchanged.
  • The table, judged in tools/hdr_gallery.py's gallery: flames, lava, crying obsidian, the froglights, the jack o'lantern and the larger amethyst shine all over; the brewing stand, enchanting table and smaller buds go bright; candle cakes and the ender chest don't shine. The bright-parts threshold sits 0.32 of the way from a sprite's darkest pixel to its brightest.

Tuned in game on an AW3423DW (KWin, Hyprland). Not tried with a resource pack on another machine, or on Windows or macOS: testers welcome.

Vanilla reference

Horizon-only (HDR output). With HDR off, nothing runs and nothing changes.

Self-check

tools/pr_ready.py --quick: 7 files, +355 −29; 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/4922 **Author:** [@senjinthedragon](https://github.com/senjinthedragon) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `hdr-masks` --- ### 📝 Commits (6) - [`aad1fdf`](https://github.com/horizon-rust/horizon/commit/aad1fdfd80ff0bd97b2a269355ff74635ca8f205) HDR: light sources shine where their own sprite is bright - [`6c9d809`](https://github.com/horizon-rust/horizon/commit/6c9d809951055a8543ee7e6a74173dbfc5ee9569) HDR: tiers and masks from a round in the gallery - [`95d98ae`](https://github.com/horizon-rust/horizon/commit/95d98ae933a567e56328274bfe22e89510728a0e) Merge origin/main into hdr light masks - [`47690b7`](https://github.com/horizon-rust/horizon/commit/47690b73bd9d25eb38b0204cd60f3dd3ad2c1409) Merge origin/main (picks up #5304's hub.rs build fix) - [`171b667`](https://github.com/horizon-rust/horizon/commit/171b667268488b8e78d76fe2a8885f3c9e890bbe) Merge origin/main: the water mirror's terrain group gets the emission thresholds too - [`d172962`](https://github.com/horizon-rust/horizon/commit/d172962d9b8d5f8c4738c8f2d9b9f98bba978e36) Merge main into #4922 ### 📊 Changes **7 files changed** (+358 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+32 -0) 📝 `crates/horizon-client-render/src/gfx/hdr.rs` (+17 -0) ➕ `crates/horizon-client-render/src/gfx/hdr_stats.rs` (+158 -0) ➕ `crates/horizon-client-render/src/hdr_stats.wgsl` (+73 -0) 📝 `crates/horizon-client-render/src/mesher.rs` (+49 -23) 📝 `crates/horizon-client-render/src/mesher/fluid.rs` (+1 -1) 📝 `crates/horizon-client-render/src/terrain.wgsl` (+28 -6) </details> ### 📄 Description > 🤖 Opened by senjinthedragon's AI agent (Claude Code, Claude Opus 5.5), not by senjinthedragon personally. ## What and why Follows #2705 and #4062 (light sources by kind). The tier windows judge a pixel by a fixed brightness, tuned on vanilla's textures, so a resource pack with a lighter torch handle lifted the handle too. Nearly no pack maker has an HDR display, so nothing here may depend on tuning for HDR: the game now measures each texture itself. - **`gfx/hdr_stats.rs` + `hdr_stats.wgsl`:** when HDR output turns on, a small GPU pass measures every block sprite's darkest and brightest opaque pixel, and writes thresholds between the two into a texture terrain reads. Nothing is measured with HDR off. - **Bright parts or the whole block:** terrain marks a light source's pixel only when it reaches its sprite's threshold. Most light sources shine in their bright parts (a torch's flame, not its handle). Those marked `mesher::WHOLE` shine all over. - **The tier windows still decide how much,** so particles, eyes, the sun and the moon are unchanged. - **The table, judged in `tools/hdr_gallery.py`'s gallery:** flames, lava, crying obsidian, the froglights, the jack o'lantern and the larger amethyst shine all over; the brewing stand, enchanting table and smaller buds go bright; candle cakes and the ender chest don't shine. The bright-parts threshold sits 0.32 of the way from a sprite's darkest pixel to its brightest. Tuned in game on an AW3423DW (KWin, Hyprland). Not tried with a resource pack on another machine, or on Windows or macOS: testers welcome. ## Vanilla reference Horizon-only (HDR output). With HDR off, nothing runs and nothing changes. ## Self-check `tools/pr_ready.py --quick`: 7 files, +355 −29; 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 05:16:05 +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#5943
No description provided.