Game Development Community

How to show poly count on screen?

by Jason Davis · in Torque Game Engine · 06/15/2006 (10:08 am) · 12 replies

To better optimize my levels, I want to know if there is someone out there who can tell me how I can track how many polys (or triangles) are displayed at any given moment at runtime. If anyone has an answer, I'm all ears!

I would like to show a number in the corner of the screen or something like this at runtime.

Thanks,
Jason

#1
06/15/2006 (10:53 am)
Hi Jason,

The easiest way to find out the total number (and a lot more) is to go to the console (~) and type these two statements . . .

GLEnableMetrics(true);

metrics(video);

I hope that helps.

Aaron E.
#2
06/15/2006 (10:56 am)
Oh, one more thing, you might want to check out common\client\metrics.cs for a list of goodies that are available.

And now that I think about it, you might want to change some of the codes -- like TC (under the video section) to an easier to understand description like "TriangleCount".
#3
06/17/2006 (7:47 am)
Thanks yet again, my friend. I will experiment with this tonight and see what I come up with... will keep you posted!

- Jason
#4
06/17/2006 (8:08 am)
Cool. I've got to say, the pace you're setting on PP is inspiring. And it looks like you've re-worked your website. Nice.
#5
06/21/2006 (8:48 am)
Thank you, Aaron. It is a real passion of mine, hard to do when working a full time job, watching my one year old, and managing a love life at the same time! LoL! But, I spend every ounce of energy I can on it, even to the sacrifice of eating or sleeping... my girlfriend says that PP is my "other woman" which she doesn't too much care for, LoL. Thank you for checking the site! :-)
#6
06/22/2006 (9:07 am)
Thanks I was needing this to.
#7
06/22/2006 (9:16 am)
Wow, where did you dig that command up from lol?
#8
06/22/2006 (10:46 am)
Allyn,

I first noticed the metrics stuff in the back of Ken's book (Appendix A). I didn't really understand the metrics info until recently, though. It takes a long time for things to sink in for me.

:)
#9
06/23/2006 (7:52 am)
Aaron:

Thanks, the metric stuff works great... I don't like using the console unless I just have to, so I wrapped the code you mentioned above in a function that I binded to a key stroke. It works great! Exactly what I was looking for!!! If you don't mind, though... can you explain what each field means in the string that appears? I can figure out triangle count, frames per second, etc... but I'm not so sure what the other info means. I would appreciate your input on this, my friend.

- Jason
#10
06/23/2006 (1:15 pm)
Jason,

I started writing an explanation for the codes and fields in metrics.cs, but I felt really inadequate about the attempt, especially considering this excellent TDN document . . .

tdn.garagegames.com/wiki/TorqueScript_Console_Functions_2

You can find the metrics stuff down near the bottom third of the page. All of my definitions/descriptions sound cheesy next to these. :)

However, if there's anything in that list that you're having trouble with, maybe I can help clarify some of them.

Aaron E.
#11
06/24/2006 (8:42 am)
Perfect! That was exactly what I was looking for! Thanks!!!
- Jason
#12
06/24/2006 (10:31 am)
N/p

:)