Game Development Community

Screwed lighting / lightmaps / portals?

by Stefan Beffy Moises · in Artist Corner · 10/07/2002 (9:26 am) · 17 replies

Hi there!
I get the same problem again and again... for almost every interior I build in Hammer, the interior lighting is totally screwed and I get strange light artifacts on the textures.
I think I've done the portals right, but I'm not totally sure... I've done them like Desmond explains in his tutorial here: holodeck.st.usm.edu/vrcomputing/vrc_t/tutorials/editing/.
But this is what I get:
www.beffy.de/pics/screwed_lighting.jpg
www.beffy.de/pics/screwed_lighting2.jpg
www.beffy.de/pics/screwed_lighting3.jpg
The lightmaps seem to be jaggy, there is light where it shouldn't be (e.g. right below the windows is a "stripe" of light), there are artifacts where the textures are tiling, etc.
Here are some more pics:
www.beffy.de/pics/screwed_lighting_lm1.jpg
www.beffy.de/pics/screwed_lighting_lm2.jpg
www.beffy.de/pics/screwed_lighting_pt1.jpg
www.beffy.de/pics/screwed_lighting_pt2.jpg
www.beffy.de/pics/screwed_lighting_hammer.jpg
The portal zones seem to be okay, and the last pic shows an example portal setup for a window...

Any help would be greatly appreciated!!
I really got no idea anymore how to solve this... :(

#1
10/07/2002 (9:33 am)
Looks like you've got a leak there, fella.

Double-check all your joints, like where the wall and floor meet. Make sure they are fitted exactly--no overlap or space.

Eric
#2
10/07/2002 (9:46 am)
I posted this to the bug task manager (with quite a commentary)... there are several posts around the site about this... some from over a year ago... the results can be very erratic... and not (always) mapper error...

Look here www.kriln.com/~jjn/v12lights.jpg or better yet: The interiors in the realm wars demo exhibit the behavior...

The best way to see this is to set the worldspawn ambient on the interior and mission sun ambient to 0 0 0 ... then set the sun color to something like pure green... loads of polygon edges on the inside of the interior will be green... where they definately should not be...

Like I mentioned... the interiors in the realm wars demo exhibit the behavior... just set the sun as described above and look at the inside edges... these interiors don't show the problem terribly well, but they do show it... the bug doesn't get better with hall/room/hall/room styled interiors, "complex" geometry, or when trying to light for mood...

I spent a few hours digging thru the lighting code and did come up with this: Changing the getLitSurfaceArea(poly, surfaceInfo) call to getClippedSurfaceArea(poly) in sceneLighting.cc seems to improve the lighting considerably... there aren't nearly as many interior/mission lighting errors... though they still do happen...

Map2Dif is another matter... it uses it's own branch of this code :(

-J
#3
10/07/2002 (10:00 am)
Stefan,

Make objects like the picture into detail brushes; that will eliminate the surface break-up of the wall.

Make sure all exterior walls, ceiling, and floors are strcutural brushes.

Change how the intersections occur at corners; overlapping is not always good.
#4
10/07/2002 (1:06 pm)
Thanks alot guys!! Desmond, your tips really helped me - almost all the errors are gone now, the lightmaps are much better! Didn't realize the value of detail brushes before, that fixed that wall lighting problem I had... and leaving a small space between the steps and the walls also fixed some problems... I've also rearranged some inner walls, and now it looks really good... although there are still some small edges where the lighting is kinda strange... but that's okay for me now.... :)
Thx again everyone!
#5
10/09/2002 (7:16 pm)
Stefan,

Could you post once more and link your, after fix results, showing the remaining artifacts so that other folks that run into this and fix it via the instructions in this post have a baseline to compare against?

Thanks,

Ed
#6
10/10/2002 (12:42 am)
Sure, there ya go... as I said, still some strange artifacts, but the major problems (wall split and spots at the sides of the stairs) are gone..
(sorry, the screenshots are very dark...)
Here is the wall after making the painting on the wall a "detail" brush:
www.beffy.de/pics/debug/screenshot_00001.jpg
www.beffy.de/pics/debug/screenshot_00002.jpg
Here is the entry, which has still *some* artifacts on the right side
www.beffy.de/pics/debug/screenshot_00003.jpg
Now for the stairs: the artifacts on the sides are gone after I've left some space to the walls: (although the stairs themselves still have some strange lighting effects, but that's not really a problem, I think...)
www.beffy.de/pics/debug/screenshot_00005.jpg
www.beffy.de/pics/debug/screenshot_00008.jpg

The next pics show that there is still a strange light spot in the corner of the room:
www.beffy.de/pics/debug/screenshot_00006.jpg
www.beffy.de/pics/debug/screenshot_00007.jpg

But overall, it looks better now... I guess the remaining problems are caused by leaks in the building (although I can't find any...)
#7
10/10/2002 (5:58 am)
stefan, email me the map of that room (zip w/ tex) so I can look at the construction.
#8
10/10/2002 (7:15 am)
Sure, Desmond, as soon as I get home! Thx a bunch! :)
#9
10/10/2002 (5:22 pm)
Thanks a lot Stefan. - Ed
#10
12/09/2003 (9:49 pm)
Has anyone ever fixed the lighmap exporting code or does everyone just keep tweaking the geometry and lights until you don't see the problems?
#11
02/09/2004 (12:25 am)
My maps are filled with this stuff. There is no answer huh? Just keep redoing stuff and testing it? I know the joints are right together I spent 40 mins on one of them.. never fixed it.
#12
02/09/2004 (9:15 am)
Sadly, redoing stuff seems like the best solution. Someday, this will get fixed, but until then... :-/
#13
02/09/2004 (12:31 pm)
I had this same problem before. I previously did level design for Half-Life and it's modifications, so I'm always careful about brush splitting and the like. I still got these weird lighting problems - I'm working on a map that takes place at night so they're even more obvious.

I recently found a solution. In the worldspawn settings, if you set the Lightmap Scale to something smaller than the default of 32 while keeping the geometry scale at 32, the lighting is much more detailed and these weird lighting problems diminish or even go away completely. The setting has to be a power of 2, so 2, 4, 8, 16, and 32 are valid values. For my interiors (I'm recreating a French town for our project, GreenLight) the lowest I seem to be able to use is 4. The lighting looks a lot better - there are actually distinct shadows (unlike the blurry mess with the default setting). For larger dif files (like streets and roads) the lowest I seem to be able to use is 16.

The only disadvantages to using this are that it takes longer to light the map. The interiors might also use more memory. For me, it's a small price to pay for such an improvement.
#14
04/28/2004 (5:17 pm)
This stuff is good to know. Currently i've noticed my interriors look quite dull, and would like to light them with some more realistic shading. I'm using quark, any suggestions on this? Last thing I want to hear now is that quark wont support this for torque. Grrrr.
#15
04/28/2004 (6:22 pm)
This stuff is good to know. Currently i've noticed my interriors look quite dull, and would like to light them with some more realistic shading. I'm using quark, any suggestions on this? Last thing I want to hear now is that quark wont support this for torque. Grrrr.
#16
04/29/2004 (3:08 pm)
The brightness of your textures should just be determined by the intensity of the texture itself and the strength/colors of the lights hitting it. The outsides of buildings in Torque often look a bit dull because the default light values are a bit grey. I recommend bumping them up a bit.
#17
06/22/2005 (4:03 pm)
Don't mean to necropost, but I just happened to be reading.
I had a similar problem with the Genesis engine, which also used lightmaps with BSP. It was caused by the lightmap not being small enough (too low detail of a shadow). This is analogous to the compression in JPG. It looks pretty good and is fast, but don't expect high detail shadows using low detail lightmaps :)

Sometime errors creep in.