In src/lib/world.js, updateNeighborsOfChunk reads chunk.isEmpty (no underscore):
var terrainChanged = (!chunk) || (chunk && !chunk.isEmpty)
But Chunk defines the property as _isEmpty (with underscore). chunk.isEmpty is always undefined, so !chunk.isEmpty is always true, making terrainChanged unconditionally true.
This means every empty chunk arrival marks all 26 neighbours as _terrainDirty, causing unnecessary re-meshing. For typical terrain where most chunks above ground are air, this creates a large amount of redundant meshing work during world loading.
Fix:
- var terrainChanged = (!chunk) || (chunk && !chunk.isEmpty)
+ var terrainChanged = (!chunk) || (chunk && !chunk._isEmpty)
In
src/lib/world.js,updateNeighborsOfChunkreadschunk.isEmpty(no underscore):But Chunk defines the property as _isEmpty (with underscore). chunk.isEmpty is always undefined, so !chunk.isEmpty is always true, making terrainChanged unconditionally true.
This means every empty chunk arrival marks all 26 neighbours as _terrainDirty, causing unnecessary re-meshing. For typical terrain where most chunks above ground are air, this creates a large amount of redundant meshing work during world loading.
Fix: