[osg-users] NPOT Textures

Jim Vaughan jimv at fxpal.com
Tue Jul 8 17:47:36 PDT 2008


Hi,

I have a related question; it seems that my textures are scaled as they
are loaded, for example if I move the camera, I get messages like:
8)
Scaling image 'D:\DOTSModels\kmz\images\texture0.JPG' from (1600,1200) to (1024,
1024)

Is there an easy way to cause all textures to be loaded and rescaled as the
model is loaded?

Thanks,
Jim

> -----Original Message-----
> From: osg-users-bounces at lists.openscenegraph.org
> [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf
> Of Robert Osfield
> Sent: Monday, July 07, 2008 6:50 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] NPOT Textures
>
> 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.
>
> Robert.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce
> negraph.org
>



More information about the osg-users mailing list