Changed the default value of Texture::_resizeNonPowerOfTwoHint to true, to

improve the backwards compatibility of peformance on systems that have OpenGL2.0
drivers but without hardware that can't handle non power of two textures.
This commit is contained in:
Robert Osfield
2005-11-24 10:28:09 +00:00
parent 83f43b37e6
commit b5a5cd7901
2 changed files with 4 additions and 2 deletions

View File

@@ -533,7 +533,7 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int /*numTreesToCreates*
terrainTexture->setImage(terrainImage);
terrainTexture->setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::NEAREST);
terrainTexture->setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::NEAREST);
//terrainTexture->setResizeNonPowerOfTwoHint(true);
terrainTexture->setResizeNonPowerOfTwoHint(false);
stateset->setTextureAttributeAndModes(0,terrainTexture,osg::StateAttribute::ON);
@@ -669,6 +669,7 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int /*numTreesToCreates*
}
std::cout<<"done."<<std::endl;
#if 0
std::cout<<"Creating tree locations...";std::cout.flush();
TreeList trees;
@@ -686,6 +687,7 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int /*numTreesToCreates*
tex->setWrap( osg::Texture2D::WRAP_S, osg::Texture2D::CLAMP );
tex->setWrap( osg::Texture2D::WRAP_T, osg::Texture2D::CLAMP );
tex->setImage(osgDB::readImageFile("Images/tree0.rgba"));
tex->setResizeNonPowerOfTwoHint(false);
osg::StateSet *dstate = new osg::StateSet;
{

View File

@@ -340,7 +340,7 @@ Texture::Texture():
_useHardwareMipMapGeneration(true),
_unrefImageDataAfterApply(false),
_clientStorageHint(false),
_resizeNonPowerOfTwoHint(false),
_resizeNonPowerOfTwoHint(true),
_borderColor(0.0, 0.0, 0.0, 0.0),
_borderWidth(0),
_internalFormatMode(USE_IMAGE_DATA_FORMAT),