[PR #6874] [MERGED] Shader packs: define MC_NORMAL_MAP and MC_SPECULAR_MAP #7165

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

📋 Pull Request Information

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

Base: main ← Head: shaderpacks/normal-specular-map-macros


📝 Commits (1)

  • 4b4db8c Shader packs: define MC_NORMAL_MAP and MC_SPECULAR_MAP

📊 Changes

1 file changed (+30 additions, -0 deletions)

View changed files

📝 crates/horizon-shaders/src/macros.rs (+30 -0)

📄 Description

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

What and why

Fixes #6811 (Bliss also needs the #6809 fix, #6821 or item 2 of #6784; see below).

MC_NORMAL_MAP and MC_SPECULAR_MAP are defined when the normal and specular maps are on (OptiFine's shaders.txt, "H. Options"; on by default), and Iris 1.11.7 on 26.3 defines both with no resource pack loaded. Horizon defined neither, so packs took their no-normal-map branches. With Bliss v2.1.2 that left gbuffers_terrain, gbuffers_block and gbuffers_entities failing in all three dimensions with "Unknown variable: FlatNormals"; with MC_NORMAL_MAP defined the error is gone. Macros::standard() now defines both.

How the cause was found without reading the pack (it is "All rights reserved"): Bliss was translated with one candidate macro added at a time (the documented standard and Iris macros Horizon lacked); only MC_NORMAL_MAP made the error go. Which macros Iris defines was observed with a probe pack written for this, whose final pass paints one green or red stripe per #ifdef, run in Iris 1.11.7 (MC 26.3, no resource pack): MC_NORMAL_MAP and MC_SPECULAR_MAP are defined.

With the macros, Bliss's programs then stop on the error #6809 describes (Horizon's error names EndPortalEffect); with #6821, or with #6784's return change, all of Bliss's programs translate (both measured).

Measured with real_packs over Modrinth's 40 most-downloaded shader packs (SHOW_ERRORS=1), against main at 5197790e5: alone, the same programs translate and are skipped as on main (Bliss's 18 now fail on #6809's error instead); with #6821, Bliss goes from 18 skipped programs to 0. Pictures (Horizon's fast build, three scenes, compared with Iris 1.11.7's): Complementary Reimagined, BSL, Photon and Solas change by about run-to-run noise (mean difference 0.1–2.1 between main and this branch, and the same distance to Iris within 0.2); Bliss with #6821 runs its own terrain and entity lighting, and its distance to Iris drops from 37.9 to 33.5 (ground, noon) and from 44.1 to 35.1 (mobs), 14.7 → 15.6 in a lit cave.

normals and specular still read the white stand-in here; #6784 adds flat stand-ins for them, so this pull request leaves them alone.

Test: programs_take_the_normal_and_specular_map_branches (it fails on main).

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Horizon-only (shader packs; vanilla has no such feature). Sources: OptiFine's shaders.txt (documentation), the shaders.properties macro reference, and black-box runs of Iris 1.11.7 with a probe pack of our own.

Other projects' code

none. No Iris, OptiFine or pack code read; Bliss was only run as a black box.

Self-check

pr_ready (tools/pr_ready.py --quick on plony-pc, against origin/main at 5197790e5, 2 min 19 s)

Check Result
Scope ✅ 1 files, +30 −0
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 607 passed (31 s)
rustfmt ✅ (8 s)
clippy ✅ (1 min 37 s)
tests: horizon-shaders ✅ 124 passed (2 s)
doc tests ✅ 0 passed
content root tests ➖ content root untouched
mod API up to date ➖ native hooks untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/6874 **Author:** [@arslanarm](https://github.com/arslanarm) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `shaderpacks/normal-specular-map-macros` --- ### 📝 Commits (1) - [`4b4db8c`](https://github.com/horizon-rust/horizon/commit/4b4db8c36d974c1e5476343873514d5972f804ad) Shader packs: define MC_NORMAL_MAP and MC_SPECULAR_MAP ### 📊 Changes **1 file changed** (+30 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-shaders/src/macros.rs` (+30 -0) </details> ### 📄 Description > 🤖 Opened by arslanarm's AI agent (Claude Code, Claude Opus 5.5), not by arslanarm personally. ## What and why Fixes #6811 (Bliss also needs the #6809 fix, #6821 or item 2 of #6784; see below). `MC_NORMAL_MAP` and `MC_SPECULAR_MAP` are defined when the normal and specular maps are on (OptiFine's `shaders.txt`, "H. Options"; on by default), and Iris 1.11.7 on 26.3 defines both with no resource pack loaded. Horizon defined neither, so packs took their no-normal-map branches. With Bliss v2.1.2 that left `gbuffers_terrain`, `gbuffers_block` and `gbuffers_entities` failing in all three dimensions with "Unknown variable: FlatNormals"; with `MC_NORMAL_MAP` defined the error is gone. `Macros::standard()` now defines both. How the cause was found without reading the pack (it is "All rights reserved"): Bliss was translated with one candidate macro added at a time (the documented standard and Iris macros Horizon lacked); only `MC_NORMAL_MAP` made the error go. Which macros Iris defines was observed with a probe pack written for this, whose `final` pass paints one green or red stripe per `#ifdef`, run in Iris 1.11.7 (MC 26.3, no resource pack): `MC_NORMAL_MAP` and `MC_SPECULAR_MAP` are defined. With the macros, Bliss's programs then stop on the error #6809 describes (Horizon's error names `EndPortalEffect`); with #6821, or with #6784's return change, all of Bliss's programs translate (both measured). Measured with `real_packs` over Modrinth's 40 most-downloaded shader packs (`SHOW_ERRORS=1`), against main at 5197790e5: alone, the same programs translate and are skipped as on main (Bliss's 18 now fail on #6809's error instead); with #6821, Bliss goes from 18 skipped programs to 0. Pictures (Horizon's fast build, three scenes, compared with Iris 1.11.7's): Complementary Reimagined, BSL, Photon and Solas change by about run-to-run noise (mean difference 0.1–2.1 between main and this branch, and the same distance to Iris within 0.2); Bliss with #6821 runs its own terrain and entity lighting, and its distance to Iris drops from 37.9 to 33.5 (ground, noon) and from 44.1 to 35.1 (mobs), 14.7 → 15.6 in a lit cave. `normals` and `specular` still read the white stand-in here; #6784 adds flat stand-ins for them, so this pull request leaves them alone. Test: `programs_take_the_normal_and_specular_map_branches` (it fails on main). ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Horizon-only (shader packs; vanilla has no such feature). Sources: OptiFine's `shaders.txt` (documentation), the shaders.properties macro reference, and black-box runs of Iris 1.11.7 with a probe pack of our own. ## Other projects' code none. No Iris, OptiFine or pack code read; Bliss was only run as a black box. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on plony-pc, against origin/main at 5197790e5, 2 min 19 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +30 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 607 passed (31 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (1 min 37 s) | | tests: horizon-shaders | ✅ 124 passed (2 s) | | doc tests | ✅ 0 passed | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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:35:08 +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#7165
No description provided.