Want to try my demo?

Taking things apart: t2f_t2f_c4ub_v3f

//is there two textures because one is for base
//and the other for lightmap?
tf2 = texture 2 floats
tf2 = texture 2 floats
c4ub = color 4 unsigned bytes
v3f = vertex 3 floats

Where are the normals?

Whoa, I just looked at the red book. It apears that t2f_t2f_c4ub_v3f is only used for interleaved arrays.

I just found out that there are two bottlenecks in my model optomizers.

First the aligning(or welding) process is very slow.

Second the smoothing process is even slower.

I’ve taken out the aligning method from the 3ds loading routine so the programmer can have the choice to run it or not just before he saves his own file format.

I’ll upload the latest version later today so you guys can mess with it some more. It loads high poly models really quick now…but be aware that smoothing and aligning are very slow.

Hopefully I’ll have a lib ready for any of you interested in using the beta of my model library. A sample program using my lib will have to wait awhile though.

//loop through triangles: loop not shown
glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, VertexIndices[i]);

Do i understand it right, you do a glDrawElements for each Triangle ?
You get a large function call overhead with this, why not building one index list for the whole model, and then draw the complete model with one call to glDrawElements.

And did i understand it right, that t2f_t2f_c4ub_v3f is only optimized for interleaved arrays. because rendering with it works, but my colors are in a sepperate array.

Lars

lars, you just gave me an idea . I knew about that, but I just thought of something else to do too .

I originaly did that way so I could have more than one texture per object. My new idea is to just group the polygons with similar texture names together, and then send the groups through glDrawElements. It’ll require a process to group the polygons, but it should be worth it for sure.

With a model consisting 376 polys drawn 40 times I get 115 FPS with one single call to glDrawElements, and 87 FPS with nPolygon calls to glDrawElements.

You know what that means . That means I’m gonna optomize some more…muahahahaha. Time to put on my thinking cap. I’ll think about it at work tomorrow…shouldn’t be to hard grouping by texture name. One drawback may occur though. The polygons may be ordered a certain way, so if I know them out of order, it could eliminate any performance that was already there :/. You win some, you lose some.

[This message has been edited by WhatEver (edited 03-18-2001).]

Ok, i just tried the model with my own loader and viewer, of course it has optimized the model by smoothing some parts (don’t know if it smoothed the right way, don’t use the 3ds settings).
But it rendered with about 300 FPS, with texturing and one Vertex Light with my GF2MX on a 350 MHZ PII.
With your viewer i get 140 with uv, color and both.

I made two Screenshots and put them on my site
Textured Version :
http://userpage.fu-berlin.de/~larswo/parts2.jpg

Untextured Version :
http://userpage.fu-berlin.de/~larswo/parts2%20no%20texture.jpg

I hope it helps you

Lars

To do a more acurate test you’ll need to match the video res.

Let me zip up my latest creation, and then get the FPS from it…hold on.

All you need to do to get a comparable framerate is this:

-Render in Full Screen mode at 800x600x32

Oh yeah, dl the latest rm2.zip through the same link I provided for the original.

Can’t change the res in my utility, but my gameengine (which uses the same rendering background isn’t affected by resolution, it should be the same for my tool, cause my p2 350 is to weak, to sustain enough triangles, to kill the fillrate of my Geforce.

When i load your mesh into my game performance drops to 150 FPS, but there is much more overhead, because of Octree building Cockpit drawing and so on

Lars

250 FPS in all cases, so this should make rendering performance approximately aequivalent, cause my loading routine reduced the number of vertices, but i have some overhead thru windowing :slight_smile:

keep on the work.

Lars

If you’re loading the same model, and keeping the same order of polygons the 3ds file came with, then our routines should be equivilent, except for my multi call to glDrawElements.

Originally posted by Lars:
But it rendered with about 300 FPS, with texturing and one Vertex Light with my GF2MX on a 350 MHZ PII.
With your viewer i get 140 with uv, color and both.

How can WhatEver’s demo give 140 fps on your GF2MX when it runs at 1200 on my geforce 256?

Come on, framerate is not only based on the graphics board. There are a few more factors, including CPU speed for example.

I’m afraid an 800Mhz CPU hosting geforce DDR cannot be 10 times faster than a 350 with a geforce 2 mx. In fact in this case the CPU certainly makes very little difference, the geforce can do almost as well on a p2 266.
All his framerate are the same, vsync every second frame or something?

Originally posted by Lars:
And did i understand it right, that t2f_t2f_c4ub_v3f is only optimized for interleaved arrays. because rendering with it works, but my colors are in a sepperate array.
Lars

Are you really talking about Interleaved Arrays? According to the OGL 1.2.1 specification there is no corresponding (t2f_t2f_c4ub_v3f ) enumerant for glInteleaved Arrays. The format is actually optimized for using with CVA,
Alexei.

To the Framerate :
It depends, if he uses an format which is hardware accelerated, if not my cpu has many disadvantages. For example an PII doesn’t have SSE or 3dnow, that means all the Vector operations are very slow.
Also the 3dmark shows this too, everything that is done on the cpu slows down everything dramatically. Just means the the programm from may not utilize hardware tnl.

To the Format :
No i more think of VertexArrays in theyre baseform. the data can be interleaved there too, by putting it in the same memory block, and keeping everything together (vertex1,color1,uv1,vertex2,color2…)

I hope this is not necessary to gain hardware acceleration, cause it would be incompatible with my lighting engine at the moment.

Lars

[This message has been edited by Lars (edited 03-20-2001).]

Ok i just did a little test, and commented out all the drawing calls (from gllockarray to glunlockarray inclusive), and my framerate in my gameengine goes up from 52 to 54 FPS.

So if my CPU had to transform those approx. 3000 Vertices it would have gone up much more.

Lars