From c38b11943567e6046945dd92c3e0d2765f333ad8 Mon Sep 17 00:00:00 2001 From: dileepvr Date: Tue, 15 Oct 2024 21:29:21 -0600 Subject: [PATCH] FOV scales ortho up to 180 degrees One line change in r_utility.cpp affecting a custom field. Orthographic projection sees "more" of the sceen as fov increases, but only up to 180 degrees, after which it will have no effect. Orthographic projection has no meaning for fov since there is no Frustum. But since this is fundamental to the engine, I am reinterpreting it. Cherno wanted this too. I'll update the wiki if this gets in. --- src/rendering/r_utility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rendering/r_utility.cpp b/src/rendering/r_utility.cpp index 3e40c3a0c6..b7b6b452ba 100644 --- a/src/rendering/r_utility.cpp +++ b/src/rendering/r_utility.cpp @@ -704,7 +704,7 @@ void FRenderViewpoint::SetViewAngle(const FViewWindow& viewWindow) HWAngles.Yaw = FAngle::fromDeg(270.0 - Angles.Yaw.Degrees()); if (IsOrtho() && (camera->ViewPos->Offset.XY().Length() > 0.0)) - ScreenProj = 1.34396 / camera->ViewPos->Offset.Length(); // [DVR] Estimated. +/-1 should be top/bottom of screen. + ScreenProj = 1.34396 / camera->ViewPos->Offset.Length() / tan (FieldOfView.Radians()*0.5); // [DVR] Estimated. +/-1 should be top/bottom of screen. }