1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 03:32:36 +00:00

Use CLAMP_TO_EDGE for shadows

Partially mitigates https://gitlab.com/OpenMW/openmw/-/issues/7944

The border was necessary in the olden days when the FFP might have shadows, but they require shaders now.
This commit is contained in:
AnyOldName3 2024-04-29 01:21:29 +01:00
parent 5b25435260
commit ee3d012a6a

View File

@ -558,11 +558,9 @@ MWShadowTechnique::ShadowData::ShadowData(MWShadowTechnique::ViewDependentData*
_texture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);
_texture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);
// the shadow comparison should fail if object is outside the texture
_texture->setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::CLAMP_TO_BORDER);
_texture->setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::CLAMP_TO_BORDER);
_texture->setBorderColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
//_texture->setBorderColor(osg::Vec4(0.0f,0.0f,0.0f,0.0f));
// the shader clips sampled coordinates, so no need for border
_texture->setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::CLAMP_TO_EDGE);
_texture->setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::CLAMP_TO_EDGE);
// set up the camera
_camera = new osg::Camera;