mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-10 16:01:50 -04:00
chunk meshing: also prioritize direct neighbours
This commit is contained in:
parent
ea98f3275d
commit
8b0ac1944f
@ -74,8 +74,8 @@ class ChunkMeshingQueue(
|
|||||||
unlock()
|
unlock()
|
||||||
val camera = renderer.cameraSectionPosition
|
val camera = renderer.cameraSectionPosition
|
||||||
for (item in items) {
|
for (item in items) {
|
||||||
val distance = abs(item.position.x - camera.x) + abs(item.position.z - camera.z) // TODO: Check y?
|
val distance = abs(item.position.x - camera.x) + abs(item.position.z - camera.z) // TODO: Should y get in here too?
|
||||||
val runnable = HeavyPoolRunnable(if (distance < 1) ThreadPool.HIGH else ThreadPool.LOW, interruptable = true)
|
val runnable = HeavyPoolRunnable(if (distance <= 1) ThreadPool.HIGH else ThreadPool.LOW, interruptable = true)
|
||||||
val task = MeshPrepareTask(item.position, runnable)
|
val task = MeshPrepareTask(item.position, runnable)
|
||||||
task.runnable.runnable = Runnable { renderer.mesher.tryMesh(item, task, task.runnable) }
|
task.runnable.runnable = Runnable { renderer.mesher.tryMesh(item, task, task.runnable) }
|
||||||
tasks += task
|
tasks += task
|
||||||
|
Loading…
x
Reference in New Issue
Block a user