Metrics and Profiling
by Joe Sulewski · in General Discussion · 02/02/2005 (10:07 am) · 29 replies
I'm having a hard time with DTS objects using up a lot of system resources. They are simple objects with no collision detection.
So to see what's happening I tried to enter GLEnableMetrics(1); into the console and it says the function is not found. How do I get this function to work so I can see what's happening?
I ran the profiler and it says that TSShapeInstanceRender is using 57% of the time. So what's the best way to help figure out why my DTS objects are using so much resources?
I tried metrics(video); but you have to have GLEnableMetrics to work in order see all the values.
My DTS objects are all inside of an interior object that is well portalized. Do portals effect the rendering efficiency of DTS objects?
When I remove the interior I'm still getting about 18fps which is what I get with the interior. Without the dts objects I get about 60fps. Are DTS objects that inefficient to use? As I said, they are very simple objects and there are about 60 of them with only a few containing collision detection.
Any help in profiling would be greatly appreciated.
I'm on a dual 1ghz mac G4 with an ATI 9000 pro and 64mb of video ram.
Thanks for any pointers,
Joe
So to see what's happening I tried to enter GLEnableMetrics(1); into the console and it says the function is not found. How do I get this function to work so I can see what's happening?
I ran the profiler and it says that TSShapeInstanceRender is using 57% of the time. So what's the best way to help figure out why my DTS objects are using so much resources?
I tried metrics(video); but you have to have GLEnableMetrics to work in order see all the values.
My DTS objects are all inside of an interior object that is well portalized. Do portals effect the rendering efficiency of DTS objects?
When I remove the interior I'm still getting about 18fps which is what I get with the interior. Without the dts objects I get about 60fps. Are DTS objects that inefficient to use? As I said, they are very simple objects and there are about 60 of them with only a few containing collision detection.
Any help in profiling would be greatly appreciated.
I'm on a dual 1ghz mac G4 with an ATI 9000 pro and 64mb of video ram.
Thanks for any pointers,
Joe
About the author
#22
Here's what is really odd for me. Last night I went through each and every object and notice that the polygons where doubled sided in blender. So I checked it off and while I was at it, I double checked that there were no duplicate vertices or faces. Only a couple had duplicates vertices but all where flagged as double sided. Each object had half the number of faces they had before. I checked in the new Show tool pro before and after my changes. In essence this means that I effectively cut my polygon count in half.
With that change I only received an improvement of about 3 or 4 fps. Without the objects I get about 60 fps and with the objects I get about 19 which is means that I loose about 40 fps. After my change that reduces the poly count by a half I get about 22 fps.
So what can I deduce from this? Well if the complexity of the objects were causing the frame drop then halfing the complexity should give me half my frame rate back and I should see about 40fps. But I only get a slight increase. This allows me to deduce that either the objects are inherently bad as Erik suggested, or the system is spending more time traversing the scene graph then needed.
I'm tending to rule out the error with the model idea because last night I added the flagpole from the demo. I made it so my script adds the flag pole from the demo rather than the actual objects. The flagpole has about 240 polys and 70 flag poles where added to the scene. The objects it replaces have either 70 polys, or 150 polys. Which means that 70 flag poles far out weighs the number of polys then my original scene. With the 70 flag poles I get 19 fps. The same I would get with my normal objects.
Is there a way to find out where the problem is? It appears to me that this is a problem with the scene graph. Is there a way I can confirm this by seeing how long it takes to traverse the scene graph? Am I experiencing what needs optimizing in the Mac version of the product? I know 1.4 contains many Mac optimizations but I don't know what those optimizations address.
As a side point, my objects are added through script code, not from the mission file. Does adding objects through script effect the scene graph differently? I would imagine no and that it wouldn't matter but being new to Torque I don't know.
I'm hoping a Garage Gamer can help me out here.
02/03/2005 (12:48 pm)
Well at least that explains why us Mac people cann't run the metrics. Does anybody have any ideas as to how I can optimize my level so that I can show 70 rather simple dts objects?Here's what is really odd for me. Last night I went through each and every object and notice that the polygons where doubled sided in blender. So I checked it off and while I was at it, I double checked that there were no duplicate vertices or faces. Only a couple had duplicates vertices but all where flagged as double sided. Each object had half the number of faces they had before. I checked in the new Show tool pro before and after my changes. In essence this means that I effectively cut my polygon count in half.
With that change I only received an improvement of about 3 or 4 fps. Without the objects I get about 60 fps and with the objects I get about 19 which is means that I loose about 40 fps. After my change that reduces the poly count by a half I get about 22 fps.
So what can I deduce from this? Well if the complexity of the objects were causing the frame drop then halfing the complexity should give me half my frame rate back and I should see about 40fps. But I only get a slight increase. This allows me to deduce that either the objects are inherently bad as Erik suggested, or the system is spending more time traversing the scene graph then needed.
I'm tending to rule out the error with the model idea because last night I added the flagpole from the demo. I made it so my script adds the flag pole from the demo rather than the actual objects. The flagpole has about 240 polys and 70 flag poles where added to the scene. The objects it replaces have either 70 polys, or 150 polys. Which means that 70 flag poles far out weighs the number of polys then my original scene. With the 70 flag poles I get 19 fps. The same I would get with my normal objects.
Is there a way to find out where the problem is? It appears to me that this is a problem with the scene graph. Is there a way I can confirm this by seeing how long it takes to traverse the scene graph? Am I experiencing what needs optimizing in the Mac version of the product? I know 1.4 contains many Mac optimizations but I don't know what those optimizations address.
As a side point, my objects are added through script code, not from the mission file. Does adding objects through script effect the scene graph differently? I would imagine no and that it wouldn't matter but being new to Torque I don't know.
I'm hoping a Garage Gamer can help me out here.
#23
Edit: and as I thought about it, he was also drawing a large number of transparent faces. Does your frame rate go back up when you look away from a dense concentration of objects?
02/03/2005 (4:44 pm)
I have around 100 objects in a scene added through the .mis and don't experience a drop like this, as far as I can tell. I remember another person who had a similar problem now, and I suggested adding as much of the detail into 1 .dts as possible, to lower the number of scene graph entries. The problem with this method is that if the center of the object goes behind the player, the stuff the player can see will still get culled from view.Edit: and as I thought about it, he was also drawing a large number of transparent faces. Does your frame rate go back up when you look away from a dense concentration of objects?
#24
I did another test and created a simple box in Blender, textured it with simple small texture and exported it.
Show Tool Pro reports 12 detail polys
I have about 70 of them on the screen.
My frames per second without the boxes was about 64 fps
After I added them I get about 47 fps.
That's a loss of 17 fps to render 70 simple 12 poly boxes which is 840 polys. Now mind you that I can't see all the boxes. Many are inside my interior and hidden from view. There are only 20 maybe 21 boxes in view. So that's 240 polys in view and after culling you can probably cut that number in half to 120.
When I switch to third person and make the player visible it drops about 2 frames per second.
As a final test I added very complicated object that has 2256 polys as per show tool and it drops to 52 frames per second. This means that one object with almost three times the polys as the combined total of the little objects has a better frame rate.
Something is wrong. Very wrong. Is there anybody who can help me make sense of this?
Thanks for any help or pointers.
Joe
02/03/2005 (6:12 pm)
Thanks for the tip David. I do do that where I can but as you pointed out, I can't do that everywhere for obvious reasons.I did another test and created a simple box in Blender, textured it with simple small texture and exported it.
Show Tool Pro reports 12 detail polys
I have about 70 of them on the screen.
My frames per second without the boxes was about 64 fps
After I added them I get about 47 fps.
That's a loss of 17 fps to render 70 simple 12 poly boxes which is 840 polys. Now mind you that I can't see all the boxes. Many are inside my interior and hidden from view. There are only 20 maybe 21 boxes in view. So that's 240 polys in view and after culling you can probably cut that number in half to 120.
When I switch to third person and make the player visible it drops about 2 frames per second.
As a final test I added very complicated object that has 2256 polys as per show tool and it drops to 52 frames per second. This means that one object with almost three times the polys as the combined total of the little objects has a better frame rate.
Something is wrong. Very wrong. Is there anybody who can help me make sense of this?
Thanks for any help or pointers.
Joe
#25
Unfortunately I am not a real programmer, and I can't say for sure, but I think my build has been optimized a bit, since we are not going to be using multiplayer at all, most of the prediction/packet type things have been removed or maxed out since we don't need them.
I know there is alot of stuff that can be done to tweak performance, and this is *definitely* somethign I would patiently try to get help with in IRC.
Sorry I couldn't help you more. What you are trying to do *is* possible; just need to figure out some error that is going on here.
02/04/2005 (7:36 am)
It definitely seems like its the scenegraph. I'm now wondering if the other person was running a macintosh as well, though I'm not sure if that would have anything to do with it.Unfortunately I am not a real programmer, and I can't say for sure, but I think my build has been optimized a bit, since we are not going to be using multiplayer at all, most of the prediction/packet type things have been removed or maxed out since we don't need them.
I know there is alot of stuff that can be done to tweak performance, and this is *definitely* somethign I would patiently try to get help with in IRC.
Sorry I couldn't help you more. What you are trying to do *is* possible; just need to figure out some error that is going on here.
#26
Sascha
02/04/2005 (8:31 am)
Try to enable the $pref::TS::UseTriangles = "1"; (default is "0") It's in ~/client/prefs.cs . I get a much better performance if it is enabled. In normal not too fancy interiors i get 240-320fps if I disable it I get 190 - 250fps. (P4 2.533, Radeon9600PRO 256MB, 512MB RAM). I use metrics(fps); in the console to show the FPS.Sascha
#27
I doubled checked the profiler and added my own profile stops to the source and determined that the time is indeed spend drawing the elements with the glDrawElements function. I'm wondering if this is a problem with the Mac implementation.
Sascha,
Thanks for the suggestion. I tried it out along with some other values in the properties and it made no difference. It's definetly with the glDrawElement function and I'm now scouring the internet to figure out what's wrong.
I'm wondering if this is the wrong area to post the question. As a licensed owner I wonder if I should post in the private areas. I always forget about the difference.
02/04/2005 (10:37 am)
David,I doubled checked the profiler and added my own profile stops to the source and determined that the time is indeed spend drawing the elements with the glDrawElements function. I'm wondering if this is a problem with the Mac implementation.
Sascha,
Thanks for the suggestion. I tried it out along with some other values in the properties and it made no difference. It's definetly with the glDrawElement function and I'm now scouring the internet to figure out what's wrong.
I'm wondering if this is the wrong area to post the question. As a licensed owner I wonder if I should post in the private areas. I always forget about the difference.
#28
02/04/2005 (12:11 pm)
You'll probably get better/more directed help there and in IRC. The coders lurk there, and you're more likely to find someone who knows about bugs or uniqueness in the different APIs and implementations. : )
#29
02/05/2005 (6:59 pm)
Joe, I responded to this question in your thread in the private forums, here: http://www.garagegames.com/mg/forums/result.thread.php?qt=25716 Think I know what the problem is and proposed a solution. Let me know how it goes by replying in that thread and I'm pretty sure we'll work this one out. :)
Torque Owner Erik Madison