mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Don't bother multiplying a matrix by its inverse and applying that to the light direction.
Hopefully this will improve numerical stability and reduce shadow flicker a little.
This commit is contained in:
parent
4438ab4493
commit
d82c85913a
@ -474,7 +474,7 @@ void MWShadowTechnique::LightData::setLightData(osg::RefMatrix* lm, const osg::L
|
||||
lightDir.set(-lightPos.x(), -lightPos.y(), -lightPos.z());
|
||||
lightDir.normalize();
|
||||
OSG_INFO<<" Directional light, lightPos="<<lightPos<<", lightDir="<<lightDir<<std::endl;
|
||||
if (lightMatrix.valid())
|
||||
if (lightMatrix.valid() && *lightMatrix != osg::Matrixf(modelViewMatrix))
|
||||
{
|
||||
OSG_INFO<<" Light matrix "<<*lightMatrix<<std::endl;
|
||||
osg::Matrix lightToLocalMatrix(*lightMatrix * osg::Matrix::inverse(modelViewMatrix) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user