Game Development Community

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.

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.


#1
03/09/2007 (8:39 am)
Whoops, two more places this bug appears, in AtlasClipMapBatcher::renderFog() and AtlasClipMapBatcher::renderDetail().
#2
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
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. :)
#4
03/10/2007 (1:59 am)
Ahhh cool, thanks Bryce!

addikt
#5
03/12/2007 (8:58 am)
Hi, yes that is what it does Bryce!!