diff options
author | makamys <makamys@outlook.com> | 2022-06-21 06:23:08 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-06-21 06:23:36 +0200 |
commit | af5af6d77cbe3e113a11d9aa92571f6172bafae4 (patch) | |
tree | d876a7bf316eb9deeec557da11036b37608586ae /src/main | |
parent | c08fe9958d86a05fa559a42ba8a8e8e02c516d8e (diff) | |
download | Neodymium-af5af6d77cbe3e113a11d9aa92571f6172bafae4.tar.gz Neodymium-af5af6d77cbe3e113a11d9aa92571f6172bafae4.tar.bz2 Neodymium-af5af6d77cbe3e113a11d9aa92571f6172bafae4.zip |
Optimize chunk simplification
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/makamys/neodymium/renderer/ChunkMesh.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/ChunkMesh.java b/src/main/java/makamys/neodymium/renderer/ChunkMesh.java index ff6e6ba..8aedc4d 100644 --- a/src/main/java/makamys/neodymium/renderer/ChunkMesh.java +++ b/src/main/java/makamys/neodymium/renderer/ChunkMesh.java @@ -149,9 +149,12 @@ public class ChunkMesh extends Mesh { MeshQuad a = planeQuads.get(i); for(int j = i + 1; j < planeQuads.size(); j++) { MeshQuad b = planeQuads.get(j); - if(a.isPosEqual(b)) { + if(!a.noMerge && a.isPosEqual(b)) { a.noMerge = true; b.noMerge = true; + } else { + // Due to sorting, identical quads will always be next to each other + break; } } } |