About display lists, vertex buffers, vertex arrays

Started by
2 comments, last by Danny02 12 years, 9 months ago
This is a begginer question.
I have seen this 3 kinds of ways to handle data.
My app are going to visualize large 3D terrain worlds, in example, 2.000.000 of triangles and a texture compound by (in example) 40 images of high resolution. (10 Mpìxels)
But I'm going to have also little models, include alambric worlds with 1000 points or 50 lines with 100 points by line.

So, which is the best aproach for do it.
- Display lists ?
- Vertex buffers ?
- Vertex arrays ?

Which of those elements are stored at the GPU memory ?
How can I know the memory resources of the GPU ? ( size, capacity, etc )

I know that the answer can be 'depends of ...' but I wait you can answer me with some initial tips
Thanks
Advertisement
Forget about using Display Lists - they are deprecated now.

Vertex Arrays are reasonably easy to implement - however they reside in System Memory, not on the Graphics processor, the data is streamed to the GPU each frame. Vertex Buffer Objects do basically the same thing as Vertex Arrays however are resident on the GPU.

My suggestion would be to implement Vertex Arrays first, once you're happy with them, it's literally only a few other lines of code to create VBO's.

With regards to know the resources on the GPU, this isn't really your problem, it is up to the Driver to decide whether to move things off the GPU into System RAM, and I can guarantee it will do a better job than you at deciding this.

I would suggest that any dynamic data (that is changing regularly, either each frame, or a number of times a second) then use Vertex Array's for these. For anything that is guaranteed to be static for a decent amount of time (entire level, a number of minutes, etc) put these as VBO's on the GPU to avoid having to transfer unchanged data over the Bus each frame.

You might also want to looking into optimum sizes and formats for Vertex Arrays/VBO's. There are numerous articles floating around on the best size for these - I think the current philosophy is to make them about 1Mb-4Mb - so pack as much data into VA/VBO's of this size.

Hope this has helped.
Thank you very much. An easy an clear explanation
I have to disagree with AndyEsser in one point, use BufferObjects for everything they are always better then client VertexArrays. Only plus of VertxArrays is that they are a little bit easier to use, but this pro should be eliminated by writing some code which handles this more complicated stuff for u.

This topic is closed to new replies.

Advertisement