From 7826d756d0a882eedfb033882ade06aaf4cbf7ab Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 15 Feb 2024 21:59:21 -0600 Subject: [PATCH] Add stackoverflow source link to RenderUtil.getNearClipPlaneDistanceInBlocks() --- .../java/com/seibel/distanthorizons/core/util/RenderUtil.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/RenderUtil.java b/core/src/main/java/com/seibel/distanthorizons/core/util/RenderUtil.java index 0177d327c..0ea8414ca 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/RenderUtil.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/RenderUtil.java @@ -214,6 +214,7 @@ public class RenderUtil double fov = MC_RENDER.getFov(partialTicks); double aspectRatio = (double) MC_RENDER.getScreenWidth() / MC_RENDER.getScreenHeight(); + // source: https://stackoverflow.com/questions/8101119/how-do-i-methodically-choose-the-near-clip-plane-distance-for-a-perspective-proj/8101234#8101234 return (float) (nearClipPlane / Math.sqrt(1d + MathUtil.pow2(Math.tan(fov / 180d * Math.PI / 2d)) * (MathUtil.pow2(aspectRatio) + 1d)));