[PR #6671] [MERGED] HDR: light itself above paper white #7026

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

📋 Pull Request Information

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

Base: main ← Head: hdr-lighting-2


📝 Commits (2)

  • f5be69d HDR: fog hides light sources, animated sprites keep shining, the vignette keeps the lift
  • 2de5ff4 HDR: light itself above paper white

📊 Changes

6 files changed (+139 additions, -12 deletions)

View changed files

📝 crates/horizon-client-render/src/entity.wgsl (+31 -5)
📝 crates/horizon-client-render/src/gfx.rs (+18 -0)
📝 crates/horizon-client-render/src/gfx/hdr.rs (+30 -0)
📝 crates/horizon-client-render/src/hdr.wgsl (+20 -3)
📝 crates/horizon-client-render/src/terrain.wgsl (+38 -4)
📝 docs/graphics.md (+2 -0)

📄 Description

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

What and why

Part of #3472, builds on the fog fixes in #6669, so until that merges this diff includes them too. So far HDR only lifted light sources: a bright sun over an SDR landscape. Now light itself goes above paper white.

  • Surfaces: at block or sky light levels 11 to 15 they rise above paper white, up to 4 times for the strongest light. Below that nothing changes, so dark stays as dark as in SDR. Sky light goes by the time of day and by how squarely a face meets the sun, so it reads as sunlight, not a brighter picture.
  • Entities, particles and the hand follow the same light, so they don't look dark in a bright room. The sky gets it too.
  • Roll-off: values ease into the display's peak from 60% of it, so sand and snow keep their texture.
  • Fog and water: the lighting fades with fog, and the sky and fog get none with the eye under water.
  • Light sources keep their own marks. Their own faces take no surface lighting.

How it differs from the plan in #3472

The plan moved the world to Rgba16Float first. That means changing the target of every world pipeline, with many needing two versions. This uses the frame's alpha instead: the range from 0.76 to 1 was free, so it carries how much light a surface gets to the last pass, which multiplies in linear light. Vanilla's light is albedo * lightmap, so that amounts to the lightmap going past 1, in the 8-bit frame, with no new targets or pipelines beyond this.

I also dropped the separate HDR Lighting switch from that plan. HDR is already off by default, and a second switch asks players a question most can't answer. HORIZON_HDR_LIGHTING=0 turns it off to compare. levzzz's question, whether this belongs in vanilla or to shaders: HDR off stays exactly vanilla, and lighting turns itself off while a shader pack's post or material stage runs, so packs stay in control. An API for packs to take HDR over is still to design.

The issue got no replies, so these are my calls. Say if you'd decide differently.

Tested

In game on an AW3423DW, on Linux (Hyprland, Paper White 430 and 300, by flipping between SDR and HDR): overworld biomes in daylight and at night, caves, under water, the Nether and the End. The world gains contrast and range, and sun and shade separate. In caves it stays dark without losing much detail.

pr_ready --quick passes. The strength of 4 was chosen by eye on one display, so it's the number to question.

Not done, and not tested

  • Water gets little of this, because blending dilutes the stored value. Lakes still look fine beside lit ground, so I've left it.
  • No auto-exposure yet: 4 looked right across the biomes tried, so it may not be needed.
  • The shader pack cut-off is by reading the code, not in game.
  • Plasma, Windows and macOS: testers welcome, especially on displays with little headroom, or that dim on a full bright screen. My OLED didn't visibly dim on a snowfield, but that's one panel.

🤖 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/6671 **Author:** [@senjinthedragon](https://github.com/senjinthedragon) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `hdr-lighting-2` --- ### 📝 Commits (2) - [`f5be69d`](https://github.com/horizon-rust/horizon/commit/f5be69df70335c03530824efada2bc91cf159f63) HDR: fog hides light sources, animated sprites keep shining, the vignette keeps the lift - [`2de5ff4`](https://github.com/horizon-rust/horizon/commit/2de5ff4ef15ad6b545abceb29116ad48aa0ffe99) HDR: light itself above paper white ### 📊 Changes **6 files changed** (+139 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/entity.wgsl` (+31 -5) 📝 `crates/horizon-client-render/src/gfx.rs` (+18 -0) 📝 `crates/horizon-client-render/src/gfx/hdr.rs` (+30 -0) 📝 `crates/horizon-client-render/src/hdr.wgsl` (+20 -3) 📝 `crates/horizon-client-render/src/terrain.wgsl` (+38 -4) 📝 `docs/graphics.md` (+2 -0) </details> ### 📄 Description > 🤖 Opened by senjinthedragon's AI agent (Claude Code, Claude Opus 5.5), not by senjinthedragon personally. ## What and why Part of #3472, builds on the fog fixes in #6669, so until that merges this diff includes them too. So far HDR only lifted light sources: a bright sun over an SDR landscape. Now light itself goes above paper white. - **Surfaces:** at block or sky light levels 11 to 15 they rise above paper white, up to 4 times for the strongest light. Below that nothing changes, so dark stays as dark as in SDR. Sky light goes by the time of day and by how squarely a face meets the sun, so it reads as sunlight, not a brighter picture. - **Entities, particles and the hand** follow the same light, so they don't look dark in a bright room. The sky gets it too. - **Roll-off:** values ease into the display's peak from 60% of it, so sand and snow keep their texture. - **Fog and water:** the lighting fades with fog, and the sky and fog get none with the eye under water. - **Light sources** keep their own marks. Their own faces take no surface lighting. ## How it differs from the plan in #3472 The plan moved the world to `Rgba16Float` first. That means changing the target of every world pipeline, with many needing two versions. This uses the frame's alpha instead: the range from 0.76 to 1 was free, so it carries how much light a surface gets to the last pass, which multiplies in linear light. Vanilla's light is `albedo * lightmap`, so that amounts to the lightmap going past 1, in the 8-bit frame, with no new targets or pipelines beyond this. I also dropped the separate HDR Lighting switch from that plan. HDR is already off by default, and a second switch asks players a question most can't answer. `HORIZON_HDR_LIGHTING=0` turns it off to compare. **levzzz's question, whether this belongs in vanilla or to shaders:** HDR off stays exactly vanilla, and lighting turns itself off while a shader pack's post or material stage runs, so packs stay in control. An API for packs to take HDR over is still to design. The issue got no replies, so these are my calls. Say if you'd decide differently. ## Tested In game on an AW3423DW, on Linux (Hyprland, Paper White 430 and 300, by flipping between SDR and HDR): overworld biomes in daylight and at night, caves, under water, the Nether and the End. The world gains contrast and range, and sun and shade separate. In caves it stays dark without losing much detail. `pr_ready --quick` passes. The strength of 4 was chosen by eye on one display, so it's the number to question. ## Not done, and not tested - Water gets little of this, because blending dilutes the stored value. Lakes still look fine beside lit ground, so I've left it. - No auto-exposure yet: 4 looked right across the biomes tried, so it may not be needed. - The shader pack cut-off is by reading the code, not in game. - Plasma, Windows and macOS: testers welcome, especially on displays with little headroom, or that dim on a full bright screen. My OLED didn't visibly dim on a snowfield, but that's one panel. 🤖 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:32:19 +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#7026
No description provided.