diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/chunk/mesh/ChunkMeshes.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/chunk/mesh/ChunkMeshes.kt index f45643e56..e6cbbd5f4 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/chunk/mesh/ChunkMeshes.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/chunk/mesh/ChunkMeshes.kt @@ -1,6 +1,6 @@ /* * Minosoft - * Copyright (C) 2020-2023 Moritz Zwerger + * Copyright (C) 2020-2025 Moritz Zwerger * * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * @@ -32,9 +32,9 @@ class ChunkMeshes( smallMesh: Boolean = false, ) : BlockVertexConsumer { val center: Vec3 = Vec3(Vec3i.of(chunkPosition, sectionHeight, Vec3i(8, 8, 8))) - var opaqueMesh: ChunkMesh? = ChunkMesh(context, if (smallMesh) 3000 else 100000) - var translucentMesh: ChunkMesh? = ChunkMesh(context, if (smallMesh) 3000 else 10000) - var textMesh: ChunkMesh? = ChunkMesh(context, if (smallMesh) 5000 else 50000) + var opaqueMesh: ChunkMesh? = ChunkMesh(context, if (smallMesh) 8192 else 65536) + var translucentMesh: ChunkMesh? = ChunkMesh(context, if (smallMesh) 4096 else 16384) + var textMesh: ChunkMesh? = ChunkMesh(context, if (smallMesh) 1024 else 4096) var blockEntities: ArrayList>? = null // used for frustum culling diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/gui/gui/GUIMeshElement.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/gui/gui/GUIMeshElement.kt index bf7ea8dd5..d1517ab13 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/gui/gui/GUIMeshElement.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/gui/gui/GUIMeshElement.kt @@ -1,6 +1,6 @@ /* * Minosoft - * Copyright (C) 2020-2023 Moritz Zwerger + * Copyright (C) 2020-2025 Moritz Zwerger * * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * @@ -42,7 +42,7 @@ open class GUIMeshElement( override val context: RenderContext = guiRenderer.context private val clickCounter = MouseClickCounter() private var _mesh: GUIMesh? = null - var mesh: GUIMesh = GUIMesh(context, guiRenderer.halfSize, FloatListUtil.direct(1000)) + var mesh: GUIMesh = GUIMesh(context, guiRenderer.halfSize, FloatListUtil.direct(1024)) override val skipDraw: Boolean get() = if (element is BaseDrawable) element.skipDraw else false protected var lastRevision = 0L diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/gui/mesh/GUIMesh.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/gui/mesh/GUIMesh.kt index d93d0d13a..19f167a27 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/gui/mesh/GUIMesh.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/gui/mesh/GUIMesh.kt @@ -1,6 +1,6 @@ /* * Minosoft - * Copyright (C) 2020-2023 Moritz Zwerger + * Copyright (C) 2020-2025 Moritz Zwerger * * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * @@ -27,7 +27,7 @@ class GUIMesh( context: RenderContext, val halfSize: Vec2, data: AbstractFloatList, -) : Mesh(context, GUIMeshStruct, initialCacheSize = 40000, data = data), GUIVertexConsumer { +) : Mesh(context, GUIMeshStruct, initialCacheSize = 32768, data = data), GUIVertexConsumer { private val whiteTexture = context.textures.whiteTexture override val order = context.system.quadOrder diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/util/mesh/Mesh.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/util/mesh/Mesh.kt index f6ff5e833..f4fb816c3 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/util/mesh/Mesh.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/util/mesh/Mesh.kt @@ -1,6 +1,6 @@ /* * Minosoft - * Copyright (C) 2020-2023 Moritz Zwerger + * Copyright (C) 2020-2025 Moritz Zwerger * * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * @@ -29,7 +29,7 @@ abstract class Mesh( val context: RenderContext, private val struct: MeshStruct, val primitive: PrimitiveTypes = context.system.quadType, - var initialCacheSize: Int = 10000, + var initialCacheSize: Int = 8192, data: AbstractFloatList? = null, ) : AbstractVertexConsumer { override val order = context.system.legacyQuadOrder diff --git a/src/main/java/de/bixilon/minosoft/util/collections/floats/FloatListUtil.kt b/src/main/java/de/bixilon/minosoft/util/collections/floats/FloatListUtil.kt index ac098ec27..4315ba7cc 100644 --- a/src/main/java/de/bixilon/minosoft/util/collections/floats/FloatListUtil.kt +++ b/src/main/java/de/bixilon/minosoft/util/collections/floats/FloatListUtil.kt @@ -1,6 +1,6 @@ /* * Minosoft - * Copyright (C) 2020-2023 Moritz Zwerger + * Copyright (C) 2020-2025 Moritz Zwerger * * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * @@ -23,7 +23,7 @@ object FloatListUtil { const val PREFER_FRAGMENTED = true val FLOAT_PUT_METHOD = catchAll { FloatBuffer::class.java.getMethod("put", Int::class.java, FloatBuffer::class.java, Int::class.java, Int::class.java) } - const val DEFAULT_INITIAL_SIZE = 1000 + const val DEFAULT_INITIAL_SIZE = 1024 fun direct(initialSize: Int = DEFAULT_INITIAL_SIZE): AbstractFloatList { return if (PREFER_FRAGMENTED) FragmentedArrayFloatList(initialSize) else BufferedArrayFloatList(initialSize)