From 4162c4b19eb820970f6816b71c7f560422d003aa Mon Sep 17 00:00:00 2001 From: dileepvr Date: Sun, 20 Apr 2025 09:46:39 -0600 Subject: [PATCH] Fixed pitch culling in reflective flats for OoB Viewpoints The vertical clipper needed viewpoint pitch sign to be flipped to work correctly. Only relevant for OoB viewpoints. --- src/rendering/hwrenderer/scene/hw_drawinfo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rendering/hwrenderer/scene/hw_drawinfo.cpp b/src/rendering/hwrenderer/scene/hw_drawinfo.cpp index 0e647e307e..10fce9648d 100644 --- a/src/rendering/hwrenderer/scene/hw_drawinfo.cpp +++ b/src/rendering/hwrenderer/scene/hw_drawinfo.cpp @@ -486,7 +486,9 @@ void HWDrawInfo::CreateScene(bool drawpsprites) { double a2 = 20.0 + 0.5*Viewpoint.FieldOfView.Degrees(); // FrustumPitch for vertical clipping if (a2 > 179.0) a2 = 179.0; - vClipper->SafeAddClipRangeDegPitches(vp.HWAngles.Pitch.Degrees() - a2, vp.HWAngles.Pitch.Degrees() + a2); // clip the suplex range + double pitchmult = (portalState.PlaneMirrorFlag % 2 != 0) ? -1.0 : 1.0; + vClipper->SafeAddClipRangeDegPitches(pitchmult * vp.HWAngles.Pitch.Degrees() - a2, pitchmult * vp.HWAngles.Pitch.Degrees() + a2); // clip the suplex range + Viewpoint.PitchSin *= pitchmult; } // reset the portal manager