Skip to content
Permalink
Browse files

fix #6307 / close #476

  • Loading branch information...
rtri
rtri committed Oct 3, 2019
1 parent 9391542 commit 2c75c67f428c3d6b4254e41756634354e00bf67e
Showing with 4 additions and 2 deletions.
  1. +3 −1 rts/Game/Camera.cpp
  2. +1 −1 rts/Rendering/GlobalRendering.cpp
@@ -278,7 +278,9 @@ void CCamera::UpdateViewRange()
// camera-height dependence (i.e. TAB-view)
wantedViewRange = std::max(wantedViewRange, (pos.y - std::max(0.0f, mapMinHeight)) * 2.0f);
// view-angle dependence (i.e. FPS-view)
wantedViewRange = std::max(wantedViewRange, (1.0f - std::max(0.0f, forward.dot(UpVector))) * maxEdgeDist);
// forward normally points down, so 1-min(0, dot(f,u))
// will be >= 1 and increase the effective maxEdgeDist
wantedViewRange = std::max(wantedViewRange, (1.0f - std::min(0.0f, forward.dot(UpVector))) * maxEdgeDist);

#if 0
wantedViewRange = std::max(wantedViewRange, CGround::LinePlaneCol(pos, tlPixelDir, SQ_MAX_VIEW_RANGE, mapMinHeight));
@@ -189,7 +189,7 @@ CGlobalRendering::CGlobalRendering()

// sane defaults
, minViewRange(MIN_ZNEAR_DIST * 8.0f)
, maxViewRange(MAX_VIEW_RANGE * 0.25f)
, maxViewRange(MAX_VIEW_RANGE * 0.5f)
, aspectRatio(1.0f)

, forceDisableShaders(configHandler->GetInt("ForceDisableShaders"))

0 comments on commit 2c75c67

Please sign in to comment.
You can’t perform that action at this time.