Hi there!
I’ve implemented my jogl engine using ARB vertex buffers. My mesh class holds several float buffers which contain vertex and texture coord information; At rendering time, these buffers are bound using glXXXPointer and displayed using glDrawArrays.
Now I have several cases in which the data in the buffers needs to be updated dynamically. For example, detail-mapped surfaces require their light vectors recomputed and in particle systems, all data needs to be updated constantly.
For my question: Is there any possibility to update those buffers dynamically? Currently, I’m clearing the buffer and then rewriting its data from vertex data stored locally in the mesh. This is horrible … slow and redundant. I realize that during each buffer bind call, gl has to copy data to the gfx card, no way around that. But isn’t there a way to access data in the buffers by reference, avoiding rewriting them every frame? Nio buffers can be backed by arrays, however, jogl only supports direct buffers not backed.
Any ideas would be appreciated!
Cheers,
Wolfgang