Max Polygons?

Questions and answers about the how and why of making maps.
Post Reply
User avatar
Branton
Private First Class
Private First Class
Posts: 18
Joined: Tue Apr 08, 2008 1:50 am

Max Polygons?

Post by Branton »

Ok, so I am making a map, a couple of you have seen it, and suggested I needed more objects in the mid section so I’ve rendered up a few meshes and I’m beginning to wonder, how many faces of a mesh is to many? And how many total polygons/faces for the map is to many and likely to cause performance issues? I’ve got one mesh with about 7K faces. Others are less, but total around 10K now. Is this going to start causing performance issues? Does anyone have a good feeling for a reasonable max for today's hardware? I would like to put at least a dozen more objects, for a total of perhaps 20K mesh faces.

Thanks
Branton
User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1405
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom

Re: Max Polygons?

Post by Spazzy McGee »

It's entirely dependent on lots of things other than a simple polycount. There are a few tricks you can pull to speed things up. I'd say 20k will run alright, just. But you can probably find ways to reduce that - I doubt that's 20k USEFUL faces.

You might want to look a using Drawinfo and LODs to speed things up.
"Life is what happens to you while you're busy making other plans." - John Lennon
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1054
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

size/number ratio

Post by optic delusion »

I've done some work on this. The FPS numbers I use here are only relevant to my machine, an early 2006 intel iMac. I used my highest screen resolution 1680 by 1050, millions of colors. It should be noted that more players than you might think use very old hardware to play BZFlag, as it's the best game they can get to work on it. BZFlagV3 will not be kind to dinosaur equipment.

Use keys T and Y to see your Frames Per Second (FPS), Triangle count (TRIS), and MilliSecond-per-frame time (MS).
FPS is greatly affected by whether you are looking at the object, or looking away from it. The displayed FPS is an average over time, so you have to keep looking at it for several (5?) seconds to get a true reading. What I do is get my tank in the corner of the map and look at the center of the map, then quickly turn left-right-left-right for a few seconds. This gives a true representation of FPS a player may experience during play.
The displayed "TRIS" number is a count of how many triangles are being drawn in the 3D view, not counting the radar and other HUD elements, as the triangle count is a collection of the scene node counts. There is also an "rtris" if you have the radar mode set to Fast. Tris numbers should not be considered highly accurate.

Using texcoords and multiple textures seemed to have little if any affect on FPS. You get a lot of bang for very little buck using textures.
My mac seems to be fastest with the "linear mipmap linear" setting. Mac laptops seem to get a huge boost with this setting due to their lack of a GPU. I've a feeling that this is fastest for linux as well, but don't know about windows. Windows has the anisotropic setting that i have never used.

One thing that will quickly kill FPS is objects with very large faces. A single wall going all the way across the map should be divided into many smaller faces. I tested with 480 copies of a box, size 50 50 10 (six faces), and a mesh of the same size segmented into 140 faces, and found the segmented mesh to be 30 percent faster. There are several reasons for this, backface culling, collision management, etc. The math progresses exponentially, a face twice as large requires a squared amount of calculations. I *think* large horizontal faces are worse than large vertical faces.
It is generally preferable to triangulate your mesh as a final step before exporting to bzw. BZFLag draws triangles much faster than quads or other polygon shapes. You can work in your 3-D editor with quads or whatever shapes you like, and triangulate it just before exporting. In Wings3D the export function has a tesselation checkbox which is very useful if you don't want to save over and lose your un-triangulated mesh.

I tested meshes, I did not test bzw V2.0 objects like box and arc.
When testing meshes, I used a single, triangulated, complex mesh and placed it in the center of the map. Looking directly at the object my FPS stayed at around 100 until i used an object with over 30,000 faces. As i increased the complexity of the object, FPS went down, until at around 100,000 faces I reached what i consider the lowest limit of playability, 16 FPS.
I would say that playability begins to decrease at 30,000 triangles, becomes low at 70,000, and un-playable at 100,000. (on my machine with highest possible screen settings)
If i was going to use several complex objects... It seems like 3000 tris is magic number for me..
To use a a few dozen complex objects, I'd keep each one around 500-700 tris.

Drawinfo is another matter. With pure drawinfo (no bounding geometry) MS is 2/3 of a normal mesh. If I could ever get a tri-stripper to work, I beleive that MS would be close to 1/3 of normal. I never did figure out how to use drawinfo lod, sphere, and extents to their full potential, and could still use a few pointers on my drawinfo technique.

In conclusion....
Many factors are in play here. Perhaps a better question to ask would be....
How do I balance the size of triangles with their total number to provide the smoothest game play?



P.S.
Who can get a tristripper to work? I have a working tristripper, but it loses all the material groups in the conversion.
Last edited by optic delusion on Sat Jan 03, 2009 5:21 pm, edited 2 times in total.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.
User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1405
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom

Re: Max Polygons?

Post by Spazzy McGee »

A word on the drawinfoing.

A while back I made a map called map The Juggernaut, which was very graphics intensive. I managed to increase the frame rate significantly by using LODs to simplify distant objects - this is used especially for in the large containers, and the rungs of the ladder going up the ship's tower. If you move toward and away from them in observer mode, you can see the effect. The collision on the containers are a very simple invisible cuboid. All of the textures and detail is drawinfo and LODded to decrease in polycount at a distance.

Another thing we found was that adding 'noculling' to your invisible material (if you have one) noticeably increased FPS.

We (myself, delusion and tedius) did a few other things a the time, which I can't quite remember.
"Life is what happens to you while you're busy making other plans." - John Lennon
User avatar
Branton
Private First Class
Private First Class
Posts: 18
Joined: Tue Apr 08, 2008 1:50 am

Re: Max Polygons?

Post by Branton »

Thanks for the great replies. I noticed my FPS dropped to around 15 when looking at my mesh with the most faces. (On a vista laptop with a silly Intel gfx card). I'll look at the Drawinfo & LOD and see what I can do.

Thanks!
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1054
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Re: Max Polygons?

Post by optic delusion »

Just for fun this morning I made a quick map that has 11,000 semi-large faces, and tried it with BZFlag 2.99 and 2.0.10

2.0.10 77 FPS
2.99 110 FPS
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.
Post Reply