From ccfebdd2c330720513de334bc9e0df563d358149 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 14 Mar 2017 19:27:44 +0100 Subject: [PATCH] Set the underwater fog relative to default view distance --- apps/openmw/mwrender/renderingmanager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 5879c14c6..69aa30702 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -493,9 +493,11 @@ namespace MWRender mCurrentCameraPos = cameraPos; if (mWater->isUnderwater(cameraPos)) { + float viewDistance = mViewDistance; + viewDistance = std::min(viewDistance, 6666.f); setFogColor(mUnderwaterColor * mUnderwaterWeight + mFogColor * (1.f-mUnderwaterWeight)); - mStateUpdater->setFogStart(mViewDistance * (1 - mUnderwaterFog)); - mStateUpdater->setFogEnd(mViewDistance); + mStateUpdater->setFogStart(viewDistance * (1 - mUnderwaterFog)); + mStateUpdater->setFogEnd(viewDistance); } else {