[PR #6639] [MERGED] Fusion packs: cut connecting texture sheets into a sprite per tile #7006

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

📋 Pull Request Information

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

Base: main ← Head: optifine/fusion-tiles


📝 Commits (10+)

  • 4fbeab0 Fusion packs: which tiles of a connecting texture a face draws
  • daa63d0 Fusion layouts: pin more template tiles, and one rule for rows and columns
  • 9cc9df1 Fusion layouts: credit the FusionExamples templates, and say where each layout comes from
  • 1a54e1c Fusion layouts: overlay corners join two sides into one piece
  • 2fb130b Fusion layouts: say which overlay test pins a guess
  • 442ac7a Fusion layouts: clippy's identity_op in a test
  • d7896df Fusion packs: connection predicates
  • e440012 Fusion predicates: test every direction name and state values
  • 574d9b1 Fusion predicates: name the field a bad block list came from
  • 383eea6 Fusion predicates: clippy's identity_op in a test

📊 Changes

10 files changed (+1686 additions, -4 deletions)

View changed files

📝 THIRD_PARTY_NOTICES.md (+24 -0)
📝 crates/horizon-client-render/src/sprites.rs (+182 -0)
📝 crates/horizon-optifine/Cargo.toml (+1 -1)
📝 crates/horizon-optifine/src/ctm/connect.rs (+1 -1)
➕ crates/horizon-optifine/src/fusion.rs (+64 -0)
➕ crates/horizon-optifine/src/fusion/layout.rs (+399 -0)
➕ crates/horizon-optifine/src/fusion/model.rs (+244 -0)
➕ crates/horizon-optifine/src/fusion/predicate.rs (+349 -0)
➕ crates/horizon-optifine/src/fusion/texture.rs (+417 -0)
📝 crates/horizon-optifine/src/lib.rs (+5 -2)

📄 Description

A Fusion connecting texture is one image holding every tile of its layout: 47 for full, 5 for pieced, 18 for overlay. Horizon's block sprites are a texture array where every layer is one square sprite. A face can only switch to a tile if each tile has its own layer, but today the whole sheet loads as one layer, squeezed into a square. Fifth PR of the Fusion stack; depends on #6588, #6590, #6591 and #6592 (their commits are included here).

What I did. Sprites::insert_tiles(root, name, (columns, rows), per_tile) reads the sheet, cuts it into square tiles as wide as a column, and registers each one as its own layer, row by row from the top left. Each tile gets its own opaque and translucent flags. A fully transparent tile gets no layer (None): the wiki says empty tiles "won't be processed". Animated sheets keep their animation: by default each frame is a whole grid, stacked one below the next; with per_tile_animation each cell is a column of that tile's frames. Tiles take the sheet's texture section (mipmap strategy, alpha cutoff bias). The sheet's own layer, which models show where Fusion doesn't draw it (items, other models), switches to the sheet's first tile. Left as the whole sheet squeezed square, it would set the size of every layer in the array: an 80 x 16 pieced sheet turned every 16 px block texture into 128 px. A sheet that isn't a whole grid of square tiles is an error, so the loader can warn and skip it. LabPBR _n/_s maps aren't cut per tile yet. Tile layers are named fusion/<ns>/<path>#<tile>, without a :, so the LabPBR map lookup isn't tried on a path that doesn't exist.

Players see no change from this PR alone. The next PR (the mesher seam) calls it.

Docs used. Fusion is All Rights Reserved, so I read none of its code. I worked from its public wiki's Connecting Texture Type page (layouts, empty tiles, Animation, Per tile animation) and Random Texture Type page.

Checks. cargo fmt. I didn't build horizon-client-render on this shared machine (it isn't a quick build); the workspace clippy and test run is on my fork's CI: https://github.com/some-du6e/horizon/actions/runs/41370039955 (the next PR's branch, which includes this one). The new test cuts a hand-made 6 x 4 sheet whose pixel at (x, y) has red x and green y. It checks the empty middle column gives no layers, the bottom-left tile holds exactly pixels (0..2, 2..4), the half see-through tile is translucent, both animation layouts give the same two frames, and wrong grids are refused. No .local vanilla data here, so no harnesses or live game test.

Note

Filed by Opus 5.5 using 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/6639 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `optifine/fusion-tiles` --- ### 📝 Commits (10+) - [`4fbeab0`](https://github.com/horizon-rust/horizon/commit/4fbeab00aec9beaae1b3e7d6c342f4e7ae749215) Fusion packs: which tiles of a connecting texture a face draws - [`daa63d0`](https://github.com/horizon-rust/horizon/commit/daa63d0fa7c628a53cba2e3bcfdd151b6e472cb2) Fusion layouts: pin more template tiles, and one rule for rows and columns - [`9cc9df1`](https://github.com/horizon-rust/horizon/commit/9cc9df16b4d99d6c3bbb94e77755be0041c93fd6) Fusion layouts: credit the FusionExamples templates, and say where each layout comes from - [`1a54e1c`](https://github.com/horizon-rust/horizon/commit/1a54e1cc56134c554564eafa848fb37f88348016) Fusion layouts: overlay corners join two sides into one piece - [`2fb130b`](https://github.com/horizon-rust/horizon/commit/2fb130b16cb90424737d0e72e0716e8011101af9) Fusion layouts: say which overlay test pins a guess - [`442ac7a`](https://github.com/horizon-rust/horizon/commit/442ac7ab418663c806f9df196a611c93639e6b1e) Fusion layouts: clippy's identity_op in a test - [`d7896df`](https://github.com/horizon-rust/horizon/commit/d7896df7d8ea9cc25829d348f9b065406deb1623) Fusion packs: connection predicates - [`e440012`](https://github.com/horizon-rust/horizon/commit/e440012293655f43c6d1373c7e4bb94bd71173be) Fusion predicates: test every direction name and state values - [`574d9b1`](https://github.com/horizon-rust/horizon/commit/574d9b148e75278797a74a13b26452816960d04c) Fusion predicates: name the field a bad block list came from - [`383eea6`](https://github.com/horizon-rust/horizon/commit/383eea634de36c12e8884a07aaf61ffe6c539599) Fusion predicates: clippy's identity_op in a test ### 📊 Changes **10 files changed** (+1686 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `THIRD_PARTY_NOTICES.md` (+24 -0) 📝 `crates/horizon-client-render/src/sprites.rs` (+182 -0) 📝 `crates/horizon-optifine/Cargo.toml` (+1 -1) 📝 `crates/horizon-optifine/src/ctm/connect.rs` (+1 -1) ➕ `crates/horizon-optifine/src/fusion.rs` (+64 -0) ➕ `crates/horizon-optifine/src/fusion/layout.rs` (+399 -0) ➕ `crates/horizon-optifine/src/fusion/model.rs` (+244 -0) ➕ `crates/horizon-optifine/src/fusion/predicate.rs` (+349 -0) ➕ `crates/horizon-optifine/src/fusion/texture.rs` (+417 -0) 📝 `crates/horizon-optifine/src/lib.rs` (+5 -2) </details> ### 📄 Description A Fusion connecting texture is one image holding every tile of its layout: 47 for `full`, 5 for `pieced`, 18 for `overlay`. Horizon's block sprites are a texture array where every layer is one square sprite. A face can only switch to a tile if each tile has its own layer, but today the whole sheet loads as one layer, squeezed into a square. Fifth PR of the Fusion stack; depends on #6588, #6590, #6591 and #6592 (their commits are included here). **What I did.** `Sprites::insert_tiles(root, name, (columns, rows), per_tile)` reads the sheet, cuts it into square tiles as wide as a column, and registers each one as its own layer, row by row from the top left. Each tile gets its own opaque and translucent flags. A fully transparent tile gets no layer (`None`): the wiki says empty tiles "won't be processed". Animated sheets keep their animation: by default each frame is a whole grid, stacked one below the next; with `per_tile_animation` each cell is a column of that tile's frames. Tiles take the sheet's `texture` section (mipmap strategy, alpha cutoff bias). The sheet's own layer, which models show where Fusion doesn't draw it (items, other models), switches to the sheet's first tile. Left as the whole sheet squeezed square, it would set the size of every layer in the array: an 80 x 16 pieced sheet turned every 16 px block texture into 128 px. A sheet that isn't a whole grid of square tiles is an error, so the loader can warn and skip it. LabPBR `_n`/`_s` maps aren't cut per tile yet. Tile layers are named `fusion/<ns>/<path>#<tile>`, without a `:`, so the LabPBR map lookup isn't tried on a path that doesn't exist. Players see no change from this PR alone. The next PR (the mesher seam) calls it. **Docs used.** Fusion is All Rights Reserved, so I read none of its code. I worked from its public wiki's Connecting Texture Type page (layouts, empty tiles, Animation, Per tile animation) and Random Texture Type page. **Checks.** `cargo fmt`. I didn't build `horizon-client-render` on this shared machine (it isn't a quick build); the workspace clippy and test run is on my fork's CI: https://github.com/some-du6e/horizon/actions/runs/41370039955 (the next PR's branch, which includes this one). The new test cuts a hand-made 6 x 4 sheet whose pixel at (x, y) has red x and green y. It checks the empty middle column gives no layers, the bottom-left tile holds exactly pixels (0..2, 2..4), the half see-through tile is translucent, both animation layouts give the same two frames, and wrong grids are refused. No `.local` vanilla data here, so no harnesses or live game test. > [!NOTE] > Filed by Opus 5.5 using 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:31:49 +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#7006
No description provided.