mojira.dev
MC-262461

Stair models are unoptimized and can cause rendering lag

The bug

The models for normal straight stairs as well as concave corner stairs use more planes than they need to define their shape, which can contribute to rendering lag as stairs are a commonly-used block in building.

Straight stairs use two cuboids, one with six faces and another with five. A visually identical result can be achieved by using two intersecting cuboids which have five faces each. While this reduction of only one face is far less than that of MC-262452 and MC-262433, the more widespread use of stairs causes this to stack up quite a bit.

Inner corner stairs use three cuboids which share 15 faces among themselves. It's possible to recreate this shape as well by using three correctly-arranged elements that only have four faces, bringing the number of faces the game needs to render per block down to 12.

Outer corner stairs appear to be optimal as is and can remain as they are - this resource pack does not touch their model.

I have tested these models thoroughly, and can confirm that they produce visually identical results to the vanilla models; the only cases in which they differ is when clipping inside of them via Spectator mode, which is not a concern. (A minor issue which is also the cause of MC-246224/MC-73186 may cause incredibly subtle jittering due to pixel misalignment, however this is virtually unnoticeable and can be completely ignored. I've tested these two models with the "Model Gap Fix" Fabric mod for 1.19.4, and the issue is absent there.)

How to reproduce

  1. Download the attached resource pack

  2. Create a superflat world with this preset:

    minecraft:barrier,10*minecraft:sandstone_stairs;minecraft:the_void
  3. Set both render distance and simulation distance to 5

  4. Execute the command

    /tp @s 0 -50 0 0 0
  5. Press Alt-F3 to show the FPS bars

  6. Compare performance

How to fix

The fix for this should be very, very simple. The resource pack attached to this ticket contains optimized versions of stairs.json and inner_stairs.json. The versions of these models in the current Minecraft development branch should be replaced with the models provided in the resource pack.

Related issues

Attachments

Comments

migrated
[media][media][media]

muzikbike

(Unassigned)

Confirmed

Gameplay

Normal

Performance, Textures and models

model-optimization

1.19.4, 23w18a

Retrieved