Hello All:

I use a custom visitor to enable a non power of 2 support. This is very common from models I have seen from Google Sketchup. I have ran across a number of non power of 2 textures and this seems to work nicely. For some modes though, and I forget which, it will still compute a power of 2 texture and I think this depends on the graphics card (Texture mirroring mode?). I have an ATI card and it seems in OSG logic there are certain combinations of texture modes that still will cause a NPOT to be converted to a POT based on the testing of graphics card capabilities and assumptions.


Take care

Garrett

Hi Jim,

It's the rendering thread that does the resize, and does so using glu,
something that can only be called from a thread with a valid graphics
context.

To do rescale in a loader we'd need to implement scaling without the use of glu.

The other alternative is to just use the non power of two texture extension.

Robert.

On Wed, Jul 9, 2008 at 1:47 AM, Jim Vaughan <[EMAIL PROTECTED]> wrote:

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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 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,  <[EMAIL PROTECTED]> 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@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce
negraph.org

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to