Fix the API seeing the wrong far clip plane
This commit is contained in:
+2
-2
@@ -96,8 +96,8 @@ public class SSAOApplyShader extends AbstractShaderRenderer
|
||||
|
||||
if (this.gFarUniform >= 0)
|
||||
{
|
||||
float far = (float) ((RenderUtil.getFarClipPlaneDistanceInBlocks() + LodUtil.REGION_WIDTH) * Math.sqrt(2));
|
||||
GL32.glUniform1f(this.gFarUniform, far);
|
||||
float farClipPlane = RenderUtil.getFarClipPlaneDistanceInBlocks();
|
||||
GL32.glUniform1f(this.gFarUniform, farClipPlane);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -153,8 +153,7 @@ public class RenderUtil
|
||||
nearClipDist = 0.1f;
|
||||
}
|
||||
|
||||
int farPlaneDistanceInBlocks = RenderUtil.getFarClipPlaneDistanceInBlocks();
|
||||
float farClipDist = (float) ((farPlaneDistanceInBlocks + LodUtil.REGION_WIDTH) * Math.sqrt(2));
|
||||
float farClipDist = (float) RenderUtil.getFarClipPlaneDistanceInBlocks();
|
||||
|
||||
// Create a copy of the current matrix, so it won't be modified.
|
||||
Mat4f lodProj = mcProjMat.copy();
|
||||
@@ -228,7 +227,9 @@ public class RenderUtil
|
||||
public static int getFarClipPlaneDistanceInBlocks()
|
||||
{
|
||||
int lodChunkDist = Config.Client.Advanced.Graphics.Quality.lodChunkRenderDistanceRadius.get();
|
||||
return lodChunkDist * LodUtil.CHUNK_WIDTH;
|
||||
int lodBlockDist = lodChunkDist * LodUtil.CHUNK_WIDTH;
|
||||
// sqrt 2 to prevent the corners from being cut off
|
||||
return (int)((lodBlockDist + LodUtil.REGION_WIDTH) * Math.sqrt(2));
|
||||
}
|
||||
|
||||
/** @return false if LODs shouldn't be rendered for any reason */
|
||||
|
||||
Reference in New Issue
Block a user