Game Development Community

Found a bug in the scene lighting...

by John Kabus (BobTheCBuilder) · in Torque Game Engine · 09/21/2003 (12:40 pm) · 4 replies

Found a bug in the scene lighting in:

void InteriorProxy::light(LightInfo * light)

The following lines are reversed (aproximatly line 1845 (originally wrong line number, sorry for the confusion)):

transform.mulP(start);
start.convolve(scale);

Should be:

start.convolve(scale);
transform.mulP(start);

The lighting will currently work fine for a scaled interior or translated/rotated interior, but not both. The current code prevents Torque from finding the correct illuminated area per lexel. This change will resolve the issue.

John Kabus.

#1
09/21/2003 (7:34 pm)
While I'm here I noticed another bug I didn't get the chance to track down. The lighting calculated by scene lighting only works when the lighting scale (in the compiled map file) is set to 32, any thing else gives the light mapping code a bad world space starting point (curPos in the code).

It looks like either map2dif is messing up the texture transform/vector info (unlikely seeing how the map2dif light maps look fine) or scene lighting is not taking the scale into effect properly.

I was wondering if anyone could verify this and/or has run across this before.

John Kabus.
#2
09/21/2003 (7:40 pm)
By the way, you can test for the problem by creating an interior that's a box with a small door. When scene lighting adds in the sun's lighting all walls facing the sun are lit regardless of what other objects/walls/interiors/terrain maybe around to cast shadows.

John Kabus.
#3
09/22/2003 (7:59 pm)
Ok I'm actually getting the funky lighting even with lighting scale set to 32, but only at the brush edges. I'm also getting the following warnings from map2dif:

** *** WARNING WARNING WARNING *** **
*** ** WARNING WARNING WARNING ** ***

Errors exists in this interior. Please use the debug rendering modes
to find and correct the following problems:

* Ambiguous brushes: 0
* Orphaned Polygons: 88

*** ** WARNING WARNING WARNING ** ***
** *** WARNING WARNING WARNING *** **

I inspected the interior in orphaned debug mode and found nothing; all of the brushes were bright white. Could this even be causing the lighting issues?

Oh and I verified the bug (or interior problem) on a Realm Wars build (same interior). Any ideas would be appreciated.

Thanks...

John Kabus.