Lightmap Bleeding Lightmap Pixels between Spacially Different Geometry.

Hi All

We have a tile based game, each level is described by a scriptable object, we have an editor and inspector to allow us to build a flat 3D world from icons that are translated into prefabs and real geometry.

To reduce the draw calls I am baking the static geometry down to a combined mesh by using the CombineChildren in 4x4 groups, so 16+ draw calls down to 1.

The CombineChildren script doesn’t do anything with UV2 set so I am calling Unwrapping.GenerateSecondaryUVSet() which appears to work to a degree, however, we have two issues:

Firstly: presumably because of the way the UVs are baked, and perhaps because the combined meshes have a lot of open edges, geometry that isn’t adjacent receives the edge of light bleeding in from the lightmap for another triangle.

Secondly: Similarly, because we are baking tiles into combined meshes, where one group of tiles has been baked together and then abuts another group, the edges tend towards black. This broadly look like filtering, but even if I select point for the map, then 1 texel of resolution down the edge is being lightmapped from the map that belongs to different part of the mesh, nowehere near the triable in questions.

I’ve tried a lot of fixes for this, changing settings that sound as if they ought to impact the mesh, but none seem to have the desired effect.

I should say that I’ve checked, by occluding the offending part of the mesh, and the light is not leaking through the room, but bleeding from adjacent lightmap pixels.

My questions are therefore:

  1. What is at fault here - do I need to back my own UVs to avoid this sort of thing?
  2. Otherwise, is there some option for lightmapping,for the CombineChildren script, or in the beast XML that should resolve this for me?

I’ll add a few pictures
Help much appreciated!

Picture showing first issues:

Second issue shows the hard edge between ‘tiles’


I had a similar problem and I found the answer in this post:

Basically, in the model import setting, under the Generate Lightmap UV’s Advance tap, try changing the values to:
hard angle 60, pack margin at 16, angle error at 1, area error at 1.


I think this has to do with hard edges. Try to change the “Smoothing Angle” settings in the Import settings for the model/fbx. You can set the “Normals” to “Calculate” and then adjust the smoothing angle for the correct result.

Beast LM bleeds through open edges. Try to create meshes with no open edges.
afaik Combine Children script runs just before loading the game, means after baking the lights so its not the problem of combine children script.

Did you try increasing the pixel light count value in Edit->Project settings->Quality. test with some bigger numbers like 32 or 64 and bake

look here:
this person had the same problem
and increasing pixel light didnt work at first
then he made same changes and then the pixel light worked