Fixed texture optimization problem associated with mixing already compiled scene graphs - resulting
in incorrect texture assignment. Solution was to a compareTextureObjects() test to the Texture*::compare(..) method that the osgUtil::Optimizer::StateSetVisitor uses to determine uniqueness.
This commit is contained in:
@@ -417,6 +417,17 @@ int Texture::compareTexture(const Texture& rhs) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Texture::compareTextureObjects(const Texture& rhs) const
|
||||
{
|
||||
if (_textureObjectBuffer.size()<rhs._textureObjectBuffer.size()) return -1;
|
||||
if (rhs._textureObjectBuffer.size()<_textureObjectBuffer.size()) return 1;
|
||||
for(unsigned int i=0; i<_textureObjectBuffer.size(); ++i)
|
||||
{
|
||||
if (_textureObjectBuffer[i] < rhs._textureObjectBuffer[i]) return -1;
|
||||
else if (rhs._textureObjectBuffer[i] < _textureObjectBuffer[i]) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Texture::setWrap(WrapParameter which, WrapMode wrap)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user