Opengl 2.0 VertexArrayObject

I was reading through the opengl 2.0 white papers and I found very weird that when you create a VertexArrayObject you need to specify the type(GL_VERTEX_ARRAY, GL_NORMAL_ARRAY, etc…).

In my mind, data storage should be independant of the usage, because then you can create dynamic buffers, so the type of data stored in it might change over time.

You cannot do that with the current Opengl2.0 vertex array object. You are stuck with your type.

Also it has a different interface than normal opengl2.0 and opengl1.x vertex array or ATi’s object buffer extension.

//Opengl1.x vertex

glVertexPointer( …, vertices );

//Opengl2.0 vertex array

glVertexArrayPointer( GL_VERTEX_ARRAY, 3, GL_FLOAT, 0 , 32, vertices );

//Array object

handle = CreateArrayObject(GL_VERTEX_ARRAY, …);

glLoadVertexArrayData( handle, 0 , vertices )

//usage
glUseVertexArrayObject( handle );

//ati vertex arry

handle = glNewObjectBufferATI( 32, vertices, GL_DYNAMIC );

glArrayObjectATI(GL_VERTEX_ARRAY, …, handle, …)

The opengl2.0 vertex array object interfaces looks very similar to ATi’s objectBuffer, but in the ATi method, you pass the type at usage time.

Why the discrepency in the interfaces???

Anybody has comments on that? I wanted to email this concern to 3d Labs, but you need to sign and fax an agreement form and before doing that I wanted to get opinions of other people(an maybe 3dlabs people will read it too).

[This message has been edited by Gorg (edited 02-06-2002).]

First of all, you shouldn’t bump topics. Secondly, you shouldn’t bump them if they’re only 8 hours old.

In any case, The new interface (passing in an enum GL_VERTEX_ARRAY rather than calling a specific funtion) prevents the current state where extensions have to create entire new entry-points for every new type of vertex array that comes along. Both nVidia (with NV_vertex_program) and ATi (with EXT_vertex_shader) created a new varient of vertex arrays that takes an input that tells which array it really is. This is a good thing.

Originally posted by Korval:
First of all, you shouldn’t bump topics. Secondly, you shouldn’t bump them if they’re only 8 hours old.

You are right. To everyone : I am sorry about that.


In any case, The new interface (passing in an enum GL_VERTEX_ARRAY rather than calling a specific funtion) prevents the current state where extensions have to create entire new entry-points for every new type of vertex array that comes along. Both nVidia (with NV_vertex_program) and ATi (with EXT_vertex_shader) created a new varient of vertex arrays that takes an input that tells which array it really is. This is a good thing.

I see what you mean, but the entry points is not really my concern.

What I don’t like about their way is that when you create an object buffer you bind it’s type.Why?

Why can’t we just set it at usage time like it is right now?

it seems to me like this gives less flexibility because you cannot reuse this buffer and use as say a normal array, or texcoord array.

[This message has been edited by Gorg (edited 02-07-2002).]

Handling of Vertex Array objects has changed. The format of the data in the object is now assigned at use time. Also, there is now a way to define interleaved vertex array objects. New versions of the white papers should be on our website by next week. Stay tuned!

Barthold
3Dlabs

Great. Now it makes more sense

[This message has been edited by Gorg (edited 02-22-2002).]