mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 17:39:42 +00:00
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."
This commit is contained in:
parent
0b1a0ad1a8
commit
73c5909387
1 changed files with 3 additions and 10 deletions
|
@ -600,18 +600,13 @@ namespace MWRender
|
||||||
// user-defined samplers
|
// user-defined samplers
|
||||||
for (const osg::Texture* texture : technique->getTextures())
|
for (const osg::Texture* texture : technique->getTextures())
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::Texture> sample;
|
|
||||||
|
|
||||||
if (const auto* tex1D = dynamic_cast<const osg::Texture1D*>(texture))
|
if (const auto* tex1D = dynamic_cast<const osg::Texture1D*>(texture))
|
||||||
sample = new osg::Texture1D(*tex1D);
|
node.mRootStateSet->setTextureAttribute(texUnit, new osg::Texture1D(*tex1D));
|
||||||
else if (const auto* tex2D = dynamic_cast<const osg::Texture2D*>(texture))
|
else if (const auto* tex2D = dynamic_cast<const osg::Texture2D*>(texture))
|
||||||
sample = new osg::Texture2D(*tex2D);
|
node.mRootStateSet->setTextureAttribute(texUnit, new osg::Texture2D(*tex2D));
|
||||||
else if (const auto* tex3D = dynamic_cast<const osg::Texture3D*>(texture))
|
else if (const auto* tex3D = dynamic_cast<const osg::Texture3D*>(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++));
|
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());
|
const auto [w, h] = rt.mSize.get(renderWidth(), renderHeight());
|
||||||
|
|
||||||
subPass.mRenderTexture = new osg::Texture2D(*rt.mTarget);
|
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;
|
renderTargetCache[rt.mTarget] = subPass.mRenderTexture;
|
||||||
subPass.mRenderTexture->setTextureSize(w, h);
|
subPass.mRenderTexture->setTextureSize(w, h);
|
||||||
subPass.mRenderTexture->setName(std::string(pass->getTarget()));
|
subPass.mRenderTexture->setName(std::string(pass->getTarget()));
|
||||||
|
|
Loading…
Reference in a new issue