[PR #7075] [MERGED] Shader packs: textures that name one of the game's textures #7316

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

📋 Pull Request Information

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

Base: main ← Head: shaderpacks/resource-textures


📝 Commits (1)

  • 0f3dae1 Shader packs: textures that name one of the game's textures

📊 Changes

3 files changed (+120 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/shader_packs.rs (+9 -0)
📝 crates/horizon-shaders/src/lib.rs (+1 -1)
📝 crates/horizon-shaders/src/textures.rs (+110 -0)

📄 Description

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

What and why

Part of #6812.

A custom texture may name one of the game's textures by its resource location: customTexture.clouds = minecraft:textures/environment/clouds.png (ShaderDoc, "Enhanced Custom Textures": "from the shader pack directory, the resource pack, or dynamic textures such as a texture atlas or lightmap"; OptiFine's texture.<stage>.<name> takes the same paths). Horizon resolved only the lightmap and the block atlas, so every other location read blank and was noted "minecraft:... is not provided yet".

  • horizon-shaders: resolve_resources decodes the textures that name a game texture with a reader the game gives (namespace and path), with their .mcmeta (blur, clamp); the generated lightmap and atlases stay for the renderer. A location that can't be read is dropped with a note; one with characters a resource location can't have (ResourceLocation: [a-z0-9_.-], / in the path) or a .. segment is refused, so nothing outside the game's resources is read.
  • game/shader_packs.rs: after load_post, reads them from the active resource root (options.resources: resource packs over the game's own).

Black-box check with a probe pack written for this (Iris 1.11.7 + Sodium 0.9.2 on 26.3, and Horizon; one scene): customTexture.cloudsTex = minecraft:textures/environment/clouds.png, customTexture.blockTex = minecraft:textures/block/oak_planks.png (stretched with texture(), and texel by texel with texelFetch), texture.composite.gaux2 = minecraft:textures/block/oak_planks.png, plus textureSize checks. With vignette=false in both, this branch's picture equals Iris's to the byte (mean difference 0.0); main paints all three blank. Iris samples them with nearest filtering, as here without an .mcmeta.

Measured against main at 6d91fa694:

  • Translation (real_packs): unchanged (it doesn't go through the game's resources).
  • Packs whose game log notes a minecraft:textures/... location as "not provided yet" on main, with those notes over a 3-scene run (main → this branch): Shrimple 12 → 9, Bloop 45 → 39, Mellow 6 → 0, VanillaPlus 6 → 0.
  • Pictures (fast build, 3 scenes, mean difference to Iris 1.11.7, main → this branch): VanillaPlus 26.7 → 26.6, 27.8 → 27.6, 34.2 → 34.2; Mellow 11.1, 10.0, 2.4 unchanged (main vs branch 0.7, 1.4, 0.0); Shrimple and Bloop unchanged (they are black for other reasons; see #6812).

Test: game_textures_come_from_the_game_resources (a game texture and its .mcmeta, the lightmap left to the renderer, a missing one, one reaching outside the resources).

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: ShaderDoc's "Enhanced Custom Textures", 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; the packs were only run as black boxes.

Self-check

pr_ready (tools/pr_ready.py --quick on plony-pc, against origin/main at e6e12d40c, 3 min 9 s)

Check Result
Scope ✅ 3 files, +120 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 611 passed (31 s)
rustfmt ✅ (6 s)
clippy ✅ (1 min 19 s)
tests: horizon-client, horizon-shaders ✅ 798 passed (57 s)
doc tests ✅ 0 passed (5 s)
content root tests ➖ content root untouched
mod API up to date ✅ (11 s)
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/7075 **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/resource-textures` --- ### 📝 Commits (1) - [`0f3dae1`](https://github.com/horizon-rust/horizon/commit/0f3dae18dcbbc9a617c9a7f9f5bd0c073f5d8e06) Shader packs: textures that name one of the game's textures ### 📊 Changes **3 files changed** (+120 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/shader_packs.rs` (+9 -0) 📝 `crates/horizon-shaders/src/lib.rs` (+1 -1) 📝 `crates/horizon-shaders/src/textures.rs` (+110 -0) </details> ### 📄 Description > 🤖 Opened by arslanarm's AI agent (Claude Code, Claude Opus 5.5), not by arslanarm personally. ## What and why Part of #6812. A custom texture may name one of the game's textures by its resource location: `customTexture.clouds = minecraft:textures/environment/clouds.png` (ShaderDoc, "Enhanced Custom Textures": "from the shader pack directory, the resource pack, or dynamic textures such as a texture atlas or lightmap"; OptiFine's `texture.<stage>.<name>` takes the same paths). Horizon resolved only the lightmap and the block atlas, so every other location read blank and was noted "`minecraft:...` is not provided yet". - `horizon-shaders`: `resolve_resources` decodes the textures that name a game texture with a reader the game gives (namespace and path), with their `.mcmeta` (blur, clamp); the generated lightmap and atlases stay for the renderer. A location that can't be read is dropped with a note; one with characters a resource location can't have (`ResourceLocation`: `[a-z0-9_.-]`, `/` in the path) or a `..` segment is refused, so nothing outside the game's resources is read. - `game/shader_packs.rs`: after `load_post`, reads them from the active resource root (`options.resources`: resource packs over the game's own). **Black-box check with a probe pack written for this** (Iris 1.11.7 + Sodium 0.9.2 on 26.3, and Horizon; one scene): `customTexture.cloudsTex = minecraft:textures/environment/clouds.png`, `customTexture.blockTex = minecraft:textures/block/oak_planks.png` (stretched with `texture()`, and texel by texel with `texelFetch`), `texture.composite.gaux2 = minecraft:textures/block/oak_planks.png`, plus `textureSize` checks. With `vignette=false` in both, this branch's picture equals Iris's to the byte (mean difference 0.0); main paints all three blank. Iris samples them with nearest filtering, as here without an `.mcmeta`. **Measured** against main at 6d91fa694: - Translation (`real_packs`): unchanged (it doesn't go through the game's resources). - Packs whose game log notes a `minecraft:textures/...` location as "not provided yet" on main, with those notes over a 3-scene run (main → this branch): Shrimple 12 → 9, Bloop 45 → 39, Mellow 6 → 0, VanillaPlus 6 → 0. - Pictures (fast build, 3 scenes, mean difference to Iris 1.11.7, main → this branch): VanillaPlus 26.7 → 26.6, 27.8 → 27.6, 34.2 → 34.2; Mellow 11.1, 10.0, 2.4 unchanged (main vs branch 0.7, 1.4, 0.0); Shrimple and Bloop unchanged (they are black for other reasons; see #6812). Test: `game_textures_come_from_the_game_resources` (a game texture and its `.mcmeta`, the lightmap left to the renderer, a missing one, one reaching outside the resources). ## 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: ShaderDoc's "Enhanced Custom Textures", 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; the packs were only run as black boxes. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on plony-pc, against origin/main at e6e12d40c, 3 min 9 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +120 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 611 passed (31 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 min 19 s) | | tests: horizon-client, horizon-shaders | ✅ 798 passed (57 s) | | doc tests | ✅ 0 passed (5 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (11 s) | | 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:37:37 +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#7316
No description provided.