Hi Jean-Sèbastien, Thanks ! :) It helped to use the TextureVisitor to disable unrefImageDataAfterApply. Have you tried to share the OpenGL context between the widgets to avoid several instances of all object resources.
The QGLWidet has the constructor QGLWidget ( QWidget * parent = 0, const char * name = 0, const QGLWidget * shareWidget = 0, WFlags f = 0 ) and bool QGLWidget::isSharing () const to check if the GL system was able to provide it. Is it possible to do the same with QOSGWidet? On Tue, May 12, 2009 at 4:30 PM, Jean-Sébastien Guay <[email protected]> wrote: > > Hi John, > >> I have, however, problems with textured models and the composite viewer. >> When I add a new view after initalization (application has entered the frame >> loop), the new view (within an QOSGWidet) does not show the textures. It the >> views are added before entering the frame loop there are no problems. > > That's because of the unrefImageDataAfterApply setting. You're probably > running the osgUtil::Optimizer on your data after loading it, and this sets > this property of osg::Texture(1D, 2D, 3D) to true, which in turn frees the > image data the first time the texture is uploaded to the graphics hardware. > So when you create a new view (which creates a new graphics context, which > requires that all textures be re-uploaded to it) the image data is not > available anymore. > > You can either not run the optimizer, run it but disable the texture setting > optimization, or run just the osgUtil::Optimizer::TextureVisitor again after > running the Optimizer the first time, to re-set that property to false. > > Hope this helps, > > J-S > -- > ______________________________________________________ > Jean-Sebastien Guay [email protected] > http://www.cm-labs.com/ > http://whitestar02.webhop.org/ > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

