PDA

View Full Version : Perfomance question



frink
03-04-2002, 07:45 AM
I have a database that has tri-strips, triangles, quads, and polys. For each texture, I first draw all the triangles associated with the texture, then all the tri-strips associated with the texture, etc. Then, I go on to the next texture. Should my performance increase if I break up all the polys, quads, and tri-strips into triangles and only draw triangles. I would think this would be faster because I don't have to change states from tri-strips to quads to polys to triangles for every
texture, but I'm not seeing any improvement gains. Should I be seeing any performance improvement? What type of performance gain/loss should I see? Has anyone tried
this before?

jefftkd
03-04-2002, 07:59 AM
From what I understand this will speed you up dramatically. However, you will speed up even more if you were able to make them almost all strips and render that way.

Jeff

Shag
03-04-2002, 08:05 AM
I suspect that sending one poly (say 4 verts) is quicker than 2 tris (6 verts). You would need to send them as tri strips. This is more obvious when you consider the example of two polys (8 verts) vs tri strips (6 verts). This obviously assumes 4 sided polys.

jwatte
03-04-2002, 08:46 AM
When the question is "which is faster" then the answer is always "measure it".

Specifically, most hardware only deals with triangles (and possibly quads). If you're specifying polygons, then the driver will have to tesselate the polygons to triangles in software before sending them to the hardware -- clearly doing this once in your program and always drawing as triangles will measure as being faster.

Now, the next question is how you measure properly :-) (glFinish() helps here)

zeckensack
03-04-2002, 11:17 AM
If you switch textures around on single objects, you might want to try to merge textures. Eg if you have some biped model and use different textures for arms, legs, torso, head, put them all together in a single larger texture map. This will reduce texture switching overhead. The gains that can be had with this diminish with very complex geometry (ie when each arm is made up of 5000 faces, gains are minimal).

This may be purely academical, but it may work better drawing the fast geometry first, and then the individual triangles. Chances are that the strips and fans already occlude some of your tris and that these can be discarded faster on hardware with advanced depth culling.