diff options
author | makamys <makamys@outlook.com> | 2022-06-04 14:06:29 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-06-04 14:08:12 +0200 |
commit | c0a5188942b3431bab82e15b9c31d47abb90b1ac (patch) | |
tree | 59f5d2c549c1468c0f7340a6f8e6abcf9eb17eb4 /src/main/java/makamys/lodmod/renderer | |
parent | 592aaa64ddf8416b94c4098c614b6cfbb7a81481 (diff) | |
download | Neodymium-c0a5188942b3431bab82e15b9c31d47abb90b1ac.tar.gz Neodymium-c0a5188942b3431bab82e15b9c31d47abb90b1ac.tar.bz2 Neodymium-c0a5188942b3431bab82e15b9c31d47abb90b1ac.zip |
Add options to disable serialization and change sort frequency
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer')
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/LODRegion.java | 4 | ||||
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/LODRenderer.java | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/LODRegion.java b/src/main/java/makamys/lodmod/renderer/LODRegion.java index 4004adf..ed13980 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRegion.java +++ b/src/main/java/makamys/lodmod/renderer/LODRegion.java @@ -58,7 +58,7 @@ public class LODRegion { } public static LODRegion load(Path saveDir, int regionX, int regionZ) { - if(!LODMod.disableChunkMeshes) { + if(!LODMod.disableChunkMeshes && LODMod.saveMeshes) { File saveFile = getSavePath(saveDir, regionX, regionZ).toFile(); if(saveFile.exists()) { try { @@ -77,7 +77,7 @@ public class LODRegion { } public void save(Path saveDir) { - if(LODMod.disableChunkMeshes) return; + if(LODMod.disableChunkMeshes && LODMod.saveMeshes) return; try { File saveFile = getSavePath(saveDir, regionX, regionZ).toFile(); diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index d7504d7..ff86a76 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -92,6 +92,7 @@ public class LODRenderer { private long saveInterval = 60 * 1000; private int renderedMeshes; + private int frameCount; public int renderRange = 48; @@ -134,7 +135,10 @@ public class LODRenderer { } if(renderLOD) { - sort(); + if(frameCount % LODMod.sortFrequency == 0) { + sort(); + } + updateMeshes(); initIndexBuffers(); render(alpha); |