What is a primitive exactly?
by Spencer Boomhower · in Torque Game Engine · 11/15/2006 (2:38 am) · 4 replies
We're starting to do some performance profiling on our game. On the TDN I found this page:
tdn.garagegames.com/wiki/TorqueScript_Console_Functions_2
I'm looking at the various values under "metrics(video);" and I see:
So, er... what's a primitive exactly? In general 3D graphics usage that word can mean all kinds of things. But I have a feeling that here it's something very specific.
Does a primitive have something to do with collision objects? Because that would be a useful metric to have, and if it's not a collision object then collision objects are noticeably absent from the list of things you can measure with these commands.
Any help would be greatly appreciated!
-Spencer
tdn.garagegames.com/wiki/TorqueScript_Console_Functions_2
I'm looking at the various values under "metrics(video);" and I see:
Quote:
TC: Total triangle count.
PC: Total primitive count.
So, er... what's a primitive exactly? In general 3D graphics usage that word can mean all kinds of things. But I have a feeling that here it's something very specific.
Does a primitive have something to do with collision objects? Because that would be a useful metric to have, and if it's not a collision object then collision objects are noticeably absent from the list of things you can measure with these commands.
Any help would be greatly appreciated!
-Spencer
#2
Then I opened the same object in the showtool, and saw that the tri count was 46 there, too. Then I turned on the tri-strip display, and counted the colored patches (I didn't see a stat for total tri strips or anything). There were 16 tri strips.
So that's good to know, I guess. I know that tri strips are hugely important to performance on the PS2, and I assume they're a big deal on video cards also.
I might add this bit of info to the TDN wiki, unless anyone has evidence to the contrary.
12/05/2006 (6:07 pm)
I think I figured it out, I'm pretty sure primitive = tri-strips. I isolated a DTS object in a test level and looked at the values it was returning in the metrics. 46 tris, 16 primitives. Then I opened the same object in the showtool, and saw that the tri count was 46 there, too. Then I turned on the tri-strip display, and counted the colored patches (I didn't see a stat for total tri strips or anything). There were 16 tri strips.
So that's good to know, I guess. I know that tri strips are hugely important to performance on the PS2, and I assume they're a big deal on video cards also.
I might add this bit of info to the TDN wiki, unless anyone has evidence to the contrary.
#3
12/05/2006 (7:10 pm)
The primitive count metric measures the number of times glDrawElements and glDrawArrays are called i.e. the number of draw calls. On newer cards, namely those with hardware transform and lighting, this number will affect performance more than the triangle count will.
#4
12/07/2006 (12:06 am)
Thanks for the info!
Torque 3D Owner Spencer Boomhower
Generally, the primitive count in the metrics display is a value lower than the triangle count, so I'm guessing a primitive is some grouping of triangles.
In 3ds Max a primitive is an object like a cube, sphere, or cylinder - a simple building block of tris, but one that's not as simple as tris themselves. That definition doesn't really fit DTS objects - they're more a collection of arbitrary geometry.
I'm thinking "primitive" might be the term for triangle strips. Better performance would be achieved by having a lower strip to triangle ratio, so it would make sense that tri strips would be mentioned in the metrics. So maybe tri strips = primitives.
If so, why doesn't it just say that?