mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +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
@ -656,11 +656,10 @@ namespace MWRender
|
||||
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
|
||||
float targetBrightnessIncreaseFactor = mMinimumAmbientLuminance / relativeLuminance;
|
||||
if (ambient.r() == 0.f && ambient.g() == 0.f && ambient.b() == 0.f)
|
||||
ambient = osg::Vec4(mMinimumAmbientLuminance, mMinimumAmbientLuminance, mMinimumAmbientLuminance, ambient.a());
|
||||
else
|
||||
ambient *= targetBrightnessIncreaseFactor;
|
||||
ambient *= mMinimumAmbientLuminance / relativeLuminance;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user