forked from mirror/openmw-tes3mp
LightController fixes
This commit is contained in:
parent
6181594251
commit
258f7a2b42
1 changed files with 6 additions and 2 deletions
|
@ -61,8 +61,10 @@ namespace SceneUtil
|
||||||
void LightController::operator ()(osg::Node* node, osg::NodeVisitor* nv)
|
void LightController::operator ()(osg::Node* node, osg::NodeVisitor* nv)
|
||||||
{
|
{
|
||||||
double time = nv->getFrameStamp()->getSimulationTime();
|
double time = nv->getFrameStamp()->getSimulationTime();
|
||||||
if (time == mLastTime)
|
|
||||||
return;
|
// disabled early out, light state needs to be set every frame regardless of change, due to the double buffering
|
||||||
|
//if (time == mLastTime)
|
||||||
|
// return;
|
||||||
|
|
||||||
float dt = static_cast<float>(time - mLastTime);
|
float dt = static_cast<float>(time - mLastTime);
|
||||||
mLastTime = time;
|
mLastTime = time;
|
||||||
|
@ -119,6 +121,8 @@ namespace SceneUtil
|
||||||
brightness = 0.7f + pulseAmplitude(mDeltaCount*slow)*0.3f;
|
brightness = 0.7f + pulseAmplitude(mDeltaCount*slow)*0.3f;
|
||||||
|
|
||||||
static_cast<SceneUtil::LightSource*>(node)->getLight(nv->getTraversalNumber())->setDiffuse(mDiffuseColor * brightness);
|
static_cast<SceneUtil::LightSource*>(node)->getLight(nv->getTraversalNumber())->setDiffuse(mDiffuseColor * brightness);
|
||||||
|
|
||||||
|
traverse(node, nv);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LightController::setDiffuse(osg::Vec4f color)
|
void LightController::setDiffuse(osg::Vec4f color)
|
||||||
|
|
Loading…
Reference in a new issue