vertex buffers vs immediate mode

Started by
9 comments, last by Promit 18 years, 10 months ago
vertex buffers vs immediate mode drawing what are the major practical advantages and disadvantages of using one style over the other? when are either appropriate? i have books to read about both, but they say little to the practical application of either technique. thanks guys!
Advertisement
I thinks the main diference is the speed of the technique. the vertex buffer is perhaps a litle more complex to use but he is a lot more fast. The immediate mode must send all the data by the video port (agp,PCI express) and the speed of processing of the GPU is superior to the bandwith of the port. so the GPU don't work at it's peek. You can want to use immediate mode for test, but dont use it in true application. The only exception i see (and it's not a true one) is if each vertex of an object move independently (morphing by example). But, with vertex programme, you can do advanced morphing. If you really need to send all the vertice, prefer a dynamic vbo I think.

--
Cédric
Sorry for the language, I am french and I havn't often to use english(for the moment so...)
Even for objects whose vertices undergo changes (morphing ones for example as mentioned), move the verts around in the application proper, upload the new updated vertex positions via a vertex array and render it like that.

*never* use immediate mode for anything but testing - it is horribly ineffecient.
better email john carmack then,
cause glColor4fv is the 6th most used gl command in doom3
indeed, immediate mode does have its uses, mostly for low poly things like GUIs when it comes to drawing and setting a sticky per-object state (such as a general colour) where a per-vertex array would be a waste of memory.

All the OGL functions have their place, you just have to learn when the right time to use them is [smile]
Il have to add one more thing.

The vertex buffers main advantage like said above is the use of Video Card memory which means better performance. The main disadvantage I think that it is not supported by old video cards, don't know exactly what cards are supported, maybe someone can find a list of supported cards.
i think _the_phantom_ sums it up best.

to say using vertex buffers is faster than immediate mode is simply untrue ...it depends on the situation ..for e.g, when rendering say a static mesh such as brute force terrain algo ...the fastest way to render that is with a display list using immediate mode, i have tried testing this ...the fastest method i found was using GL_TRIANGLE_STRIP, with the vertex buffer way i created a VBO for both the vertex buffer and indice buffer but the display list was still faster. Take away the display list and u all know what happens than, the vertex buffer way slays it ...obviouslly with dynamic situations vertex buffer way is faster
I was obviously talking about sending a bunch of glVertexX commands. A glColor4f here and there to set a 'sticky state' as _the_phantom calls it is certainly OK. there's no need to do anything fancy there.

The performance gains for something like a quad (for GUIs) from immediate mode to VARS or VBOs are negligible or non-existent.

As far as rendering your terrain, have you tried using a vertex array in a display list? display lists aren't immediate mode anyway, so the point doesn't hold anyway.

For any geometry of considerable complexity I advocate using vertex arrays or VBOs. Perhaps my statement of *never* was too strong...i should have said 90.43352% of the time don't use immediate.
Quote:Original post by Aeluned
As far as rendering your terrain, have you tried using a vertex array in a display list?

Since the needed data from enabled arrays is calculated and baked into the display list during the creation ... just like the regular operations during the 'compilation' of immediate mode... how would that change the display list performance in any way? o.O;
Lapse of judgement. It wouldn't.

This topic is closed to new replies.

Advertisement