You can disable image rescaling with texture->setResizeNonPowerOfTwoHint(false)

Cheers

24.01.2012, 15:13, "Andrea Martini" <martini.and...@gmail.com>:
> Hi,
> thank you for your answer.
> I solved using :
>
> osg::Geode* mGeodeWhoHasTexture;  // Geode with texture
> osg::ref_ptr<osg::Texture2D> mGeodeTexture;
> osg::ref_ptr<osg::Image> mOriginalImage; // original image
> osg::ref_ptr<osg::Image> mImageOne; // new image
>
> // After image load
> ...
> mGeodeTexture=dynamic_cast<osg::Texture2D*>
> (mGeodeWhoHasTexture->getDrawable(0)->getStateSet()->getTextureAttribute(Channel,osg::StateAttribute::TEXTURE));
> if (mGeodeTexture.get())
> {
>        mOriginalImage = mGeodeTexture->getImage();
>        mGeodeTexture->setImage(mImageOne.get());
>  }
>
> Is there a way to  load all the images during start application to avoid 
> waiting time during image switching?
> Beccouse each time i load a new image, i see a rescaling process. (i don't 
> want to rescale image) that could take some seconds.
>
> Thank you!
>
> Cheers,
> Andrea
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=44985#44985
>
> _______________________________________________
> 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