PDA

View Full Version : vertex arrays



Aragorn
04-23-2002, 08:30 AM
This may seem like a stupid question but may I change the values of an vertexarray after setting it with glVertexPointer ? I mean will OpenGL take the data from the lokation the pointer from glVertexPointer is pointing to, everytime I call glDrawArrays (or any other draw command) or will OpenGL make a copy some where else (maybe in video memory) and changes in the original array will have no results until I reset the pointer.
And if OpenGL always takes the values from cpu memory isn't there a way to tell OpenGL that the data won't change and that it can be hold in some better location?

Thank you for your help.

epajarre
04-23-2002, 09:03 AM
If you just use vertex arrays the data will be fetched from the arrays at the point where the drawing command is done.

If you want to tell OpenGL that it may
copy the data to a "better place" use the compiled_vertex_array extension. Alternatively
you might look at vendor specific extensions, like Nvidia vertex_array_range for best performace

Eero

Rob The Bloke
04-23-2002, 09:30 AM
The vertex pointer is a memory location. OpenGL will read directly from it. It will not copy it due to it not knowing how much data is held after the pointer location.

If the data doesn't need to be changed, then you can use compiled vertex arrays to allow openGL to store it more efficiently. There are also things like Var available on the nvidia cards that increase the speed slightly more.