From Guillaume Millet, "When using the texture Atlas builder, it will convert from REPEAT to

CLAMP all textures using only texcoord between [-0.001 1.001] to give a
chance to create an Atlas.
If the atlas creation failed for other reason (texture size, only one
compatible texture, ...) the texture remain modified in CLAMP mode.

But if you use texcoords between [0.0 1.0] using CLAMP mode instead
REPEAT it is not safe because you will have a blend to the border color
at extremities.
If we want to have exactly the same rendering after changing mode from
REPEAT to CLAMP we should use the CLAMP_TO_EDGE mode instead of CLAMP to
avoid blending to border color at extremities.

Please find as attachment the proposed patch against latest svn version.
"
This commit is contained in:
Robert Osfield
2012-02-28 12:03:48 +00:00
parent 84ca21655e
commit 33e7857af9

View File

@@ -4390,8 +4390,8 @@ void Optimizer::TextureAtlasVisitor::optimize()
{
// safe to convert into CLAMP wrap mode.
OSG_INFO<<"Changing wrap mode to CLAMP"<<std::endl;
texture->setWrap(osg::Texture2D::WRAP_S, osg::Texture::CLAMP);
texture->setWrap(osg::Texture2D::WRAP_T, osg::Texture::CLAMP);
texture->setWrap(osg::Texture2D::WRAP_S, osg::Texture::CLAMP_TO_EDGE);
texture->setWrap(osg::Texture2D::WRAP_T, osg::Texture::CLAMP_TO_EDGE);
}
}
//typedef std::list<osg::Texture2D *> SourceListTmp;