Vertex Buffer Objects?

Started by elias4444, March 18, 2005, 17:25:56

Previous topic - Next topic

elias4444

I posted this on the javagaming forums while the lwjgl site was down, but since I never got a response, I figured I'd post it here:

I've been looking for a way to implement VBOs in lwjgl, but am having a hard time finding the right set/sequence of commands to use. Could someone please post a simple code segment, showing how to setup and draw a VBO? It would be greatly appreciated. I've been using Display Lists, but have come to realize that ATI does a poor job of supporting them (long live Nvidia!).

Thanks.

P.S. With VBOs, can you support a mixed polygon-type object/array? (i.e., something that has triangles, quads, AND polys in it) I was thinking I could specify GL_POLYGON in the drawelements command, but I wasn't sure how the function would determine where one face starts and the next one ends in the vertexpoints array.

P.P.S. Are VBOs really faster than Display Lists for static geometry?
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

elias4444

Boy I missed these forums! I just searched and found the following from Cas pertaining to the speed of VBOs vs Display Lists:

Quote
Actually display lists should really be the fastest way of drawing in OpenGL. They are stored serverside, actually on the card - whereas a VBO is typically going to be in AGP RAM, and that incurs a small penalty as it's got to stream the data to the card every frame.

The penalty is generally worth it though because you can change bits of the data dynamically every frame at little cost in a VBO. But a display list has to be destroyed and recreated in its entirety incurring far more overhead.

Blimey, and I haven't even upgraded the SPGL sprite engine to use VBOs yet! Maybe OrangyTang will do it for me :)

Cas :)

However, if someone would still be willing to give a code snippet on how to do VBOs, it would still be greatly appreciated (I just can't seem to find the right methods/objects to use to get it working).
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

tomb

Posted a response on JGF.

Btw, I think the data is stored on the the card if you use STATIC_DRAW. The speed might be similar, not that I've done any tests. I do know that drawing with vbo's have a fairly high overhead.

Fool Running

I've tried VBOs and noticed that the speed was indeed slower than display lists even when using STATIC_DRAW.  :?
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D