Fastest way for drawing ever changing triangle set

Greetings,

according to your experiences with OpenGL ES and PowerVR, what is your fastest method of drawing for the following scenario:

Set of independent triangles that are completely regenerated every frame. The only thing that is semi-constant over the run of the program is the count.

My first idea to perform this task as fast as possible would be as follows:

  • Preallocate vbo with glBufferData with the suspected size and usage DYNAMIC_DRAW ; keep it in memory permanently.
  • Map full buffer once a frame using glMapBuffer. Keep writing triangles to mapped buffer until I’m done.
  • Unmap buffer and draw using glDrawArrays.
  • Occasionally allocate new buffer if space runs out.

There are of course tweaks that I can think of:

  • Don’t map the full buffer but chunks of it using glMapBufferRange, although this may be a waste if most of the buffer is used.
  • Store my date to a cpu-side buffer first, then map exactly the range I need or copy it directly via glBufferSubData.

Is this currently the fastest approach for my scenario or can you think of something faster?

Regards

Hi,

we have a section on this in our PowerVR Performance Recommendations Guide:
http://cdn.imgtec.com/sdk-documentation/PowerVR.Performance%20Recommendations.pdf

section 2.5.

Please let me know if you have further questions.
Marton