Sodium

Sodium

35M Downloads

Display entities with large width/height make entity culling incredibely slow

opl- opened this issue ยท 1 comments

commented

Bug Description

And I do mean slow: 1.5s per frame!

Reproduction Steps

  1. Enable entity culling in Sodium options.
  2. /summon minecraft:item_display ~ ~ ~ {"item":{"id":"minecraft:red_dye","Count":1b},"transformation":{"translation":[0.0,0.0,0.0],"right_rotation":[0.0,0.0,0.0,1.0],"scale":[1.0,0.0,1.0],"left_rotation":[0.0,0.0,0.0,1.0]},"width":9999,"height":9999}
  3. Optional: disable entity culling to return to playable FPS.
  4. /kill @e[type=minecraft:item_display,sort=nearest,limit=1,distance=..10]

Log File

N/A (No other performance mods loaded.)

Crash Report

N/A

commented

I would guess this is caused by the entity culling system checking every chunk the entity spans for visibility:

for (int x = minX; x <= maxX; x++) {
for (int z = minZ; z <= maxZ; z++) {
for (int y = minY; y <= maxY; y++) {
if (this.renderSectionManager.isSectionVisible(x, y, z)) {
return true;
}
}
}
}

A fix might be to skip this check if the entity exceeds a certain "large" threshold.