- Home /
Intersecting objects cause black lines in Lightmap.
Hi everybody!
I have a lightmap problem that keeps me busy for over a week now and that I’m just not able to solve. I get really ugly black lines where objects in my scene are intersecting. We use hard-shaded assets with no texture to create a “lowpoly” look. We chose this style not only because we think it looks cool, but also because we wanted to be able to just stick meshes together without having to worry about them being tileable etc. But now this beloved kit bashing is giving us a hard time and I could really need some help. Some screenshots for you:
Please don’t mind the artifacts on the plants, this was baked with a very low resolution...they look fine with a higher resolution, but the black lines do not.
I tried every possible setting for the lightmaps but none of them makes any difference (resolution, FG, hard angle, contrast threshold, shadow type, etc..). We don’t use AO ( so the AO is set to 0 in the lightmap settings), no normal map and the maps are not compressed. The lightmap uv is generated by Unity, but I also tried to unwrap a few assets manually for the lightmap and it still looks the same.
Whether padding nor dilation has any influence at all on the black lines, so I really don’t know what to do anymore.
Some people suggested combining the meshes, but as far as I know (which is not much, this is my first time working with Unity), Unity combines them automatically as long as they have the same material by marking them as static?
I tried welding all the assets together in 3DsMax (at least the ones which bugged me the most), but while this solved the black lines, other issues occurred and most of all: it’s just not practical for 80 levels to build them in Unity, export them to Max, carefully weld them together (which isn’t that easy) and import them back to Unity. A lot of assets get too big and I get other artifacts and everything looks like a mess.
Please help me, I’m stuck and really need a solution for this problem! I made a joke about just using a toon shader for the whole game to hide the seams, but I really don’t want this to be the solution ;)
By the way, here are a few of the threads I had a look at before posting:
http://forum.unity3d.com/threads/127238-Lightmap-Texture-Camera-MipMap-Error
http://forum.unity3d.com/threads/83813-Serious-Lightmapping-Issue-with-Seams
http://answers.unity3d.com/questions/225804/very-visible-seams-in-lightmapping.html
http://answers.unity3d.com/questions/496042/black-lines-in-lightmap-for-modular-environment-de.html
http://forum.unity3d.com/threads/157635-Lightmapping-artifacts-appearing-when-baking-many-objects
http://forum.unity3d.com/threads/83813-Serious-Lightmapping-Issue-with-Seams
http://answers.unity3d.com/questions/243615/beast-lightmapping-black-seam-problem.html
Thank you and please let me know if you need more information!
Yes, I did after unwrapping a few assets. I baked two manually unwrapped assets seperately and it still looked like this:
Thank you, though!
It looks like unity is doing some occlusion culling with the meshes that are too near to each other
I think it's a lightmap problem, though. It seems like the dark areas are bleeding into the lighter ones. We turned occlusion culling off for our project.
You could try modifying the atlas settings under the Object panel in the lightmapping window
Answer by karljj1 · Nov 27, 2013 at 06:17 PM
It looks like AO.
Try turning ambient occlusion down to 0 in your lightmap settings.
I guess I worded it wrong in my post, but we don't use AO so setting the AO setting to 0 in the lightmap window was like the first thing I did. Thank you, though!
As there are several ways to create an AO, I think it was right asking about the setting in the lightmap settings...I will edit my post to make it more clear! :)