From 681183df31a1b695b119a6ab6049a4083b796aaf Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 19 Aug 2015 01:13:14 +0200 Subject: [PATCH] Restore handling of fog depth == 0 values (Bug #1549) --- apps/openmw/mwrender/renderingmanager.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index b01095f122..bac8fca6cb 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -379,8 +379,17 @@ namespace MWRender else { setFogColor(mFogColor); - mStateUpdater->setFogStart(mViewDistance * (1 - mFogDepth)); - mStateUpdater->setFogEnd(mViewDistance); + + if (mFogDepth == 0.f) + { + mStateUpdater->setFogStart(0.f); + mStateUpdater->setFogEnd(FLT_MAX); + } + else + { + mStateUpdater->setFogStart(mViewDistance * (1 - mFogDepth)); + mStateUpdater->setFogEnd(mViewDistance); + } } }