Drawing indexed geometry

Just a newbie jogl question: I want to draw indexed geometry by setting my vertex arrays and then indexing into them at rendering time. For example, consider a big vertex buffer, which is then indexed by visibility information from an octtree or by contour information from a shadow volume algorithm.

The first thing I tried was to pass a buffer backed by an array as a vertex array. Didn’t work, of course, jogl demands buffers created with allocateDirect, so no way to just modify data in the buffer, e.g. for fast particle systems.

Second idea would be to use glDrawElements. However, I’ve tried this once, and it didn’t work (cannot remember any specifics), and I’ve read some posts on problems with glDrawElements. Perhaps I just did stupid stuff, and should try again :slight_smile: ?

Any ideas on how to do indexed geometry and still be able to use (at least) vertex arrays would be appreciated!

Thanks

Wolfgang

Should work fine. glMultiDrawElements is not implemented yet, but glDrawElements works well.