mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Support point specular lighting (#6188)
Fix passing light specular colors with shader lighting methods (with help from wazabear)
This commit is contained in:
parent
c1f7a9c258
commit
820fc068d1
8 changed files with 54 additions and 14 deletions
|
@ -36,9 +36,11 @@ namespace SceneUtil
|
|||
// if (time == mLastTime)
|
||||
// return;
|
||||
|
||||
osg::Light* light = node->getLight(nv->getTraversalNumber());
|
||||
|
||||
if (mType == LT_Normal)
|
||||
{
|
||||
node->getLight(nv->getTraversalNumber())->setDiffuse(mDiffuseColor);
|
||||
light->setDiffuse(mDiffuseColor);
|
||||
traverse(node, nv);
|
||||
return;
|
||||
}
|
||||
|
@ -63,7 +65,10 @@ namespace SceneUtil
|
|||
mPhase = mPhase <= 0.5f ? 1.f : 0.25f;
|
||||
}
|
||||
|
||||
node->getLight(nv->getTraversalNumber())->setDiffuse(mDiffuseColor * mBrightness * node->getActorFade());
|
||||
osg::Vec4f result = mDiffuseColor * mBrightness * node->getActorFade();
|
||||
|
||||
light->setDiffuse(result);
|
||||
light->setSpecular(result);
|
||||
|
||||
traverse(node, nv);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue