Fastest method for dynamic geometry

Hello!

What is faster for drawing dynamic geometry (whose vertices change at every frame, and also the number of vertices): map the VBO or use of glBufferData/glBufferSubData?

Map buffer does have moreflexible options than glbufferdata.
For starters there’s the sync flag and invalidate flag which may prove useful.
See the gl spec for exact usage.

It very much depends on the amount of data you want to transfer and the hardware you use. There’s no general recommendation.

In some scenarios even immediate mode can be better than both VBO-based methods.

Ok thanks for the input.

I was considering the case where all the buffer is rewritten or at least the n first bytes (where n can be up to the size of the buffer), and there are a few dozens of vertices. Any advice on this concrete case?

How many dozens? If the amount of vertices is small you are unlikely to see any performance differences between those methods. For that you’ll need several thousands.

How many dozens? If the amount of vertices is small you are unlikely to see any performance differences between those methods. For that you’ll need several thousands.

About 50 to 100 lines maximum (100 to 200 vertices). Okay, I’ll use the method I consider easiest.


I have also a group of points to draw, around 5000 points (with position + color + pointsize). But these ones are rarely changed, easily 10 seconds can pass between changes of the whole set of points. In a case like this, what method sould be used? (I know it doesn’t matter much, because it’s so unfrequent)