Skip to main content
gamedev.net
🔒 Locked

Vertex Array vs Compiled Vertex Array

Started by Daivuk 18 replies 2k views
Original Post
Daivuk
Daivuk
Vertex Array vs Compiled Vertex Array I need the difference between those two. Because in my engine i'm using vertex array, and its VERY fast. But I know that exist an extension (easy to implement) Compiled Vertex Array, ARB one i think. So, what is the difference? should i have to implement this to increase performance? Do i will have access to my float array anyway? thanks (and sorry for my poor english, from quebec :P)
silvermace
silvermace
EXT_compiled_vertex_array (CVA) is the name of the extension.

in its simplest form CVA's prevent the same verticies being transformed twice.

CVA's will only increase your performace if you are using multipass rendering techniques.

eg.
LockArrays
BindTexture 1
Render
BindTexture 2
Render
UnLockArrays

that example, the verticies send to the card from glDrawElements & glVertex/NormalPointer are only transformed 'at' the first Render call and are reused at the second one.

if CVA's are disabled, the verts are re-transformed (redundantly) at the second Render call.

you should implement them into your engine even if your not doing multipass rendering, you should simply have the facility to CVA (not necessarily use them though) because its so simple.

Hope that helps.

_the_phantom_
_the_phantom_
if you are using a software T&L system (TNT/TNT2/Mesa) then yes, it could cache the post-T&L vert data, however with a hardware T&L system I dont think it can get access to it, what its more likely to do is copy the data into faster ram and then on each pass which references it it can use that data instead of your Vertex Array.

As mentioned, this is only usefull for multipass and is pretty redundant on systems which support Vertex Buffer Objects, you'd be better off looking into them.
Daivuk
Daivuk
Ok, im doing multipass rendering
one for the texture, specular and bumpmap
So if I use compiled vertex array, they will compute the vertex only the first time?
thats cool
python_regious
python_regious
A couple of years ago I decided to try CVA for my multipass rendering. I found no increase in speed what so ever. Looking back, it's highly unlikely I was fillrate limited. Don't bother with the extension, it's depreciated, and just generally crap from my experience. Go with VBO/VAO/VAR instead.
If at first you don't succeed, redefine success.
_DarkWIng_
_DarkWIng_
Just like python_regious told you. Unles you have a card with no HW T&L (something like TNT) and you use multipass then don't even bother with this extension.
You should never let your fears become the boundaries of your dreams.
Daivuk
Daivuk
Ok, but I dont think its hard to implement CVA. So i will detect if he have the extension and use it in this case. Probably I will get an increase of .001 fps lol
But .001 fps its .001 fps, so thanks all ;)
python_regious
python_regious
One thing to bear in mind is that CVA is incompatible with VAR (and probably VBO). In other words, you can't use both.
If at first you don't succeed, redefine success.
_DarkWIng_
_DarkWIng_
And nobody is saying implementing CVA is hard. It's just pointless.
You should never let your fears become the boundaries of your dreams.
tomek_zielinski
tomek_zielinski
Hey!

There's somwhere paper at developer.nvidia.com abou differen;t rendering mehods.

It's been written there that CVA works only if you pass XYZ (probably color but I don't remeber...) and two sets of 2d tex coords. It's the only case they optimized the gl drivers for.

I'll try to find this paper...


EDIT: sorry, I couldn't find it - it was html faq, but probably was replaced by the new faq...
www.tmreality.com
tomek_zielinski
tomek_zielinski
One more thing:
it is like that because it was optimized for Quake II/III i think.
Take a look at Q2 GPLed sources and there you can see CVA in action.
www.tmreality.com
Daivuk
Daivuk
ok, I'll check it, I have the quakeII source.
But me its not for rendering a map. Its a space shooter, and I have high detailled Space ship with bump math and specular. So I need three pass. Its not lagging on my PC, but on a slower pc, it could lag. Thats why i'm just asking this to know if my vertex array method are ok or I need CVA to increase performances :P
hey, what is VBO/VAO/VAR ???
I guessed that CVA = compiled vertex array. lol
VAO = vertex array ..o..?
VBO ?
thanks
tomek_zielinski
tomek_zielinski
yes, CVA = compiled vertex array. lol
VAO = vertex array object?
VBO = vertex buffer object?
www.tmreality.com
_the_phantom_
_the_phantom_
quake2 and quake3 were both pre-HW T&L games thus they needed this extension to perform multipass rendering.

As stated with a HW T&L card this extension will offer no performance increase, the extra CPU work to setup the extension probably out weights any advantage given.

So, unless you are aimming to have the game run on TNT/TNT2 gfx cards (around 6 year old hardware) I'd forget about it and look into VBOs
python_regious
python_regious
Quote:
Original post by Daivuk
ok, I'll check it, I have the quakeII source.
But me its not for rendering a map. Its a space shooter, and I have high detailled Space ship with bump math and specular. So I need three pass. Its not lagging on my PC, but on a slower pc, it could lag. Thats why i'm just asking this to know if my vertex array method are ok or I need CVA to increase performances :P
hey, what is VBO/VAO/VAR ???
I guessed that CVA = compiled vertex array. lol
VAO = vertex array ..o..?
VBO ?
thanks


If you're doing bumpmapping, you must have a hardware T&L card, in which case CVA's are totally useless. They were only implemented because of John C anyway, and haven't been properly developed. It would be a total waste of time to use them.

VBO = Vertex Buffer Object ( ARB_vertex_buffer_object )
VAO = Vertex Array Object ( ATI_vertex_array_object - I think )
VAR = Vertex Array Range ( NV_vertex_array_range(2) )

These extensions basically allow you to put vertices and other data in AGP or video memory. Go with the VBO extension however, not only is it easier to use, but it's the standard. Only move to any of the other two if you have problems.
If at first you don't succeed, redefine success.
vincoof
vincoof
If your objects are static (ie don't morph over time) then just use display list and you should get optimal performance. Moreover you get very good compatibility with drivers for a long time (unlike VBO's that are pretty annoying to use on everyone's computer who never has the driver up to date, or simply doesn't have a hardware that supports VBO's).
Daivuk
Daivuk
I got a lower frame rate with display list... :S
And I prefer using vertex array, because I will probably implement a dynamic destruction of the ships.
Ok, so the way i did it its the right way. :P
vincoof
vincoof
Quote:
Original post by Daivuk
I got a lower frame rate with display list... :S

Sure not ;)
The only ways display list would be slower is :
- you recompile the list every frame,
- you get to use many many vertices (speak in tens of thousands)
- your driver and/or hardware is really, really badly optimized.

Quote:
Original post by DaivukAnd I prefer using vertex array, because I will probably implement a dynamic destruction of the ships.

Ok but then you can use display list for static objects and vertex arrays for dynamic ones. Many of the objects in your scene won't be destroyed :P


Quote:
Original post by Daivuk
Ok, so the way i did it its the right way. :P

Any "way" that don't use CVA is a "right way" since, as many pointed out, CVA is pointless today and will remain as is.
Daivuk
Daivuk
I used display list in many of my engines, and sure, for my models of thousen of vertices with bump mapping, vertex array run faster. And I have an Nvidia gforce4 ti 4400 with the lastest drivers. :P
And for my bumpmapping, I have to put my third pass in vertex shader to increase the speed. So i cant use display list ;)

Edit : And sur I'm not recompiling my display list avery frame :P
probably du to the number of vertices, and i want to modify them during the game. Hum, but I can do it in the vertex shader, humm. thanks anyway all!

Topic Locked

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

Sign in to reply to this topic.