PDA

View Full Version : Vertex Buffer Extension

binary_bandit
03-25-2005, 01:37 AM
Hiya,

Im generating vertex information "on the fly" for a science simulation using GL_TRIANGLES (can't use strips - i know how much it would increase performance, but anyway)

I plot each of the vertices to generate these triangles in the standard way (3 x glVertex3f())

However, due to the nature of my work I need to also be able to alter these vertices without replotting the entire thing.

Ive read about the Vertex buffer extension ([1], [2]), and I think that perhaps this is the way forward? Ideally being able to manipulate the data on the graphics card would be ideal! The references I provided werent really that clear for my petty mind and I cant see how i'd go from my

glBegin(GL_TRIANGLES);
glVertex3f( a1, a2, a3);
glVertex3f( b1, b2, b3);
glVertex3f( c1, c2, c3);
glEnd();To using the Vertex buffer extension and then being able to come along and say I want to alter the 12th vertex plotted to d1, d2, and d3.

Im a bit stuck as you can probably tell, would appreciate any clues or help :-)

David

References
**********

[1] - http://steinsoft.net/index.php?site=Programming/Code%20Snippets/OpenGL/no11

[2] - http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=45

jide
03-25-2005, 02:33 AM
Try to have a look at VBO instead of VBE. There is a way for dynamic vertex data. Just make a search on this website and you'll find all the necessary documentation. Also avoid using glBegin(...) but prefer using vertex arrays. They are faster.

Hope this helps.

binary_bandit
03-25-2005, 09:30 AM
So do I first need to ship my vertexs into normal memory with normal C, and then move it into AGP using VBO and free the stuff in normal memory?

Is there no way to put it there straight away? ive just read the ARB on this, and it seems to suggest the way i say above?

So how do I then go about accessing the VBO's and changing them? thats the bit im stuck on.

Thank you, im most grateful :-)

David