Skip to main content
gamedev.net
🔒 Locked

Difference between vertex_array and compiled_vertex_array

Started by SporadicFire Jun 12, 2002 at 9:50 PM 3 replies 400+ views
Original Post
SporadicFire
SporadicFire
I was wondering what is the difference between vertex_array and compiled_vertex_array and is compile one any faster?
python_regious
python_regious
CVA''s prevent multiple transforms of the same vertices. Thats it.

Take this example, you need to render the same object several times, in a multipass fashion... Using standard vertex arrays, every vertex in the model is transformed at each pass ( and even more times if vertices are shared between glDrawElements calls ), which slows it all down. By Locking the array before rendering, the vertices are only transformed ONCE, and not in every glDrawElements call.

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
SporadicFire
SporadicFire
thanx,

There are the locking functions in the compiled_vertex_array extension, which allow the array to get compiled...

when exactly do you use them for optimal results?
python_regious
python_regious
Depends what you''re doing...

For instance, say you are rendering a model several times, in a multipass rendering loop ( for whatever reason )... you could do something like:

LockArray( model_data )
RenderModel()
Change properties
RenderModel()
UnlockArray()


Also, say you have a terrain, and your rendering it using several triange strips, you''ll have duplicate vertices between the triangle strips, and so they''ll get transformed twice.. To prevent this, lock the entire array before hand, then call the individual glDrawElements calls for each of the strips.


Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.