Hi Sergey, 2012/1/16 Sergey Polischuk <[email protected]>: > I've destroyed complete scene with viewer and graphics context, and recreated > it all with reading new models from files with disabled cache etc. On first > run all was ok, and on next runs mesh would look all distorted (some vertices > of mesh randomly displaced etc). Dont know if it problem with display lists > or geometry data arrays in osg, but display lists should be brand new each > time, because i've deleted all opengl objects before shutting down graphics > context, and new context have different id, also object cache disabled, > cleared and model reloaded each time from file, so there shouldn't be problem > with osg data arrays. I have no idea what goes wrong.
If you are bypassing much of osgViewer's context management then it's possible to get the GL obejct caches that the OSG uses out of sync with what you are doing. osgViewer does a range of operations to clean up contexts and make sure the the GL object caches that the OSG uses are flushed. If you are manually managing your own contexts then you'll need to call releaseGLObjects() on your scene graph and call osg::flushAllDeletedGLObjects(contextID) prior to closing the context, if it this is outwith your control then calling discardAllGLObjects(contextID) enables the discarding of all the GL object caches. In the OSG the GL object caches are used to avoid problems with deleting OpenGL objects in other threads than the graphics contexts ones - as scene graphs can be deleted in any thread you need to cache, the cache is also used to enable reuse of OpenGL objects like texture objects and vbo's where possible, this is something that is very useful for paging performance. Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

