From 73c5909387bfd8c0e08bbe5e5932e12c2025acf3 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Wed, 14 Jun 2023 22:35:53 +0200 Subject: [PATCH] small revert, "It is copying a texture, it is not a default initialized one. The source texture may or may not want GL_CLAMP_TO_EDGE." --- apps/openmw/mwrender/postprocessor.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp index 659f61c702..d64e9651bc 100644 --- a/apps/openmw/mwrender/postprocessor.cpp +++ b/apps/openmw/mwrender/postprocessor.cpp @@ -600,18 +600,13 @@ namespace MWRender // user-defined samplers for (const osg::Texture* texture : technique->getTextures()) { - osg::ref_ptr sample; - if (const auto* tex1D = dynamic_cast(texture)) - sample = new osg::Texture1D(*tex1D); + node.mRootStateSet->setTextureAttribute(texUnit, new osg::Texture1D(*tex1D)); else if (const auto* tex2D = dynamic_cast(texture)) - sample = new osg::Texture2D(*tex2D); + node.mRootStateSet->setTextureAttribute(texUnit, new osg::Texture2D(*tex2D)); else if (const auto* tex3D = dynamic_cast(texture)) - sample= new osg::Texture3D(*tex3D); + node.mRootStateSet->setTextureAttribute(texUnit, new osg::Texture3D(*tex3D)); - sample->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE); - sample->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE); - node.mRootStateSet->setTextureAttribute(texUnit, sample); node.mRootStateSet->addUniform(new osg::Uniform(texture->getName().c_str(), texUnit++)); } @@ -644,8 +639,6 @@ namespace MWRender const auto [w, h] = rt.mSize.get(renderWidth(), renderHeight()); subPass.mRenderTexture = new osg::Texture2D(*rt.mTarget); - subPass.mRenderTexture ->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE); - subPass.mRenderTexture ->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE); renderTargetCache[rt.mTarget] = subPass.mRenderTexture; subPass.mRenderTexture->setTextureSize(w, h); subPass.mRenderTexture->setName(std::string(pass->getTarget()));