[PR #306] [MERGED] F3+4 shows the lightmap texture in the bottom right corner #2475

Closed
opened 2026-11-02 15:56:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/debug-lightmap


📝 Commits (2)

  • 6ae0180 Debug charts: F3+2 frame and tick times, F3+3 ping and bandwidth
  • 1f4154c F3+4 shows the lightmap texture in the bottom right corner

📊 Changes

7 files changed (+711 additions, -9 deletions)

View changed files

➕ crates/horizon-client/src/debug_chart.rs (+579 -0)
📝 crates/horizon-client/src/game.rs (+26 -1)
📝 crates/horizon-client/src/game/debug_keys.rs (+89 -7)
📝 crates/horizon-client/src/game/remote.rs (+6 -0)
📝 crates/horizon-client/src/gfx.rs (+6 -1)
📝 crates/horizon-client/src/lib.rs (+1 -0)
📝 crates/horizon-protocol/src/packets/play.rs (+4 -0)

📄 Description

What

F3+4 shows the lightmap texture, as vanilla 26.3's DebugScreenOverlay.showLightmapTexture: the 16x16 lightmap drawn 64x64 two pixels from the bottom right corner on a 1 px black border, sky light up and block light to the right (vanilla blits it with v flipped; texel x = block level, y = sky level, as lightmap.fsh). toggleLightmapTexture shows the overlay if hidden and switches the F3+2 / F3+3 charts off (and they switch it off), and the overlay line reads [F3+4] Lightmap visible.

The renderer keeps the last lightmap it computed (Horizon builds it on the CPU each frame) and the overlay draws it as 4x4 GUI-pixel cells, the same as a nearest-filtered blit at integer scale.

Stacked on #305 (merge that first). Part of #258 (F3+4), part of #159 (lightmap).

Screenshot (Mac mini, offscreen 1280x720, GUI scale 3)

~/code/horizon-parity/shots/f3-debug-charts/lightmap.png: at noon, white at top left (sky 15, block 0), warm block light to the right, black at bottom left; box at x 360..426, y 173..239 GUI px.

How tested

cargo fmt --all --check                                   ok
cargo clippy -p horizon-client -p horizon-protocol --all-targets -- -D warnings   ok
cargo test -p horizon-protocol                            45 passed (ping_request / pong_response round trips)
cargo test -p horizon-client --lib -- debug_chart debug_keys   17 passed
python3 tools/parity.py hud toggle_keys screen_layout     3 passed (run on the stack top: charts + lightmap)

parity.py --changed origin/main selects 79 harnesses (game.rs is an input of most); on the busy Mac mini I ran the three covering the HUD, debug keys and screen layout.

🤖 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/306 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/debug-lightmap` --- ### 📝 Commits (2) - [`6ae0180`](https://github.com/horizon-rust/horizon/commit/6ae018055da280b7d7b7b3cb5643fecbca2c7ddb) Debug charts: F3+2 frame and tick times, F3+3 ping and bandwidth - [`1f4154c`](https://github.com/horizon-rust/horizon/commit/1f4154c0df56d47740d51db17ff3b0afcc31df90) F3+4 shows the lightmap texture in the bottom right corner ### 📊 Changes **7 files changed** (+711 additions, -9 deletions) <details> <summary>View changed files</summary> ➕ `crates/horizon-client/src/debug_chart.rs` (+579 -0) 📝 `crates/horizon-client/src/game.rs` (+26 -1) 📝 `crates/horizon-client/src/game/debug_keys.rs` (+89 -7) 📝 `crates/horizon-client/src/game/remote.rs` (+6 -0) 📝 `crates/horizon-client/src/gfx.rs` (+6 -1) 📝 `crates/horizon-client/src/lib.rs` (+1 -0) 📝 `crates/horizon-protocol/src/packets/play.rs` (+4 -0) </details> ### 📄 Description ## What F3+4 shows the lightmap texture, as vanilla 26.3's `DebugScreenOverlay.showLightmapTexture`: the 16x16 lightmap drawn 64x64 two pixels from the bottom right corner on a 1 px black border, sky light up and block light to the right (vanilla blits it with v flipped; texel x = block level, y = sky level, as `lightmap.fsh`). `toggleLightmapTexture` shows the overlay if hidden and switches the F3+2 / F3+3 charts off (and they switch it off), and the overlay line reads `[F3+4] Lightmap visible`. The renderer keeps the last lightmap it computed (Horizon builds it on the CPU each frame) and the overlay draws it as 4x4 GUI-pixel cells, the same as a nearest-filtered blit at integer scale. Stacked on #305 (merge that first). Part of #258 (F3+4), part of #159 (lightmap). ## Screenshot (Mac mini, offscreen 1280x720, GUI scale 3) `~/code/horizon-parity/shots/f3-debug-charts/lightmap.png`: at noon, white at top left (sky 15, block 0), warm block light to the right, black at bottom left; box at x 360..426, y 173..239 GUI px. ## How tested ``` cargo fmt --all --check ok cargo clippy -p horizon-client -p horizon-protocol --all-targets -- -D warnings ok cargo test -p horizon-protocol 45 passed (ping_request / pong_response round trips) cargo test -p horizon-client --lib -- debug_chart debug_keys 17 passed python3 tools/parity.py hud toggle_keys screen_layout 3 passed (run on the stack top: charts + lightmap) ``` `parity.py --changed origin/main` selects 79 harnesses (game.rs is an input of most); on the busy Mac mini I ran the three covering the HUD, debug keys and screen layout. 🤖 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-02 15:56:28 +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#2475
No description provided.