Hi Carsten, > Hello Daniel, > > Daniel Weber wrote: > > I tried to implement pseudoinstancing(drawing the same geometry many > times and transform it in the vertex shader). I wrote my own nodecore, derived > from MaterialDrawable, and used the techniques from Particle nodecore. My > first version used immediate mode, which worked fine but was too slow for > my purposes. > > > > Therefore I want to use vertex buffer objects, which should be updated > when a new geometry is attached. The Geometry and Particle core use very > complicated mechanism to get this working and I didn't get through it. > > > > - Is there a simple way to use vbos? > > - When and where do I setup the vbos? > > ok, let's see if we can narrow down the problem a little. The main > complication normally comes from the fact that you can not make OpenGL > calls from arbitrary places as the code may run in a thread that does > not have an OpenGL context. > Most objects that deal with OpenGL state therefore use GLObjects to > delay updates of the state until the render thread needs it. The way > this generally works is (cf. OSGGeometry.cpp): > > - in onCreate you register (registerGLObject) an update and a destroy > handler function with the Window > - in changed you mark the GLObject for a refresh or reinit > - in the registered update handler (handleClassicGL/handleAttGL for > Geometry) you make the necessary OpenGL calls to update the OpenGL object. > - in the registered destroy handler you free the OpenGL resources
Unfortunately, I must use OpenSG version 1.8 for my project and I had to add a "GLId"- and a "IgnoreGLForAspect"-Field with the same functionality as in OSGGeometry.cpp. After adding a validation of the GLObject in "drawPrimitives", everything worked fine. Thanks for the advice! But, I am facing a new problem that other parts of the scenegraph are not displayed correctly. During debugging, I noticed that the glObject-ids are related to the displaylist-ids. What is the purpose of registering a glObject: - Is this an abstraction for any object which uses OpenGL calls, and the ids are created consecutively? - Are the ids somehow related to displaylists-id? - If yes, can they "collide" with vbo ids? I switched my application to vbo-only. When I enable my own nodecore, another (only one!) geometry primitive (in another part of the scenegraph) vanishes. Is it possible that one vbo-id is used twice at that point? Thanks a lot! Daniel > > Geometry has two update/destroy handlers because it needs to call > slightly different functions depending on whether fixed function > pipeline or generic vertex attributes are used. Normally one is > sufficient. > > > - What do I have to consider to make this work across different aspects? > > it should work with the above setup. > > Cheers, > Carsten > > > ------------------------------------------------------------------------------ > Register Now & Save for Velocity, the Web Performance & Operations > Conference from O'Reilly Media. Velocity features a full day of > expert-led, hands-on workshops and two days of sessions from industry > leaders in dedicated Performance & Operations tracks. Use code vel09scf > and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf > _______________________________________________ > Opensg-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/opensg-users ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
