Atlas bug
by John Carroll · in Torque Game Engine Advanced · 03/09/2007 (8:38 am) · 5 replies
Hi, we seem to have found two more bugs in the Atlas code. In atlasClipMapBatcher.cpp at or about line 394:
void AtlasClipMapBatcher::renderLight()
{
PROFILE_START(AtlasClipMapBatcher_renderLight);
// Get the lighting material.
Material *lightMat;
if(!Sim::findObject("AtlasDynamicLightingMaterial", lightMat))
{
Con::errorf("AtlasClipMapBatcher::renderLight - no material 'AtlasDynamicLightingMaterial' found, skipping light rendering and spamming the console.");
PROFILE_END(); // <<<<<<<<<<<<<<<<<<< ADD THIS LINE
return;
}
// Get the lighting mask material.
Material *lightMaskMat;
if(!Sim::findObject("AtlasDynamicLightingMaskMaterial", lightMaskMat))
{
Con::errorf("AtlasClipMapBatcher::renderLight - no material 'AtlasDynamicLightingMaskMaterial' found, skipping light rendering and spamming the console.");
PROFILE_END(); // <<<<<<<<<<<<<<<<<<<<<<<<< ADD THIS LINE
return;
}
The problem was that PROFILE_END() was not being called prior to leaving this routine.
void AtlasClipMapBatcher::renderLight()
{
PROFILE_START(AtlasClipMapBatcher_renderLight);
// Get the lighting material.
Material *lightMat;
if(!Sim::findObject("AtlasDynamicLightingMaterial", lightMat))
{
Con::errorf("AtlasClipMapBatcher::renderLight - no material 'AtlasDynamicLightingMaterial' found, skipping light rendering and spamming the console.");
PROFILE_END(); // <<<<<<<<<<<<<<<<<<< ADD THIS LINE
return;
}
// Get the lighting mask material.
Material *lightMaskMat;
if(!Sim::findObject("AtlasDynamicLightingMaskMaterial", lightMaskMat))
{
Con::errorf("AtlasClipMapBatcher::renderLight - no material 'AtlasDynamicLightingMaskMaterial' found, skipping light rendering and spamming the console.");
PROFILE_END(); // <<<<<<<<<<<<<<<<<<<<<<<<< ADD THIS LINE
return;
}
The problem was that PROFILE_END() was not being called prior to leaving this routine.
About the author
Working on using Torque as an Image Generator for Tactical Simulations under laser and live fire conditions, for Law Enforcement/Military applications.
#2
Edit: I've compiled and tested but don't notice any dramatic change...
addikt
03/09/2007 (12:47 pm)
Nice work John, is there any noticeable changes after applying this fix?Edit: I've compiled and tested but don't notice any dramatic change...
addikt
#3
What it does do, however, is if those shaders aren't found it prevents the game from locking up on you. :)
03/09/2007 (8:57 pm)
There wouldn't be any. The function is only called when the material requested isn't found in the ResourceManager.What it does do, however, is if those shaders aren't found it prevents the game from locking up on you. :)
#5
03/12/2007 (8:58 am)
Hi, yes that is what it does Bryce!!
John Carroll
Advanced Interactive Systems