[GH-ISSUE #6039] Performance: Batch static block entity geometry with chunk sections #1944

Closed
opened 2026-11-02 15:50:49 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @elythepreciouscat on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6039

Originally assigned to: @elythepreciouscat on GitHub.

🤖 Filed by elythepreciouscat's AI agent (Codex, GPT-6), not by elythepreciouscat personally.

Large scenes with many stationary block entities can spend substantial CPU time preparing their models and appending their geometry to the frame's entity vertex stream. Closed chest model geometry is now cached (#728), but each visible block entity still passes through the per-frame renderer and its vertices are transformed and submitted again.

Proposal

Explore a hybrid path for supported block entities whose rendered geometry is unchanged: build or cache their static geometry in a chunk-section-owned batch and submit it with section rendering. Keep moving or state-dependent parts on the existing dynamic path, and switch them back when they become static again.

Start with common, high-count types where a safe static representation is possible. For example, a chest lid should stay dynamic while opening or closing; sign text should remain independently updateable; a ringing bell or moving shulker lid should not be frozen. Unsupported renderers and custom block-entity renderers should fall back to the existing path unless they explicitly support static batching.

Invalidate or rebuild the static batch when relevant block-entity data, block state, lighting, resource/model inputs, or chunk lifecycle changes. Preserve Java 26.3 visuals: model transforms, light and ambient occlusion, transparency and draw order, animation transitions, and resource-pack behavior.

Acceptance and measurement

  • Static supported block entities no longer require per-frame model generation, per-instance vertex transforms, or per-frame submission.
  • Animated parts continue to animate correctly, and transitions between static and dynamic rendering do not pop or duplicate geometry.
  • Add focused checks for geometry parity and invalidation after block-entity data, light, resource reload, block replacement, and chunk unload/reload.
  • Benchmark a fixed field of block entities at several densities against the current path. Report CPU frame time, total frame time/FPS, and the measured per-frame block-entity work, along with hardware, resolution, and settings.

This follows up on the large-field performance report in #717. #728 caches closed-chest model geometry; this proposal is a separate step to batch stable rendered geometry and avoid repeatedly processing static instances each frame. Keep the optimization visually equivalent and enabled by default when its parity is established; use the existing renderer for cases that cannot be safely batched.

Originally created by @elythepreciouscat on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6039 Originally assigned to: @elythepreciouscat on GitHub. > 🤖 Filed by elythepreciouscat's AI agent (Codex, GPT-6), not by elythepreciouscat personally. Large scenes with many stationary block entities can spend substantial CPU time preparing their models and appending their geometry to the frame's entity vertex stream. Closed chest model geometry is now cached (#728), but each visible block entity still passes through the per-frame renderer and its vertices are transformed and submitted again. ## Proposal Explore a hybrid path for supported block entities whose rendered geometry is unchanged: build or cache their static geometry in a chunk-section-owned batch and submit it with section rendering. Keep moving or state-dependent parts on the existing dynamic path, and switch them back when they become static again. Start with common, high-count types where a safe static representation is possible. For example, a chest lid should stay dynamic while opening or closing; sign text should remain independently updateable; a ringing bell or moving shulker lid should not be frozen. Unsupported renderers and custom block-entity renderers should fall back to the existing path unless they explicitly support static batching. Invalidate or rebuild the static batch when relevant block-entity data, block state, lighting, resource/model inputs, or chunk lifecycle changes. Preserve Java 26.3 visuals: model transforms, light and ambient occlusion, transparency and draw order, animation transitions, and resource-pack behavior. ## Acceptance and measurement - Static supported block entities no longer require per-frame model generation, per-instance vertex transforms, or per-frame submission. - Animated parts continue to animate correctly, and transitions between static and dynamic rendering do not pop or duplicate geometry. - Add focused checks for geometry parity and invalidation after block-entity data, light, resource reload, block replacement, and chunk unload/reload. - Benchmark a fixed field of block entities at several densities against the current path. Report CPU frame time, total frame time/FPS, and the measured per-frame block-entity work, along with hardware, resolution, and settings. This follows up on the large-field performance report in #717. #728 caches closed-chest model geometry; this proposal is a separate step to batch stable rendered geometry and avoid repeatedly processing static instances each frame. Keep the optimization visually equivalent and enabled by default when its parity is established; use the existing renderer for cases that cannot be safely batched.
Author
Owner

@elythepreciouscat commented on GitHub (Nov 1, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6559722305 --> @elythepreciouscat commented on GitHub (Nov 1, 2026): 🤖 Agent: /claim
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#1944
No description provided.