diff --git a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhFrustumBounds.java b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhFrustumBounds.java index 77f28dbd7..6968551fb 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhFrustumBounds.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhFrustumBounds.java @@ -1,6 +1,5 @@ package com.seibel.distanthorizons.core.pos; -import com.seibel.distanthorizons.coreapi.util.math.Mat4f; import org.joml.FrustumIntersection; import org.joml.Matrix4f; import org.joml.Matrix4fc; @@ -36,9 +35,9 @@ public class DhFrustumBounds Vector3f lodMin = new Vector3f(lodPosX, worldMinY, lodPosZ); Vector3f lodMax = new Vector3f(lodPosX + lodSize, worldMaxY, lodPosZ + lodSize); - //if (lodMax.x < this.boundsMin.x || lodMin.x > this.boundsMax.x) return false; - //if (lodMax.z < this.boundsMin.z || lodMin.z > this.boundsMax.z) return false; - //if (this.worldMaxY < this.boundsMin.y || this.worldMinY > this.boundsMax.y) return false; + if (lodMax.x < this.boundsMin.x || lodMin.x > this.boundsMax.x) return false; + if (lodMax.z < this.boundsMin.z || lodMin.z > this.boundsMax.z) return false; + if (this.worldMaxY < this.boundsMin.y || this.worldMinY > this.boundsMax.y) return false; return frustum.testAab(lodMin, lodMax); } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java index 3455e3ba4..143f74582 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java @@ -332,7 +332,7 @@ public class LodRenderer if (renderingFirstPass) { - Vec3f viewDir = this.getLookVector(); + Vec3f viewDir = MC_RENDER.getLookAtVector(); Vec3d viewPos = MC_RENDER.getCameraExactPosition(); // TODO: find proper way to get view matrix, this breaks when perfectly up/down @@ -340,6 +340,8 @@ public class LodRenderer .setTransposed(projectionMatrix.getValuesAsArray()) .lookAlong(viewDir.x, viewDir.y, viewDir.z, 0f, 1f, 0f) .translate(-(float)viewPos.x, -(float)viewPos.y, -(float)viewPos.z); + + // TODO: will also need a diff matrix for iris shadow pass! this.bufferHandler.buildRenderListAndUpdateSections(clientLevelWrapper, matViewProjection, viewDir);