polygon processing

Own opengl demos seems to be impossible to reach the speed of commercial games, one thing that is slow if done using basic opengl stuff is polygon processing; commercial games seems to have no troubles to render detailed models with few passes, but if I render my own scene, even a small cound will be slow, if there’s other kind of game stuff also.

So I have heard that quake2 used MMX and SSE (no clue what that is) intructions somehow to speed up polygon processing, but now days the processing can be done in GPU, is that true? Is GPU processing faster than SSE intructions? And finally, how can I do polygon processing in GPU?

Do a search in this forum for GL_NV_vertex_array_range and GL_EXT_vertex_object.

Also, using LockArraysEXT might help, but not as much.

Actually, doing a search on this forum for “render faster” might give you what you need, too.

Can I move polygon processing to GPU by rendering vertex arrays using GL_NV_vertex_array_range and GL_EXT_vertex_object? If so, is the memory for arrays allocated with special extensions from video memory? How much faster is this kind of rendering than using just glBegin() and glEnd?

I read a paper from nVidia and it told that on gf2 gts 180 000 polygon mesh rendered at 39fps while using those extensions and witehout at 25fps; eventually not so big performance improvement, but it’s something. And I belive those polygons were not texturemapped, but they were lit.

So, is it better to use those extensions to process polygons in GPU than just using the instructions quake2 used (just for example)?

Use the VAR extension if you have a nvidia card or GL_ATI_vertex_array_object for a ATI card. It is a lot faster than glBegin()/glEnd() pair, faster than simple vertex array or CVA. And in fact those extensions don’t deal with vertices processing, but vertices storage. There are used to put your vertices data in AGP or video memory. Actually, a good CPU now can process vertices at near equal speed than a modern 3d card, so my advice (not the best) is to use gl_arb_vertex_program, if your gpu support this extension, it will be done in hardware else in software (that’s pretty quick unlike texture program emulation), this way your engine will be well optimized for different hardware.


My mx doesn’t support gl_arb_vertex_program, but it supports gl_nv_vertex_program. Is there a big difference?
Could you explain that extension more specificly?

Your GF2MX do support the gl_arb_vertex_program with the lastest driver from nvidia (from now the beta detonator 40.41). There are some difference in syntax between the two extensions (check the spec http://oss.sgi.com/projects/ogl-sample/registry/ ) but you should use the arb since your application will run on computer with an ATI card as well as nvidia stuff.


So how do I process my polygons with gl_arb_vertex_program?

vertex_program is something completly different!

if youre having troubles to ‘push’ the number of polygons of quake2 (ie bugger all) at a reasonable speed with a gf2mx then something major is up.
A/ check the faq
B/ perhaps u have no hardware acceleration
C/ perhaps your fillrate limited

I just want to optimize vertex processing, becouse polygons are not all there’s in engine that drops framerate, so speeding up polygon processing would bring at least some speed. And I found out that polygon processing is fastest if it is moved to GPU, and my question is how? Which extension(s) and how?

BTW, Currently I’m rendering my models using glbegin and glend, so I just have to have a single temporary vector where I calculate the animated vertex after calculating the final matrix for it and then I send it to opengl. This is slow ofcource, so should I create a second set of arrays for vertices, normals, texcoords and indices and then calculate them into the arrays and then render using CVA or similiar (VAR?)

How many polys are you talking about 100, 1000, 10000? Also it sounds like you are doing a lot of cpu calculations before send the data to opengl. If you are using temp vectors then why not have opengl do the transformation for you?