PDA

View Full Version : Optimizations



jefftkd
02-01-2002, 08:07 AM
Okay, my engine is nearing beta stages and works fine (on my system anyways) =) and I'd like to begin some optimizations.

However, I can't find in any books or online anywhere what is faster between these drawing types:

GL_TRIANGLES (once and every facet is 3 points)

or (if I want facets of variable point sizes)

GL_TRIANGLE_STRIP vs. GL_POLYGON
GL_TRIANGLE_STRIP vs. GL_QUAD_STRIP
GL_TRIANGLE_STRIP vs. GL_QUADS (for 4 vertex facets)

Thanks!
Jeff

Dakeyras
02-01-2002, 08:34 AM
From the NVIDIA OpenGL Performace FAQ v2:
From Fastest to Slowest:

GL_TRIANGLE_STRIP
GL_TRIANGLE_FAN
GL_QUAD_STRIP
These maximize reuse of the vertices shared within a given graphics primitive, and are all similarly fast.

GL_TRIANGLES
GL_QUADS
These aggregate (potentially multiple) disjoint triangles and quads, and amortize function overhead over multiple primitives.

GL_POLYGON
A bit slower than the independent triangles and quads.


Hope it helps. You can find the whole document on nvidia's site, or in their NVSDK/docs/faqs

Overmind
02-01-2002, 09:05 AM
Actually triangle strip and quad strip is exactly the same because the hardware makes two triangles out of every quad you draw. Just think about it: You can exchange every GL_QUAD_STRIP in your program with GL_TRIANGLE_STRIP without changing anything else and the result won't change.

lobstah
02-01-2002, 09:35 AM
Except may be texture coordinates.

I found out the disappointing way.

lobstah...

Lev
02-01-2002, 10:28 AM
Only optimise if you know what the bottleneck is. If you're fillrate limited it won't bring much to optimise geometry throughput.

Get a decent profiler to find out what parts of *your* code are slow, ten optimise them.

Without a profiler, you can basically forget about optimizing. I prefer NuMega Boundschecker (although I don't have it now, used to work with it 2 years ago - this program rocks!)

-Lev

knackered
02-01-2002, 10:45 AM
I found BoundsChecker utterly useless as a...bounds checker - didn't realise it was a profiler too.
The best profiler on the PC platform is vtune by intel, without question.

Lev
02-01-2002, 11:03 AM
oops sorry of course I didn't mean boundschecker, stupid me.

I meant TrueTime, the *best* profiler, yeah even better than vtune - also from NuMega (thats why I confused it with Boundschecker)

-Lev

BTW Boundschecker is everything but not useless!

Nutty
02-01-2002, 12:58 PM
I've used boundschecker before, and found it brill. Takes some understanding to use it properly.

knackered
02-01-2002, 02:29 PM
I got an evaluation version a couple of months ago of the latest version of boundschecker - it's full of bugs - not what you need when debugging code!
Anyway, I didn't use the truetime thing, as I'm too used to vtune, maybe I should give it a chance, but I find vtune really useful.

zed
02-01-2002, 10:59 PM
OT but are any of these profiler programs free?
if so which ones?

Lev
02-02-2002, 12:14 AM
None of there profilers is free, but there is an evaluation version of VTune availavle on inter's website.

-Lev

julius
02-02-2002, 03:39 AM
Hey Zed, check out AMD CodeAnalyst, at http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_3604,00.html

that ones is freely downloadable.