diff options
author | makamys <makamys@outlook.com> | 2022-06-08 14:53:58 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-06-08 15:03:38 +0200 |
commit | 9860e5f7a81882abe76afaaee9b841890e614e8d (patch) | |
tree | a7c23b11db0af82c8202ab9095030ffaa28d02bc /src/main | |
parent | 1dfdcae404d93f929b0ac602993fbef1402dfb2f (diff) | |
download | Neodymium-9860e5f7a81882abe76afaaee9b841890e614e8d.tar.gz Neodymium-9860e5f7a81882abe76afaaee9b841890e614e8d.tar.bz2 Neodymium-9860e5f7a81882abe76afaaee9b841890e614e8d.zip |
Fix culling not working until you spin the camera around
Diffstat (limited to 'src/main')
3 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/makamys/lodmod/ducks/IWorldRenderer.java b/src/main/java/makamys/lodmod/ducks/IWorldRenderer.java index 83857d6..6527ba7 100644 --- a/src/main/java/makamys/lodmod/ducks/IWorldRenderer.java +++ b/src/main/java/makamys/lodmod/ducks/IWorldRenderer.java @@ -9,4 +9,5 @@ import net.minecraft.client.renderer.WorldRenderer; public interface IWorldRenderer { public List<ChunkMesh> getChunkMeshes(); + public boolean isDrawn(); } diff --git a/src/main/java/makamys/lodmod/mixin/MixinWorldRenderer.java b/src/main/java/makamys/lodmod/mixin/MixinWorldRenderer.java index 02b130f..5753798 100644 --- a/src/main/java/makamys/lodmod/mixin/MixinWorldRenderer.java +++ b/src/main/java/makamys/lodmod/mixin/MixinWorldRenderer.java @@ -174,7 +174,8 @@ abstract class MixinWorldRenderer implements IWorldRenderer { } } - private boolean isDrawn() { + @Override + public boolean isDrawn() { return isInFrustum && (!skipRenderPass[0] || !skipRenderPass[1]); } } diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index dec8276..10f748e 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -471,6 +471,7 @@ public class LODRenderer { if(Minecraft.getMinecraft().theWorld.getChunkFromChunkCoords(Math.floorDiv(wr.posX, 16), Math.floorDiv(wr.posZ, 16)).isChunkLoaded) { LODChunk lodChunk = getLODChunk(Math.floorDiv(wr.posX, 16), Math.floorDiv(wr.posZ, 16)); + lodChunk.hidden[Math.floorDiv(wr.posY, 16)] = !((IWorldRenderer)wr).isDrawn(); lodChunk.putChunkMeshes(Math.floorDiv(wr.posY, 16), ((IWorldRenderer)wr).getChunkMeshes()); } } |