Generate Lightmap UV's is discarding some UV islands

This problem is present also in older UE4 versions. Sometimes when I generate lightmap UV’s, some smal islands are getting discarded (shrunk down to zero). This usually result in black spots anywhere an island is “discarded”.
Is this expected behavior of UE4 lightmap packing algorithm?

Do you have an example mesh that you could post here? It’s really hard to say by just going off a description here.

I’ve not seen this reported before.


Here is the example of the issue. This error is happening fairly often, with various meshes, thus making UE4 UV generation unreliable in production enviroment.

[link text][1]

So after looking at this mesh I see the issue happening when I let it auto-generate a mesh from your FBX, but I’ve got a couple of questions.

  • Is it only this mesh that this happens to for you? I’ve not been able to reproduce this with a newly created asset.
  • The supplied FBX has 3 UV channels with it, UV0 for the texture and UV1 & 2 appear to be a packed UV for a lightmap or something else already, so why not just import using those instead of generating one?

Without being able to successfully recreate the issue it’s not likely something to be fixed even though I can submit a ticket as it stands now. If you have steps that can reproduce it all the time for you I’d be curious to know those. Also, what software are you using for your modeling. I’ve used 3DS Max with FBX 2016

I’m encountering this issue on numerous meshes, much more often on complicated meshes. The mesh I send was repacked in 3ds max to mitigate bad UE4 repack, third channel was left there by mistake.
We currently pack UV’s for lightmaps in 3ds MAX, but UE4 algorithms for packing lightmaps are much more efficient.
In overall the problem is persistent, it is slowing our workflow down and we waste a lot of lightmap pixels due to inefficiency of 3ds max packer.

Here is another offender:

Also if you try to repack second channel on previous mesh, you will be able to see clearly that small islands on the side of plakks are getting discarded.

I went ahead and created a ticket for this that you can track here: Unreal Engine Issues and Bug Tracker (UE-36201)

With the second mesh you attached this actually didn’t exhibit the issue when using a proper lightmap size and packed lightmap size.

When I used the Build Settings and set the packed size to 512 and the lightmap resolution to 512 everything appeared correct. Aside from that, you’re likely to run into many other lighting issues with this particular mesh simply due to the way the mesh is constructed. UV faces that aren’t welded together for planar surfaces, like the walls and roof, will have shading differences that lightmass will not be able to properly calculate. At 512 or even a 2048 lightmap resolution and the many small pieces will not have a good layout to avoid shadowing issues are the edges of the faces.

For something like this mesh, breaking it up into smaller pieces with a proper lightmap would be better to get a good bake.