Avoiding the Blackhole

Here's the place to post your great mapping tutorials!

Avoiding the Blackhole

Postby Snejk » Thu Aug 27, 2009 7:16 am

I bet everyone's had enough of the "black hole" lightmap glitch. You just keep updating your map more and more, then 'poof'! - Half of your precious polygons are GONE - they're there, but painted pitch-black despite the big lamp above them. You caulk like crazy to keep it away, but it comes back and frustrates you again. Well, not anymore...
As long as you manage to avoid the glitches that cause it, of course.

As most know, a lightmap is a bitmap painted on the polygons to make them bright or dark in correct places. GZMap doesn't generate it, FSRad does. GZM sends FR info about polygons and light spots, then FR returns a bitmap which is converted nicely and put in the map by GZM.
So, why the black holes?

It's not that obvious, but the GZMap is at fault. FR can't export too big bitmaps - it splits them into a few bitmaps instead. That's where the problem appears - GZMap doesn't handle multiple bitmaps properly.

I don't know which line of source code is screwed up, or what is the limit of bitmap files GZM can handle properly, but I know one thing - GZMap screws up the order of lightmap files if there's too many of them. So, the key to a proper lightmap is SURFACE. You should discard everything you can't see by caulk - because it decreases the amount of lightmap texels to be used on the file. But remember - don't discard faces you can't see, but light can. Caulk does NOT block light - that's the cause of missing shadows that should be casted by some ceiling elements you usually remove the top faces of. Also, if you use radiosity( -light instead of -fastlight, recommended for maps with sunlight or dark corners) light will bounce off objects - also those you don't necessarily see but light rays do reach and it does influence the final result.

I figured that my maps never have blackholes when the lightmap fits into one BMP. How do I know it? Well... I opened GZMap in a hex editor, and enabled the -writebmp 1 key on FSRad.exe call. That way I can see without testing if the lightmap is too bright, too dark, or maybe there's more than one file making it possible to screw up.

So, how to decrease the surface used? For low detailed or terrain maps, you should decrease the lightmap resolution at the FSRad settings(just open the exe itself). Also, as I said before - caulk surfaces that won't ever see the light of day. Also try to make maps relatively small, with sometimes more geometry than flat surfaces(a very large grating seen from afar should be actually a brushmodel with discarded faces, not an alpha texture).

And on the file limit... I think that if it generates 0.bmp and 1.bmp it's still okay. But don't exceed that number, as it might screw up later.

UPDATE:
I checked on something lately... The two things that help might be increasing lightmap resolution, and lowering the per texel ratio.
Last edited by Snejk on Tue Oct 27, 2009 10:34 am, edited 1 time in total.
Problems with triangles jumping around on a too large map? Don't limit your map, use the global entity and set a fog + far_z to limit the polygon per scene count.
User avatar
Snejk
 
Posts: 149
Joined: Wed Aug 06, 2008 1:48 pm
Location: Poland

Postby ManyBlackPpl » Fri Aug 28, 2009 2:34 am

great tut man, this is gonna help out alot of people who have problems with lightmapping. I just hope a fix for this will be issued soon, cuz it's more fun to play in a bigger map, rather than a small one.
ManyBlackPpl
 
Posts: 149
Joined: Thu Jul 02, 2009 8:35 pm

Postby Snejk » Fri Aug 28, 2009 6:25 am

It won't be fixed by Legion, that's for sure. I guess I'll have to look into the source myself.
Problems with triangles jumping around on a too large map? Don't limit your map, use the global entity and set a fog + far_z to limit the polygon per scene count.
User avatar
Snejk
 
Posts: 149
Joined: Wed Aug 06, 2008 1:48 pm
Location: Poland

Postby ManyBlackPpl » Fri Aug 28, 2009 3:47 pm

dude, if you manage to fix that, you'd be crowned king on the forums..........well not really, but alot of people would definitely be really grateful :P. Btw, what are you using to look at the source code and what not?
ManyBlackPpl
 
Posts: 149
Joined: Thu Jul 02, 2009 8:35 pm

Postby Snejk » Sat Aug 29, 2009 1:01 am

I just download source from the project page and open it up with Dev-C++ to look for mistakes. No idea where might the bug be so far.
Problems with triangles jumping around on a too large map? Don't limit your map, use the global entity and set a fog + far_z to limit the polygon per scene count.
User avatar
Snejk
 
Posts: 149
Joined: Wed Aug 06, 2008 1:48 pm
Location: Poland

Postby ManyBlackPpl » Sat Aug 29, 2009 4:41 am

ah ic. Well Good luck man, I think you're gonna need it (not saying your noob).
ManyBlackPpl
 
Posts: 149
Joined: Thu Jul 02, 2009 8:35 pm

Postby DusteR » Sat Aug 29, 2009 11:03 am

thankss :D I hope you can solve this bug! ^^
Image
User avatar
DusteR
 
Posts: 568
Joined: Tue Mar 25, 2008 12:00 am
Location: Holland! xD

Postby Snejk » Sat Aug 29, 2009 7:10 pm

I really doubt it, since even if I am a coder, I don't know the source enough to even know where to look.
Problems with triangles jumping around on a too large map? Don't limit your map, use the global entity and set a fog + far_z to limit the polygon per scene count.
User avatar
Snejk
 
Posts: 149
Joined: Wed Aug 06, 2008 1:48 pm
Location: Poland

Postby HellSniper » Sat Aug 29, 2009 11:10 pm

ihave the opposite lol
I have Whiteholes (no kidding).
Image
User avatar
HellSniper
 
Posts: 616
Joined: Mon Mar 24, 2008 12:50 am

Postby ManyBlackPpl » Sat Aug 29, 2009 11:21 pm

loool! Well I'm assuming it's the same problem, except the situation is reversed. :O. Heh, idk :P
ManyBlackPpl
 
Posts: 149
Joined: Thu Jul 02, 2009 8:35 pm

Postby DusteR » Sun Aug 30, 2009 11:47 am

but you can see the texture true the white, so I guess the white version of the bug is better :P..
Image
User avatar
DusteR
 
Posts: 568
Joined: Tue Mar 25, 2008 12:00 am
Location: Holland! xD

Postby Snejk » Sun Aug 30, 2009 12:24 pm

The black(white?)hole is a part of the lightmap simply misplaced, so how it looks doesn't really matter.
Problems with triangles jumping around on a too large map? Don't limit your map, use the global entity and set a fog + far_z to limit the polygon per scene count.
User avatar
Snejk
 
Posts: 149
Joined: Wed Aug 06, 2008 1:48 pm
Location: Poland

Postby ManyBlackPpl » Sun Aug 30, 2009 4:42 pm

Snejk wrote:The black(white?)hole is a part of the lightmap simply misplaced, so how it looks doesn't really matter.


wait, so are you saying that the white part of the map turned out properly, and all the black stuff around it was the black hole? O_o. Dam.... :P
ManyBlackPpl
 
Posts: 149
Joined: Thu Jul 02, 2009 8:35 pm

Postby Snejk » Sun Aug 30, 2009 9:58 pm

No, I mean it was supposed to be dark but a bright part of the lightmap was misplaced and put there. It's probably pitch-black in the place where this part was supposed to be.
Problems with triangles jumping around on a too large map? Don't limit your map, use the global entity and set a fog + far_z to limit the polygon per scene count.
User avatar
Snejk
 
Posts: 149
Joined: Wed Aug 06, 2008 1:48 pm
Location: Poland

Postby HellSniper » Sun Aug 30, 2009 10:38 pm

I got no Black spots on my maps, all i get are those white spots .-.
User avatar
HellSniper
 
Posts: 616
Joined: Mon Mar 24, 2008 12:50 am

Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron