Problems with lighting? Is it a bug?
by FruitBatInShades · in Torque Game Engine · 09/16/2004 (12:44 pm) · 9 replies
Well after hours of fiddling around I have discovered where a particular lighting error comes from. The wall shown here are only 8 units thick, this allows light in. If i make the walls 16, no light creeps in. Anybody got any idea why this might be?

Download this file, it has 4 rooms with wall thicknesses of 8, 10, 12 and 14. You can see the thicker the wall the less the light leaks in. LeakMap.zip 3k
The second one is a bit more corncerning for what i'm trying to do. In the following map you can see 2 rooms connected by a corridor. Each room has a door which contains a portal. If I select 'Light does not pass' the interior is totally dark and sealed. If I select 'Allow light to pass' on either of the portals all the seams produce a light leak. I have checked the map file and the faces are perfectly aligned and are not floating point.
Any ideas why this should be? I have been looking at other peoples maps with problems and this seems to be a common issue. Is this a bug or expected behavior, either way, how do we fix it?

Download this file, it has 4 rooms with wall thicknesses of 8, 10, 12 and 14. You can see the thicker the wall the less the light leaks in. LeakMap.zip 3k
The second one is a bit more corncerning for what i'm trying to do. In the following map you can see 2 rooms connected by a corridor. Each room has a door which contains a portal. If I select 'Light does not pass' the interior is totally dark and sealed. If I select 'Allow light to pass' on either of the portals all the seams produce a light leak. I have checked the map file and the faces are perfectly aligned and are not floating point.
Any ideas why this should be? I have been looking at other peoples maps with problems and this seems to be a common issue. Is this a bug or expected behavior, either way, how do we fix it?
#2
In the map file (i.e before Map2DIF) the faces are perfectly aligned, no spaces not even 0.000000000001 off. The other thing I tried was to totally wrap a 'leak' by other brushes so all seams were covered by at least 16 units of other brushes (Think very thick sticky tape) and these leaks still appear.
09/16/2004 (1:05 pm)
World light from the sun, so why would it only show when light is allowed to pass the portal? If there is a leak there light would creep in whether the portal allows light or not, I have proven this by moving a face 1 unit off, then i get leaks, put it back and no leaks.In the map file (i.e before Map2DIF) the faces are perfectly aligned, no spaces not even 0.000000000001 off. The other thing I tried was to totally wrap a 'leak' by other brushes so all seams were covered by at least 16 units of other brushes (Think very thick sticky tape) and these leaks still appear.
#3
This also explains why increasing the wall size hides the problem i.e. the room (edit: not sure what a rool is :o}) walls have gotten thicker but the lightmap is still at it's original (incorrect) scale so get's covered by the wall.
09/16/2004 (1:42 pm)
Check your lighting scale as this problem seems to crop up when the lightmap is scaled. In short your map is fine, the artifacts produced are created by the lightmap scaling factor you are using.This also explains why increasing the wall size hides the problem i.e. the room (edit: not sure what a rool is :o}) walls have gotten thicker but the lightmap is still at it's original (incorrect) scale so get's covered by the wall.
#4
09/16/2004 (6:21 pm)
THere was a thread about this recently that talked about lighting scale as well. I believe they also said to make sure it was a power of two (2, 4, 8, 16, 32, etc...)
#5
If completely blocking a seam with other brushes doesn't stop the leak, its got to be part of the csg process surely, like its looking at the corridor section as a new room and applying a default light at the edge or something?
09/17/2004 (12:12 am)
So surely this is the lightmap being calculated incorrectly? Increasing the resolution of the lightmap is effectively applying a blur filter, the light error is still there, just smudged.If completely blocking a seam with other brushes doesn't stop the leak, its got to be part of the csg process surely, like its looking at the corridor section as a new room and applying a default light at the edge or something?
#7
09/17/2004 (6:24 am)
I know we can get round it by pushing the lightmap resolution up, but I think it needs addressing in the head or at least someone from garage to have their say on why this is happening?
#8
Have you tried the lighting pack or TGERad? map2dif's lighting model, well, sucks... Your sanity may be helped by one of the alternatives... I would suggest trying your model in the lighting pack demo to see if it helps... the lighting pack is seriously cool stuff
Thanks for sharing your models! I am sure we'll find some use for them!
-Josh Ritter
Technical Director
Prairie Games
09/19/2004 (5:15 am)
I drilled into the map2dif lighting code at one point... I was able to minimize this lighting problem, though, not fix it entirely... I don't remember the exact steps I took...Have you tried the lighting pack or TGERad? map2dif's lighting model, well, sucks... Your sanity may be helped by one of the alternatives... I would suggest trying your model in the lighting pack demo to see if it helps... the lighting pack is seriously cool stuff
Thanks for sharing your models! I am sure we'll find some use for them!
-Josh Ritter
Technical Director
Prairie Games
#9
09/19/2004 (6:35 am)
Fruit (geez... assuming you're a guy it didn't sound good...), there's no real leak in your map, or else the portals wouldn't work. Like Josh said, the standard lighting model isn't that nice at all.
This is taken in head with a light_geometryscale of 8, there is a small lightleak in 1 corner only !
Torque Owner Peter Dwyer
Your floor would appear to be being lit from the edges as if the walls were not there at all. Where exactly is your light source and more importantly what type of light is it?