PDA

View Full Version : Fastest method for dynamic geometry



Yomboprime
05-13-2010, 04:07 AM
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?

BionicBytes
05-13-2010, 07:45 AM
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.

Ketracel White
05-13-2010, 09:00 AM
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.

Yomboprime
05-13-2010, 11:29 AM
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?

Ketracel White
05-13-2010, 11:37 AM
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.

Yomboprime
05-13-2010, 04:07 PM
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)