mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 10:25:06 -04:00
minor test performance improvements
- ChunkHeightmap is now only calculated if dimension has light (aka. only in light tests) - occlusion culling and light is just updated when dimension has light (world filling) - ...
This commit is contained in:
parent
bd549a1355
commit
9ec4eb8278
@ -91,6 +91,8 @@ object WorldTestUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!dimension.light && !dimension.skyLight) return // no need for occlusion when light is ignored
|
||||||
|
|
||||||
if (superUnsafe) {
|
if (superUnsafe) {
|
||||||
for (x in (start.x shr 4)..(end.x shr 4)) {
|
for (x in (start.x shr 4)..(end.x shr 4)) {
|
||||||
for (z in (start.z shr 4)..(end.z shr 4)) {
|
for (z in (start.z shr 4)..(end.z shr 4)) {
|
||||||
@ -107,10 +109,8 @@ object WorldTestUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dimension.light || dimension.skyLight) {
|
|
||||||
recalculateLight(heightmap = true) // yah, might break the result, don't use fill if you want to test light
|
recalculateLight(heightmap = true) // yah, might break the result, don't use fill if you want to test light
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private val DATA = SectionDataProvider::class.java.getDeclaredField("data").apply { isAccessible = true }
|
private val DATA = SectionDataProvider::class.java.getDeclaredField("data").apply { isAccessible = true }
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,6 @@ import de.bixilon.minosoft.data.registries.dimension.DimensionProperties
|
|||||||
object ChunkLightUtil {
|
object ChunkLightUtil {
|
||||||
|
|
||||||
fun DimensionProperties.hasSkyLight(): Boolean {
|
fun DimensionProperties.hasSkyLight(): Boolean {
|
||||||
return this.skyLight || this.effects.skyLight
|
return this.light && this.skyLight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,8 @@ class ChunkManager(val world: World, chunkCapacity: Int = 0, prototypeCapacity:
|
|||||||
size.onCreate(chunk.chunkPosition)
|
size.onCreate(chunk.chunkPosition)
|
||||||
world.view.updateServerDistance()
|
world.view.updateServerDistance()
|
||||||
|
|
||||||
val updates = hashSetOf<AbstractWorldUpdate>(ChunkCreateUpdate(chunk.chunkPosition, chunk))
|
val updates = HashSet<AbstractWorldUpdate>(9, 1.0f)
|
||||||
|
updates += ChunkCreateUpdate(chunk.chunkPosition, chunk)
|
||||||
|
|
||||||
for (index in 0 until ChunkNeighbours.COUNT) {
|
for (index in 0 until ChunkNeighbours.COUNT) {
|
||||||
val offset = ChunkNeighbours.OFFSETS[index]
|
val offset = ChunkNeighbours.OFFSETS[index]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user