[PR #6220] [MERGED] OptiFine emissive textures: block entities glow too #6726

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

📋 Pull Request Information

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

Base: main ← Head: optifine/etf-block-entities


📝 Commits (10+)

  • e190856 OptiFine emissive textures: mobs' _e overlays glow at full brightness
  • 352b2d0 OptiFine emissive textures: parenthesise the test's light value
  • d4fde1a ETF blinking textures: mobs blink with their pack's _blink frames
  • a2b6822 OptiFine emissive textures: block entities glow too
  • b1a756e OptiFine random entities: vanilla on a miss, custom-model and warden textures choose too
  • ead5f88 Merge main into optifine/etf-emissive
  • 5eac2ed Merge main into optifine/etf-blink
  • d3b8e14 Merge main into optifine/etf-block-entities
  • d1df8b8 Merge optifine/etf-fixes into optifine/etf-emissive
  • afe44e4 Merge optifine/etf-emissive into optifine/etf-blink

📊 Changes

18 files changed (+1592 additions, -148 deletions)

View changed files

📝 crates/horizon-client-render/src/block_entity_render.rs (+91 -19)
📝 crates/horizon-client-render/src/hud.rs (+132 -3)
📝 crates/horizon-client/examples/probe/block_entity_render_fixture.rs (+1 -0)
📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/armor_stands.rs (+19 -5)
📝 crates/horizon-client/src/game/minecarts.rs (+1 -0)
📝 crates/horizon-client/src/game/packs.rs (+16 -4)
📝 crates/horizon-client/src/game/perspective.rs (+3 -1)
📝 crates/horizon-client/src/game/random_textures.rs (+8 -6)
📝 crates/horizon-client/src/mobs/cem.rs (+2 -0)
📝 crates/horizon-client/src/mobs/data.rs (+14 -3)
📝 crates/horizon-client/src/mobs/random_textures.rs (+324 -80)
📝 crates/horizon-client/src/mobs/render.rs (+454 -19)
➕ crates/horizon-optifine/src/blink.rs (+224 -0)
➕ crates/horizon-optifine/src/emissive.rs (+265 -0)
📝 crates/horizon-optifine/src/lib.rs (+5 -2)
📝 crates/horizon-optifine/src/random.rs (+13 -3)
📝 crates/horizon-optifine/src/random_textures.rs (+19 -3)

📄 Description

OptiFine's and ETF's emissive overlays also cover block entities: a chest, shulker box, bell or lectern book with a _e.png beside its texture glows in the dark. After #6217 only mobs did. With this PR, block entities glow too.

What players get:

  • Every block entity that draws its parts from an entity texture (chests, ender and trapped chests, copper chests, shulker boxes, bells, banners, decorated pots, the enchanting-table and lectern books, skulls, conduits) draws each part again with its texture's _e overlay. The overlay is full bright and keeps the part's shading.
  • Closed chests, which draw from pre-baked geometry, glow the same way.
  • A block-entity texture with no overlay draws as before, and so does the breaking animation.

How:

  • Paint gains glow: Option<Rect>. render_one's paint fills it from Scene.emissive and the sprite of <texture><suffix>.
  • draw_part and the closed-chest path emit a second pass with that sprite and full light.
  • The overlays are the same Emissive the mobs use. It's an Arc now, shared by the atlas (for Scene) and MobData, so the pack reload no longer moves it out of the atlas.

Not in this PR: beds' and signs' bodies are baked block models, not block entities here. They'd glow through block emissive, which runs through the block atlas and the terrain shader and comes in a later PR.

Docs I wrote it from (no mod source read):

  • OptiFine's emissive.properties ("The overlays can also be used for items, mobs and block entities")
  • ETF's EMISSIVE_GUIDE.md (chests, shulker boxes, beds, bells, enchanting table and lectern books)

Checks:

  • cargo fmt: clean
  • A test (block_entity_render::tests::a_glow_draws_the_part_again_at_full_brightness): a one-polygon part with a glow emits 8 vertices. The second four are full bright, sample the glow's rect (the corner at uv (1, 1)), and share the first four's positions and colours.
  • CI on my fork (verify: fmt, clippy -D warnings, cargo test --workspace): run linked in a comment once it finishes.
  • Not run: no live game test (no .local/ vanilla data here).

Stacked on #6217 (and the PRs below it); this branch includes their commits until they merge.

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/6220 **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/etf-block-entities` --- ### 📝 Commits (10+) - [`e190856`](https://github.com/horizon-rust/horizon/commit/e1908564c5cf77aeb094a1d007159a0a2a1a5633) OptiFine emissive textures: mobs' _e overlays glow at full brightness - [`352b2d0`](https://github.com/horizon-rust/horizon/commit/352b2d08a8b9c742fb9ebeb661dfd2755f72175f) OptiFine emissive textures: parenthesise the test's light value - [`d4fde1a`](https://github.com/horizon-rust/horizon/commit/d4fde1af7b8b1235f963d825eb67c6bf22d96ad5) ETF blinking textures: mobs blink with their pack's _blink frames - [`a2b6822`](https://github.com/horizon-rust/horizon/commit/a2b6822754678c5116eb32892b04a0142aa38a72) OptiFine emissive textures: block entities glow too - [`b1a756e`](https://github.com/horizon-rust/horizon/commit/b1a756ee59bc7ad3ad138b32e970f6d398fc6a45) OptiFine random entities: vanilla on a miss, custom-model and warden textures choose too - [`ead5f88`](https://github.com/horizon-rust/horizon/commit/ead5f88ea36ee4972a3853cf5b6fa12cbe80dddf) Merge main into optifine/etf-emissive - [`5eac2ed`](https://github.com/horizon-rust/horizon/commit/5eac2ed4e0fe0773d9b77b0d454bec9904dec21c) Merge main into optifine/etf-blink - [`d3b8e14`](https://github.com/horizon-rust/horizon/commit/d3b8e147b270844d07bc3d5f574f6a9355484bd3) Merge main into optifine/etf-block-entities - [`d1df8b8`](https://github.com/horizon-rust/horizon/commit/d1df8b899626b5339f98b9ed407016a077755242) Merge optifine/etf-fixes into optifine/etf-emissive - [`afe44e4`](https://github.com/horizon-rust/horizon/commit/afe44e4d77ac37667dabe561363025e9030302e6) Merge optifine/etf-emissive into optifine/etf-blink ### 📊 Changes **18 files changed** (+1592 additions, -148 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/block_entity_render.rs` (+91 -19) 📝 `crates/horizon-client-render/src/hud.rs` (+132 -3) 📝 `crates/horizon-client/examples/probe/block_entity_render_fixture.rs` (+1 -0) 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/armor_stands.rs` (+19 -5) 📝 `crates/horizon-client/src/game/minecarts.rs` (+1 -0) 📝 `crates/horizon-client/src/game/packs.rs` (+16 -4) 📝 `crates/horizon-client/src/game/perspective.rs` (+3 -1) 📝 `crates/horizon-client/src/game/random_textures.rs` (+8 -6) 📝 `crates/horizon-client/src/mobs/cem.rs` (+2 -0) 📝 `crates/horizon-client/src/mobs/data.rs` (+14 -3) 📝 `crates/horizon-client/src/mobs/random_textures.rs` (+324 -80) 📝 `crates/horizon-client/src/mobs/render.rs` (+454 -19) ➕ `crates/horizon-optifine/src/blink.rs` (+224 -0) ➕ `crates/horizon-optifine/src/emissive.rs` (+265 -0) 📝 `crates/horizon-optifine/src/lib.rs` (+5 -2) 📝 `crates/horizon-optifine/src/random.rs` (+13 -3) 📝 `crates/horizon-optifine/src/random_textures.rs` (+19 -3) </details> ### 📄 Description OptiFine's and ETF's emissive overlays also cover block entities: a chest, shulker box, bell or lectern book with a `_e.png` beside its texture glows in the dark. After #6217 only mobs did. With this PR, block entities glow too. **What players get:** - Every block entity that draws its parts from an entity texture (chests, ender and trapped chests, copper chests, shulker boxes, bells, banners, decorated pots, the enchanting-table and lectern books, skulls, conduits) draws each part again with its texture's `_e` overlay. The overlay is full bright and keeps the part's shading. - Closed chests, which draw from pre-baked geometry, glow the same way. - A block-entity texture with no overlay draws as before, and so does the breaking animation. **How:** - `Paint` gains `glow: Option<Rect>`. `render_one`'s `paint` fills it from `Scene.emissive` and the sprite of `<texture><suffix>`. - `draw_part` and the closed-chest path emit a second pass with that sprite and full light. - The overlays are the same `Emissive` the mobs use. It's an `Arc` now, shared by the atlas (for `Scene`) and `MobData`, so the pack reload no longer moves it out of the atlas. **Not in this PR:** beds' and signs' bodies are baked block models, not block entities here. They'd glow through block emissive, which runs through the block atlas and the terrain shader and comes in a later PR. **Docs I wrote it from** (no mod source read): - OptiFine's `emissive.properties` ("The overlays can also be used for items, mobs and block entities") - ETF's `EMISSIVE_GUIDE.md` (chests, shulker boxes, beds, bells, enchanting table and lectern books) **Checks:** - `cargo fmt`: clean - A test (`block_entity_render::tests::a_glow_draws_the_part_again_at_full_brightness`): a one-polygon part with a glow emits 8 vertices. The second four are full bright, sample the glow's rect (the corner at uv (1, 1)), and share the first four's positions and colours. - CI on my fork (`verify`: fmt, clippy `-D warnings`, `cargo test --workspace`): run linked in a comment once it finishes. - Not run: no live game test (no `.local/` vanilla data here). Stacked on #6217 (and the PRs below it); this branch includes their commits until they merge. > [!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:25:36 +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#6726
No description provided.