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

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

Reply via email to