[osg-users] how to eliminate a texture from an object???

David _ solid_davidian at hotmail.com
Tue Sep 18 09:16:00 PDT 2007


we´re using right now a lot of pagelod nodes and sometimes we generate some new textures and put them over these nodes so they have the original texture in texture id number 0 and the new one in number 1

we want to delete the number one texture, not the original one, so it can be replaced by an updated one which sometimes has different resolution, so an update of the existing one is not possible, we want to delete and replace by another one

this is how we´re putting the new texture over the older one. It has some alpha so decal is needed

osg::ref_ptr<osg::StateSet> stateset = geom->getOrCreateStateSet();
osg::ref_ptr<osg::TexEnv> modo_tex = new osg::TexEnv(osg::TexEnv::DECAL);
stateset.get()->setTextureAttribute(1, modo_tex.get(), osg::StateAttribute::OFF);

how would you delete it if you want to replace it in the future????

right now we´re just overwriting it, but we´re having memory leaks....


Busca desde cualquier página Web con una protección excepcional. Consigue la Barra de herramientas de Windows Live hoy mismo y GRATUITAMENTE.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070918/609522e4/attachment-0002.htm>

More information about the osg-users mailing list