Skip to content

Commit c6a6876

Browse files
committed
chunk rendering: disable level of details
So, the idea was/is great and when just standing or barely moving this makes a performance difference (less work on cpu and gpu), but the constant remeshing kills performance ultimately. There might be various ways to solve this (or combined): - Async GPU mesh loading: https://gitlab.bixilon.de/bixilon/minosoft/-/merge_requests/121 - Way faster meshing on the CPU - way less different types of LOD (just level 1/2 maybe 3) - Increase effect (merge multiple blocks; reduce the number of vertices to a minimum; don't mesh every block) - maybe more clever ways? - mesh twice: lod and full (just swap them; not remesh then or so) - merge similaur distances to not cause multiple remeshings when crossing borders This commit disables them for now until something is worked out.
1 parent 4f373ef commit c6a6876

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/main/java/de/bixilon/minosoft/gui/rendering/chunk/mesh/details/ChunkMeshDetails.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ object ChunkMeshDetails {
110110
}
111111

112112
fun update(previous: IntInlineSet, position: SectionPosition, camera: SectionPosition): IntInlineSet {
113+
return previous // TODO: This disables LOD completely
114+
113115
var details = previous
114116
val delta = position - camera
115117

src/main/java/de/bixilon/minosoft/gui/rendering/chunk/mesher/ChunkMesher.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Minosoft
3-
* Copyright (C) 2020-2025 Moritz Zwerger
3+
* Copyright (C) 2020-2026 Moritz Zwerger
44
*
55
* 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.
66
*
@@ -46,6 +46,7 @@ class ChunkMesher(
4646
private fun updateDetails() {
4747
var details = IntInlineSet()
4848

49+
4950
if (!profile.enabled) details += ChunkMeshDetails.ALL
5051

5152
if (!profile.minorVisualImpact) details += ChunkMeshDetails.MINOR_VISUAL_IMPACT
@@ -69,7 +70,9 @@ class ChunkMesher(
6970

7071
val position = SectionPosition.of(section)
7172

72-
val details = ChunkMeshDetails.of(position, renderer.visibility.sectionPosition) + this.details
73+
// TODO: This disables LOD completely
74+
// val details = ChunkMeshDetails.of(position, renderer.visibility.sectionPosition) + this.details
75+
val details = ChunkMeshDetails.ALL
7376

7477

7578
// TODO: put sizes of previous mesh (cache estimate)

0 commit comments

Comments
 (0)