Mission lighting profiling
by John Cooney · in · 01/03/2005 (4:18 pm) · 3 replies
Many of my levels are loading rather slowly and I'm examining the various potential causes of the slow down. Although the mission lighting is cached, I often wonder if the extremely long time lighting a particular interior (sometimes a minute or more on a fast machine!) is an indication of a problem with a model or something. Unfortunately, not enough information is given for me to figure out what specific object is being lit. From what I can tell (and perhaps I am wrong) it is in the lighting pack code that this is being printed:
= interior lit in 4.223 seconds
Is there anything I can add to the source so it will display the name of the object (filename, Torque object name, whatever) that is currently being lit so I can use this for debugging?
= interior lit in 4.223 seconds
Is there anything I can add to the source so it will display the name of the object (filename, Torque object name, whatever) that is currently being lit so I can use this for debugging?
#2
Thanks for your reply. We've checked out the modeler's guide and have found it useful. However, that does not help on models we already have or have acquired from other sources. Again, like I mentioned above, there are some interiors that take and extra long time to light. To me, this would indicate a problem with the interior model. In some of our levels where we are seeing this, we have 50+ objects that are being lighted, so it is near impossible to examine each and every item, piece by piece, until we find the offending one.
Thus, I ask this, hopefully a bit more clearly this time. Is there any way in the lighting stage that I mentioned above to have the engine tell me which particular interior that it is currently lighting so as to help me track down the problem interiors? I've tried looking at the code and there is nothing immediately obvious to grab that necessary information.
Hope this is a bit clearer. I will note that this slowness is only upon lighting the mission. When we used the cached lighting files, things seem to load fine.
Thanks!
01/24/2005 (11:04 am)
John,Thanks for your reply. We've checked out the modeler's guide and have found it useful. However, that does not help on models we already have or have acquired from other sources. Again, like I mentioned above, there are some interiors that take and extra long time to light. To me, this would indicate a problem with the interior model. In some of our levels where we are seeing this, we have 50+ objects that are being lighted, so it is near impossible to examine each and every item, piece by piece, until we find the offending one.
Thus, I ask this, hopefully a bit more clearly this time. Is there any way in the lighting stage that I mentioned above to have the engine tell me which particular interior that it is currently lighting so as to help me track down the problem interiors? I've tried looking at the code and there is nothing immediately obvious to grab that necessary information.
Hope this is a bit clearer. I will note that this slowness is only upon lighting the mission. When we used the cached lighting files, things seem to load fine.
Thanks!
#3
Check out the class InteriorInstance, it contains the interior filename. You can make that member public and then write it to the console in SceneLighting::InteriorProxy::light to see which interior is currently being lit.
-John
01/25/2005 (6:16 am)
Hi John,Check out the class InteriorInstance, it contains the interior filename. You can make that member public and then write it to the console in SceneLighting::InteriorProxy::light to see which interior is currently being lit.
-John
Torque Owner John Kabus (BobTheCBuilder)
= terrain lit in 0.301 seconds (sg) = interior lit in 1.272 seconds (sg) = terrain lit in 0.310 seconds (sg) = interior lit in 1.352 seconds (sg) = terrain lit in 0.311 seconds (sg) = interior lit in 1.362 seconds (sg) = terrain lit in 1.442 seconds (sg) = interior lit in 3.044 seconds (sg) = terrain lit in 0.611 seconds = interior lit in 1.062 seconds Scene lit in 12.058 secondsThe '(sg)' lines are from the Lighting Pack and the others are from the stock scene lighting (the sun).
These only occur during a relight, if the lighting is cached and a mission is still taking a long time to load it may be related to the complexity of an interior or DTS object.
If the long loads only happen on relighting check out the Modeler's Guide (section 'Performance Considerations ') for tips on resolving this. The main tips you'll want to try are:
-Always work with a release build of Torque
-Use smaller interior light maps when developing missions (by changing the map's lighting scale)
-Use the Light Editor's Filtered Relight when developing missions
-Mix mission and map lights
-Package the cached mission lighting files into demos and releases (avoiding the initial relight for the user)
But make sure to check out the Modeler's Guide it has a lot of other hints too.
-John