[osg-users] NPOT Textures

Robert Osfield robert.osfield at gmail.com
Mon Jul 7 06:50:10 PDT 2008

Hi Paul,

On Mon, Jul 7, 2008 at 1:15 PM,  <paul1492 at yahoo.com> wrote:
> If my hardware supports NPOT textures, how do I turn off resizeNonPowerOfTwo when loading an OpenFlight file?
> I don't see an easy way to do this..

Using NPOT textures is only sensible to on hardware that genuinely
supports it, otherwise it can force one down it software rendering.
The Nvidia Gefore 6 series onwards all support proper NPOT.   I don't
know the status of ATI yet though.

As for disable the automatic resize of non power of two textures,
you'll need to write a NodeVisitor that goes through the scene graph
and calls texture->setResizeNonPowerOfTwoHint(false);.  Perhaps the
easiest step would be to be to extend the
osgUtil::Optimizer::TextureVisitor so that it has an option for
setting this value on/off, as this visitor already finds all the
textures for you.


More information about the osg-users mailing list