On Jan 14, 2008 6:20 PM, Simon Wittber <[EMAIL PROTECTED]> wrote: > > I've been experimenting with vertex arrays in pyglet, using > glDrawArrays. > > I haven't done anything complicated yet, but I have realised that I > might be able to use one large vertex array for my entire scene graph, > rather than seperate arrays for each object I might be rendering. This > would mean one call to a glVertexPointer function for each render > pass. > > Has anyone else experimented with this kind of optimisation?
I did some investigation into various data layouts of VBOs and VAs: http://www.partiallydisassembled.net/blog/?item=151. You can certainly use one array for everything, but you'll need separate calls within passes to glVertexPointer/etc anyway to switch between different array formats (my results from above showed that interleaving data and packing it can give a huge performance boost over parallel arrays). In my (undocumented) tests I've noticed that the overhead of calling glVertexPointer to bind to a different array (or buffer) is negligible (within reason, of course). Have a look in pyglet SVN trunk/experimental/buffer for my recent work on using vertex arrays and VBOs. I'm afraid it's not documented (or finished) yet, but is definitely set for inclusion in pyglet 1.1. The module provides an abstraction away from VBOs and vertex arrays to batches of primitives, which can be resized and updated efficiently. Alex. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en -~----------~----~----~----~------~----~------~--~---
