mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
Prevent the local map from being considered to be shadowed.
This commit is contained in:
parent
6e0b61d084
commit
64d5d0fd66
1 changed files with 3 additions and 1 deletions
|
@ -204,8 +204,10 @@ osg::ref_ptr<osg::Camera> LocalMap::createOrthographicCamera(float x, float y, f
|
|||
|
||||
osg::ref_ptr<osg::Image> fakeShadowMapImage = new osg::Image();
|
||||
fakeShadowMapImage->allocateImage(1, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT);
|
||||
*(float*)fakeShadowMapImage->data() = -std::numeric_limits<float>::infinity(); // this has been tried both positive and negative
|
||||
*(float*)fakeShadowMapImage->data() = std::numeric_limits<float>::infinity();
|
||||
osg::ref_ptr<osg::Texture> fakeShadowMapTexture = new osg::Texture2D(fakeShadowMapImage);
|
||||
fakeShadowMapTexture->setShadowComparison(true);
|
||||
fakeShadowMapTexture->setShadowCompareFunc(osg::Texture::ShadowCompareFunc::ALWAYS);
|
||||
for (int i = SceneUtil::MWShadow::baseShadowTextureUnit; i < SceneUtil::MWShadow::baseShadowTextureUnit + SceneUtil::MWShadow::numberOfShadowMapsPerLight; ++i)
|
||||
stateset->setTextureAttributeAndModes(i, fakeShadowMapTexture, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE | osg::StateAttribute::PROTECTED);
|
||||
|
||||
|
|
Loading…
Reference in a new issue