Skip to content

Commit 95cc0e6

Browse files
committed
reduce ram usage by 15%
1 parent 826b24d commit 95cc0e6

File tree

3 files changed

+0
-12
lines changed

3 files changed

+0
-12
lines changed

renderer/viewer/lib/mesher/models.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,6 @@ export function getSectionGeometry (sx: number, sy: number, sz: number, world: W
542542
heads: {},
543543
signs: {},
544544
// isFull: true,
545-
highestBlocks: new Map(),
546545
hadErrors: false,
547546
blocksCount: 0
548547
}
@@ -552,12 +551,6 @@ export function getSectionGeometry (sx: number, sy: number, sz: number, world: W
552551
for (cursor.z = sz; cursor.z < sz + 16; cursor.z++) {
553552
for (cursor.x = sx; cursor.x < sx + 16; cursor.x++) {
554553
let block = world.getBlock(cursor, blockProvider, attr)!
555-
if (!INVISIBLE_BLOCKS.has(block.name)) {
556-
const highest = attr.highestBlocks.get(`${cursor.x},${cursor.z}`)
557-
if (!highest || highest.y < cursor.y) {
558-
attr.highestBlocks.set(`${cursor.x},${cursor.z}`, { y: cursor.y, stateId: block.stateId, biomeId: block.biome.id })
559-
}
560-
}
561554
if (INVISIBLE_BLOCKS.has(block.name)) continue
562555
if ((block.name.includes('_sign') || block.name === 'sign') && !world.config.disableSignsMapsSupport) {
563556
const key = `${cursor.x},${cursor.y},${cursor.z}`

renderer/viewer/lib/mesher/shared.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export type MesherGeometryOutput = {
4242
heads: Record<string, any>,
4343
signs: Record<string, any>,
4444
// isFull: boolean
45-
highestBlocks: Map<string, HighestBlockInfo>
4645
hadErrors: boolean
4746
blocksCount: number
4847
customBlockModels?: CustomBlockModels

renderer/viewer/lib/worldrendererCommon.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ export abstract class WorldRendererCommon<WorkerSend = any, WorkerReceive = any>
123123

124124
handleResize = () => { }
125125
highestBlocksByChunks = new Map<string, { [chunkKey: string]: HighestBlockInfo }>()
126-
highestBlocksBySections = new Map<string, { [sectionKey: string]: HighestBlockInfo }>()
127126
blockEntities = {}
128127

129128
workersProcessAverageTime = 0
@@ -389,8 +388,6 @@ export abstract class WorldRendererCommon<WorkerSend = any, WorkerReceive = any>
389388
this.logWorkerWork(() => `-> ${data.workerIndex} geometry ${data.key} ${JSON.stringify({ dataSize: JSON.stringify(data).length })}`)
390389
this.geometryReceiveCount[data.workerIndex] ??= 0
391390
this.geometryReceiveCount[data.workerIndex]++
392-
const { geometry } = data
393-
this.highestBlocksBySections[data.key] = geometry.highestBlocks
394391
const chunkCoords = data.key.split(',').map(Number)
395392
this.lastChunkDistance = Math.max(...this.getDistance(new Vec3(chunkCoords[0], 0, chunkCoords[2])))
396393
}
@@ -688,7 +685,6 @@ export abstract class WorldRendererCommon<WorkerSend = any, WorkerReceive = any>
688685
for (let y = this.worldSizeParams.minY; y < this.worldSizeParams.worldHeight; y += 16) {
689686
this.setSectionDirty(new Vec3(x, y, z), false)
690687
delete this.finishedSections[`${x},${y},${z}`]
691-
this.highestBlocksBySections.delete(`${x},${y},${z}`)
692688
}
693689
this.highestBlocksByChunks.delete(`${x},${z}`)
694690

0 commit comments

Comments
 (0)