[PR #6446] [MERGED] OptiFine packs: CTM overlays face the right way on rotated blocks #6878

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

📋 Pull Request Information

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

Base: main ← Head: optifine/ctm-overlay-orient


📝 Commits (1)

  • 9fbd459 OptiFine CTM overlays: drawn the standard way up, in the face's pieces

📊 Changes

1 file changed (+47 additions, -5 deletions)

View changed files

📝 crates/horizon-client-render/src/mesher.rs (+47 -5)

📄 Description

A review of the connected-texture overlays now on main (#6250) found two drawing bugs:

  1. Overlays pointed the wrong way on rotated blocks. The rule picks an overlay tile from the face's standard directions (a top face's up is north). But the overlay quad was drawn with the face's own model UVs, and vanilla's dirt, sand, red sand and grass block tops are randomly turned in four y-rotations. On three blocks in four, a sand edge picked for the north side of a dirt block drew on its east, south or west side, and corner tiles landed on the wrong corner. Continuity's spec says "overlay textures always have the standard orientation".
  2. Overlays over ctm_compact faces. The face is drawn as up to four pieces, but the overlay was one whole quad. On a translucent face (stained glass), the pieces nearer the camera sorted after the overlay and drew over it.

Fixes, in Mesher::face (crates/horizon-client-render/src/mesher.rs):

  • An overlay quad takes the UVs a vanilla cube gives its corners (standard_uv: BlockElement's default face UVs), not the model's. The base face keeps its own UVs, as before.
  • Over a ctm_compact face, each overlay is cut into the same pieces as the face, so it keeps the same depths and sort centres.

Faces without overlays don't reach this code, so nothing changes for packs without them.

Docs used: Continuity's wiki page "Continuity Connected Textures Specification" (the orient section: overlay textures always have the standard orientation) and OptiFine's OptiFineDoc/doc/ctm.properties. Vanilla's default face UVs (BlockElement) for standard_uv. No mod source was read.

Checks: cargo fmt; cargo test -p horizon-client-render --lib quarter_tests (3 tests, one new: overlays_take_the_cubes_own_uvs, hand-worked corners). Fork CI: https://github.com/some-du6e/horizon/actions/runs/41350326756. There's no live game test: this machine has no vanilla data (.local/).

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/6446 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `optifine/ctm-overlay-orient` --- ### 📝 Commits (1) - [`9fbd459`](https://github.com/horizon-rust/horizon/commit/9fbd459b63aa31c84e7212e8ff9908d6d08c44aa) OptiFine CTM overlays: drawn the standard way up, in the face's pieces ### 📊 Changes **1 file changed** (+47 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/mesher.rs` (+47 -5) </details> ### 📄 Description A review of the connected-texture overlays now on main (#6250) found two drawing bugs: 1. **Overlays pointed the wrong way on rotated blocks.** The rule picks an overlay tile from the face's standard directions (a top face's up is north). But the overlay quad was drawn with the face's own model UVs, and vanilla's dirt, sand, red sand and grass block tops are randomly turned in four y-rotations. On three blocks in four, a sand edge picked for the north side of a dirt block drew on its east, south or west side, and corner tiles landed on the wrong corner. Continuity's spec says "overlay textures always have the standard orientation". 2. **Overlays over `ctm_compact` faces.** The face is drawn as up to four pieces, but the overlay was one whole quad. On a translucent face (stained glass), the pieces nearer the camera sorted after the overlay and drew over it. Fixes, in `Mesher::face` (`crates/horizon-client-render/src/mesher.rs`): - An overlay quad takes the UVs a vanilla cube gives its corners (`standard_uv`: `BlockElement`'s default face UVs), not the model's. The base face keeps its own UVs, as before. - Over a `ctm_compact` face, each overlay is cut into the same pieces as the face, so it keeps the same depths and sort centres. Faces without overlays don't reach this code, so nothing changes for packs without them. **Docs used:** Continuity's wiki page "Continuity Connected Textures Specification" (the `orient` section: overlay textures always have the standard orientation) and OptiFine's `OptiFineDoc/doc/ctm.properties`. Vanilla's default face UVs (`BlockElement`) for `standard_uv`. No mod source was read. **Checks:** `cargo fmt`; `cargo test -p horizon-client-render --lib quarter_tests` (3 tests, one new: `overlays_take_the_cubes_own_uvs`, hand-worked corners). Fork CI: https://github.com/some-du6e/horizon/actions/runs/41350326756. There's no live game test: this machine has no vanilla data (`.local/`). > [!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:28:32 +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#6878
No description provided.