[PR #6588] [MERGED] Fusion packs: which tiles of a connecting texture a face draws #6967

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

📋 Pull Request Information

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

Base: main ← Head: optifine/fusion-layouts


📝 Commits (6)

  • 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

📊 Changes

6 files changed (+447 additions, -4 deletions)

View changed files

📝 THIRD_PARTY_NOTICES.md (+24 -0)
📝 crates/horizon-optifine/Cargo.toml (+1 -1)
📝 crates/horizon-optifine/src/ctm/connect.rs (+1 -1)
➕ crates/horizon-optifine/src/fusion.rs (+17 -0)
➕ crates/horizon-optifine/src/fusion/layout.rs (+399 -0)
📝 crates/horizon-optifine/src/lib.rs (+5 -2)

📄 Description

Packs made for the Fusion mod (Fusion Connected Glass, Block Transitions, Connected Bricks and others on Modrinth) draw their connected textures from one image cut into a grid of tiles. Horizon can't read that format yet, so these packs show the raw tile sheet or nothing at all. This is the first PR of a stack that adds Fusion support. It answers one question: given the neighbours that join a face, which tiles of the sheet does that face draw, for each of Fusion's seven layouts (full, simple, pieced, compact, horizontal, vertical, overlay)?

What I did. horizon_optifine::fusion::Layout maps a neighbour mask to tiles. The mask is the same one OptiFine CTM builds (ctm::connect, from the CTM work in #5711 and #5718), so both formats find neighbours the same way and nothing is duplicated:

  • pieced is exactly ctm_compact: the same 5 tiles in the same order, one per quarter of the face, so it calls compact_quarters.
  • overlay layers pieces over the face toward the neighbours that join it, on a 6 x 3 grid. It is close to OptiFine's overlay, with one difference: in Fusion a corner matters between two joined sides. With the corner joined, the two sides are one L-shaped piece; without it, they are two edge pieces. The wiki's GIF of the layout shows this (sand up, up-left, left and right draws the up-left piece plus the right edge), and the template's right-half tiles carry corner marks. One case isn't shown anywhere: every side joined and exactly one corner open. That case layers the two three-side pieces that keep every joined corner. So overlay has its own rule here and doesn't call connect::overlay_tiles.
  • full (47 tiles in an 8 x 6 grid with one empty cell), simple (16), horizontal, vertical and compact (one whole tile per face; which tile is read off the wiki's GIF) are lookup tables or short rules. The only change to the CTM side is making connect::reduce pub(crate).

Players see no change yet: nothing in the game calls this. Next in the stack: connection predicates, texture .mcmeta sections and connecting models (#6590, #6591, #6592), then the mesher seam that draws the tiles through connected.rs's Pick/Overlay.

Docs used. Fusion is All Rights Reserved (its Modrinth license), so I read none of its code. I worked from its public GitHub wiki (the Connecting Texture Type page's layouts) and the MIT-licensed layout templates of SuperMartijn642/FusionExamples (templates/template <layout>.png, credited in THIRD_PARTY_NOTICES.md). I decoded each tile's green (joined) and red (border) side and corner marks from the pixels. compact's template names its five tiles but not their masks, so which one a face takes comes from the wiki's GIF of that layout. The overlay mapping was checked against the official Block Transitions pack's sand edge image. None of the pack's files are committed.

Checks. cargo fmt and cargo test -p horizon-optifine --lib fusion locally (22 across the stack; this is the one quick test the shared machine's rules allow). The full workspace clippy and test run went to my fork's CI instead of this shared machine: https://github.com/some-du6e/horizon/actions/runs/41366107559. The tests pin tiles against the template positions I read, not against the code's own tables: for example, joined on every side but only the top-left corner is cell (5, 5), and sand to the left plus sand at both right-hand corners gives the left edge and two corner pieces. No .local vanilla data on this machine, so no harnesses, and the review loop's live game test was skipped: nothing here is drawn yet. Reviewed in three rounds of fresh reviewers. Round 1 found a missing type that Fusion Emissive Ores relies on, plus weak test coverage. Round 2 found that overlay corners join two sides into one piece. Round 3 was clean.

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/6588 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `optifine/fusion-layouts` --- ### 📝 Commits (6) - [`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 ### 📊 Changes **6 files changed** (+447 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `THIRD_PARTY_NOTICES.md` (+24 -0) 📝 `crates/horizon-optifine/Cargo.toml` (+1 -1) 📝 `crates/horizon-optifine/src/ctm/connect.rs` (+1 -1) ➕ `crates/horizon-optifine/src/fusion.rs` (+17 -0) ➕ `crates/horizon-optifine/src/fusion/layout.rs` (+399 -0) 📝 `crates/horizon-optifine/src/lib.rs` (+5 -2) </details> ### 📄 Description Packs made for the Fusion mod (Fusion Connected Glass, Block Transitions, Connected Bricks and others on Modrinth) draw their connected textures from one image cut into a grid of tiles. Horizon can't read that format yet, so these packs show the raw tile sheet or nothing at all. This is the first PR of a stack that adds Fusion support. It answers one question: given the neighbours that join a face, which tiles of the sheet does that face draw, for each of Fusion's seven layouts (`full`, `simple`, `pieced`, `compact`, `horizontal`, `vertical`, `overlay`)? **What I did.** `horizon_optifine::fusion::Layout` maps a neighbour mask to tiles. The mask is the same one OptiFine CTM builds (`ctm::connect`, from the CTM work in #5711 and #5718), so both formats find neighbours the same way and nothing is duplicated: - `pieced` is exactly `ctm_compact`: the same 5 tiles in the same order, one per quarter of the face, so it calls `compact_quarters`. - `overlay` layers pieces over the face toward the neighbours that join it, on a 6 x 3 grid. It is close to OptiFine's overlay, with one difference: in Fusion a corner matters between two joined sides. With the corner joined, the two sides are one L-shaped piece; without it, they are two edge pieces. The wiki's GIF of the layout shows this (sand up, up-left, left and right draws the up-left piece plus the right edge), and the template's right-half tiles carry corner marks. One case isn't shown anywhere: every side joined and exactly one corner open. That case layers the two three-side pieces that keep every joined corner. So `overlay` has its own rule here and doesn't call `connect::overlay_tiles`. - `full` (47 tiles in an 8 x 6 grid with one empty cell), `simple` (16), `horizontal`, `vertical` and `compact` (one whole tile per face; which tile is read off the wiki's GIF) are lookup tables or short rules. The only change to the CTM side is making `connect::reduce` `pub(crate)`. Players see no change yet: nothing in the game calls this. Next in the stack: connection predicates, texture `.mcmeta` sections and connecting models (#6590, #6591, #6592), then the mesher seam that draws the tiles through `connected.rs`'s `Pick`/`Overlay`. **Docs used.** Fusion is All Rights Reserved (its Modrinth license), so I read none of its code. I worked from its public GitHub wiki (the Connecting Texture Type page's layouts) and the MIT-licensed layout templates of SuperMartijn642/FusionExamples (`templates/template <layout>.png`, credited in THIRD_PARTY_NOTICES.md). I decoded each tile's green (joined) and red (border) side and corner marks from the pixels. `compact`'s template names its five tiles but not their masks, so which one a face takes comes from the wiki's GIF of that layout. The overlay mapping was checked against the official Block Transitions pack's sand edge image. None of the pack's files are committed. **Checks.** `cargo fmt` and `cargo test -p horizon-optifine --lib fusion` locally (22 across the stack; this is the one quick test the shared machine's rules allow). The full workspace clippy and test run went to my fork's CI instead of this shared machine: https://github.com/some-du6e/horizon/actions/runs/41366107559. The tests pin tiles against the template positions I read, not against the code's own tables: for example, joined on every side but only the top-left corner is cell (5, 5), and sand to the left plus sand at both right-hand corners gives the left edge and two corner pieces. No `.local` vanilla data on this machine, so no harnesses, and the review loop's live game test was skipped: nothing here is drawn yet. Reviewed in three rounds of fresh reviewers. Round 1 found a missing `type` that Fusion Emissive Ores relies on, plus weak test coverage. Round 2 found that `overlay` corners join two sides into one piece. Round 3 was clean. > [!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:30:26 +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#6967
No description provided.