mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Disable specularity for negative lights
This commit is contained in:
parent
debc37d93a
commit
e0e4b84e40
3 changed files with 16 additions and 4 deletions
|
@ -41,6 +41,7 @@ namespace SceneUtil
|
|||
if (mType == LT_Normal)
|
||||
{
|
||||
light->setDiffuse(mDiffuseColor);
|
||||
light->setSpecular(mSpecularColor);
|
||||
traverse(node, nv);
|
||||
return;
|
||||
}
|
||||
|
@ -65,10 +66,10 @@ namespace SceneUtil
|
|||
mPhase = mPhase <= 0.5f ? 1.f : 0.25f;
|
||||
}
|
||||
|
||||
osg::Vec4f result = mDiffuseColor * mBrightness * node->getActorFade();
|
||||
const float result = mBrightness * node->getActorFade();
|
||||
|
||||
light->setDiffuse(result);
|
||||
light->setSpecular(result);
|
||||
light->setDiffuse(mDiffuseColor * result);
|
||||
light->setSpecular(mSpecularColor * result);
|
||||
|
||||
traverse(node, nv);
|
||||
}
|
||||
|
@ -78,4 +79,9 @@ namespace SceneUtil
|
|||
mDiffuseColor = color;
|
||||
}
|
||||
|
||||
void LightController::setSpecular(const osg::Vec4f& color)
|
||||
{
|
||||
mSpecularColor = color;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue