Advertisement

Vertex arrays

Started by August 21, 2000 04:26 AM
15 comments, last by Danack 24 years, 3 months ago
Does anyone have a simple demo with source of how to do these ? I''ve seen the ones on nvidia''s website, but they''re not so easy to read.... cheers dan Game production: Good, quick, cheap: Choose two.
Game production:Good, quick, cheap: Choose two.
void main (){    Do_Vertex_Arrays ();} 


do what?
for god''s sake be specific
you can''t just DO vertex arrays

under what API?
in what context?
what do you actually want to do with vertex arrays?





[email=ehremo@hotmail.com][/email]
Advertisement
Why do you want source code when you can have documentation for free???In NEHE''s link section you''ll find a link to the red book.Follow it and check out chapter 2.You''ll find everything(almost...)you need about ver. arrays there.It''s nothing hard really...Hope this helps.

-=Jimmy=-
-=Jimmy=-

quote:
under what API?

Seeing as we're in an exclusively OpenGL forum, it shouldn't be too surprising that I want to use them in OpenGL.

quote:
for god's sake be specific what do you actually want to do with vertex arrays?


erm, use them to render models faster, which is the only thing they can be used for isn't it ?


quote:
In NEHE's link section you'll find a link to the red book. Follow it and check out chapter 2.


Thanks, that's perfect. I've only been using the Opengl SuperBible and they don't appear to be in there...



Edited by - Danack on August 21, 2000 6:01:15 AM
Game production:Good, quick, cheap: Choose two.
I''ve not a simple source code on ''Vertex Arrays'' but the OpenGL 1.1 specification has a little section about them.
I dont know where I''ve downloaded it (try on www.Opengl.org)

I''ve implemented them in my simple polygon renderer and...SURPRISE!!! They go slower (50%) than specifyng vertices individually !!!
I can get more speed (+20%) if I use Vertex Arrays with glCallList but if I use standard glVertex3f with glCallList I get the same result (+18%)

I use a voodoo 3000 and everything works well but not Vertex Arrays .
IpSeDiXiT
Have a look at my webpage for the _simplest_ tut you could wish for. There's a milkshape object loader on there too that shows them being used for something almost useful.

As for performance, welcome to the world of driver specific OpenGL...

Paul Groves
pauls opengl page
paul's opengl message board

Edited by - Pauly on August 21, 2000 4:12:20 PM
Paul Grovespauls opengl page
Advertisement
> I''ve implemented them in my simple polygon renderer and...SURPRISE!!! They go slower (50%) than specifyng vertices individually !!!

Uh yes, VA are a big joke. I spent one month in studying how they are working, their advantages and their drawbacks. My conclusion is summed up in this single line: they are usefull if you use the compiled VA extension, else you''d better use IM with triangle strips (and display lists for static geometry).

Y.
ive been working with vertex arrays a while now just done a couple of tests

this does a little test 8192 triangles in a small window cele433 + vanta

glLockArraysEXT(0, 9);
glTexCoordPointer(2,GL_FLOAT,0, &texcoord);
glVertexPointer(3, GL_FLOAT, 0, |);
glColorPointer(4, GL_FLOAT,0, &colours);
glDrawElements(GL_TRIANGLE_FAN, 10, GL_UNSIGNED_INT, &indices2);
glUnlockArraysEXT();
89.5 fps

glTexCoordPointer(2,GL_FLOAT,0, &texcoord);
glVertexPointer(3, GL_FLOAT, 0, |);
glColorPointer(4, GL_FLOAT,0, &colours);
glDrawElements(GL_TRIANGLE_FAN, 10, GL_UNSIGNED_INT, &indices2);
91.0fps

intermidiate
GL_TRIANGLE_FAN
48.fps
Vertex arrays are usefull for static and dynamic geometry.

Are you talking about Display list instead ?
DL are speeding up the rendering far more than VA.

But unfortunately DL can only be used for static geometry.
Or geometry you''ll use many times on a scene.

for example a wheel in a car game...

The best is still to learn from a good book, pick one :
-OpenGL Programming Guide (aka Red Book)
-OpenGL SuperBible

Good luck

-* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-
ok ... i spend more than 5 days on vertex arrays and nothin else ... here are my current experiences ...

btw ...zedzeek i think u got to do the Lock after u specified at least the vertexpointer or its kinda useless ... (im not an "advanced" ogl - programmer ... its just that i think its that way from the stuff i read)

Im doin tests with an array of ~40k triangles ... (no strips ...)

with a precompiled i get like 40 fps ... with a VA i get ~15 fps ... with standart for each vertex i get like 8 fps

But i think LockArrays isnt workin right with my drivers or im just too stupid or whatever .... (im using latest detonator drivers in win2k and i got a TNT2) ...

using LockArraysEXT gives me a performance boost of 0.5 FPS!!! WOW ... its a joke ... really ...

nvidea wrote another extension for ogl... a function called wglAllocMemoryNV (sp?) u can use it for allocating for your Vertex-arrays ... but i cant enable that extansion on my TNT 2 ... dont know if its just for geoforce ... but they "promise" it would be faster than display lists ....
(anyway its quite useless cause it just works on nvidia cards ...) --> if your interested look on www.nvidia.com in developers section ... in opengl-performance-FAQ u see a speed-comparison between the array-displaylist IM mode stuff ...

but im still lookin ...

This topic is closed to new replies.

Advertisement