mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 01:45:33 +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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Reference in a new issue