mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-19 18:11:35 +00:00
Merge branch 'rm_redundant_code' into 'master'
Avoid unnecessary computation See merge request OpenMW/openmw!1623
This commit is contained in:
commit
002d0bf694
1 changed files with 1 additions and 2 deletions
|
@ -656,11 +656,10 @@ namespace MWRender
|
||||||
if (relativeLuminance < mMinimumAmbientLuminance)
|
if (relativeLuminance < mMinimumAmbientLuminance)
|
||||||
{
|
{
|
||||||
// brighten ambient so it reaches the minimum threshold but no more, we want to mess with content data as least we can
|
// brighten ambient so it reaches the minimum threshold but no more, we want to mess with content data as least we can
|
||||||
float targetBrightnessIncreaseFactor = mMinimumAmbientLuminance / relativeLuminance;
|
|
||||||
if (ambient.r() == 0.f && ambient.g() == 0.f && ambient.b() == 0.f)
|
if (ambient.r() == 0.f && ambient.g() == 0.f && ambient.b() == 0.f)
|
||||||
ambient = osg::Vec4(mMinimumAmbientLuminance, mMinimumAmbientLuminance, mMinimumAmbientLuminance, ambient.a());
|
ambient = osg::Vec4(mMinimumAmbientLuminance, mMinimumAmbientLuminance, mMinimumAmbientLuminance, ambient.a());
|
||||||
else
|
else
|
||||||
ambient *= targetBrightnessIncreaseFactor;
|
ambient *= mMinimumAmbientLuminance / relativeLuminance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue