1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:23:52 +00:00

Set the underwater fog relative to default view distance

This commit is contained in:
scrawl 2017-03-14 19:27:44 +01:00
parent fe439e7bbf
commit ccfebdd2c3

View file

@ -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
{