From b2976444c95455e11bfedbb08e94361034a35e74 Mon Sep 17 00:00:00 2001 From: "Dileep V. Reddy" Date: Sun, 25 Aug 2024 09:05:54 -0600 Subject: [PATCH] Smaller aspect ratio screens were getting clipped a bit too much. This is a brute-force if-else solution. Larger aspect ratios (wider screens) were always good. --- src/rendering/hwrenderer/scene/hw_drawinfo.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/rendering/hwrenderer/scene/hw_drawinfo.cpp b/src/rendering/hwrenderer/scene/hw_drawinfo.cpp index 19478c30c9..b7c02a8414 100644 --- a/src/rendering/hwrenderer/scene/hw_drawinfo.cpp +++ b/src/rendering/hwrenderer/scene/hw_drawinfo.cpp @@ -366,9 +366,16 @@ angle_t HWDrawInfo::FrustumAngle() { // If pitch is larger than this you can look all around at an FOV of 90 degrees if (fabs(Viewpoint.HWAngles.Pitch.Degrees()) > 89.0) return 0xffffffff; + int aspMult = AspectMultiplier(r_viewwindow.WidescreenRatio); // 48 == square window + double absPitch = fabs(Viewpoint.HWAngles.Pitch.Degrees()); + // Smaller aspect ratios still clip too much. Need a better solution + if (aspMult > 36 && absPitch > 30.0) return 0xffffffff; + else if (aspMult > 40 && absPitch > 25.0) return 0xffffffff; + else if (aspMult > 45 && absPitch > 20.0) return 0xffffffff; + else if (aspMult > 47 && absPitch > 10.0) return 0xffffffff; double xratio = r_viewwindow.FocalTangent / Viewpoint.PitchCos; - double floatangle = 0.035 + atan ( xratio ) * 48.0 / AspectMultiplier(r_viewwindow.WidescreenRatio); // this is radians + double floatangle = 0.05 + atan ( xratio ) * 48.0 / aspMult; // this is radians angle_t a1 = DAngle::fromRad(floatangle).BAMs(); if (a1 >= ANGLE_90) return 0xffffffff;