Game Development Community

Glow bug with dynamic interior lights

by Tom Spilman · in Torque Game Engine Advanced · 03/19/2007 (11:37 am) · 3 replies

Just found and fixed a bug with dynamic lights on interiors and the glow buffer.

What was happening is that every time a projectile with a light associated with it was fired, all the glowing surfaces would stop glowing until the dynamic light went away. I tracked the issue to the special RIT_InteriorDynamicLighting render instance which i figure renders the interior surfaces a second time with the light effect. Since it was happening after the normal interior rendering and both were stuck into the glow buffer, the second call was in effect clearing out the glowing surfaces.

The fix is to RenderInstManager::addInst()...

if( inst->matInst->hasGlow() && 
         !gClientSceneGraph->isReflectPass() &&
         !inst->obj &&
         inst->type != RIT_InteriorDynamicLighting ) // ADDED THIS CHECK!
      {
         mRenderBins[ Glow ]->addElement( inst );
      }

And now it works.

About the author

Tom is a programmer and co-owner of Sickhead Games, LLC.


#1
03/19/2007 (2:18 pm)
Thanks Tom, good find ;)

addikt
#2
03/23/2007 (1:34 pm)
Cool Tom - noted.
#3
03/26/2007 (3:03 pm)
Thanks Tom, should be out in 1.01.