Temp fix for near clip plane going too far in some cases

This commit is contained in:
James Seibel
2024-02-13 07:53:01 -06:00
parent d7c96bbba4
commit cd20fb1e34
2 changed files with 4 additions and 6 deletions
@@ -187,6 +187,10 @@ public class LodRenderProgram extends ShaderProgram implements IDhApiShaderProgr
// Clip Uniform
float dhNearClipDistance = RenderUtil.getNearClipPlaneDistanceInBlocks(renderParameters.partialTicks);
// TODO a different multiplier might be necessary
// this is to try and allow the fragment culling to go farther than the near clip plane.
// Currently this only works for certain FOV/screen ratio combos.
dhNearClipDistance *= 2.0f;
setUniform(clipDistanceUniform, dhNearClipDistance);
}
@@ -186,13 +186,7 @@ public class RenderUtil
public static float getNearClipPlaneDistanceInBlocks(float partialTicks)
{
int chunkRenderDistance = MC_RENDER.getRenderDistance();
if (chunkRenderDistance % 2 == 0)
{
chunkRenderDistance += 1;
}
int vanillaBlockRenderedDistance = chunkRenderDistance * LodUtil.CHUNK_WIDTH;
vanillaBlockRenderedDistance *= 2;
float nearClipPlane;
if (Config.Client.Advanced.Debugging.lodOnlyMode.get())