Lightmass won't bake lighting for staticmesh when LODs have overlapping lightmap UVs

So this would seem to be an overzealous warning/error I get after building with lightmass:

MyStaticMesh Object has overlapping UVs

MyStaticMesh Lightmap UV are overlapping by N%. Please adjust content - Enable Error Coloring to visualize.

I’ve been testing this for a while, across versions of the engine. The editor apparently checks every LOD on a static mesh for overlapping UVs to produce this warning, however lightmass only produces a bake based on the UVs from LOD0?

There are plenty of reasons, practical and artistic, to use overlapping lightmap UVs on object LODs. If it’s not a bug, it seems like a hamfisted way to get artists to produce “clean” artwork, and it should be rectified.

Hi,

I assure you there is no hamfisted-ness going on here and this is definitely not a bug. :slight_smile:

Overlapping UVs are common and well used by many game developers for their UV channel 1. However, you will need to make sure you have a second UV that is used for lightmaps. This will bake your shadow and light information for your asset.

If you’re not familiar with lightmaps you can read up on them via World of Level Designs tutorials, which can be very informative on how to get the best results.

If you have any questions feel free to ask! :slight_smile:

Tim

You’ve misunderstood me. To be clear, I am not talking about UV Channel 1.

What’s frustrating me about this error is that overlapping lightmap UVs (on channel 2 and up) OUGHT to be permissible for a static mesh’s LODs. This is in fact useful for things like foliage, where it may be advantageous to map differing geometries to the lightmap bake from LOD0. Also, some UV transfer tools produce overlapping UVs when working with more extreme LODs, yet such artifacts may be completely acceptable at a distance. This error prevents one from baking lightmaps entirely for a given static mesh - it seems like an artificial limitation, and it was not a problem in the UDK.

So yes, obviously you cannot have overlapping lightmap UVs on LOD0 or lightmass would not know what to do with it. But is it not the case that lightmass only produces a bake for LOD0?

Right now every LOD is lightmapped separately. Lightmaps can be anything you want with these, as you’ve pointed out, but this is not ideal for a smooth LODs. This may be changed in the future but there is no timeline for this at the moment.

Ah, well this is news to me that I wasn’t able to find in the documentation. I definitely appreciate your responses!

No problem. I spoke directly with our rendering programmer for this one. It may not be in the documentation, at least not at the moment.

Hi Tim,
does this mean that different LODs can have different lightmap UV layouts?
Because sometimes it’s incredibly difficult to create LODs (i.e. remove geo from the model) while at the same time retaining the lightmap layout of LOD0
Cheers

@ant1fact

I’ve responded on your other post. Simple answer is no, you can only have lightmap for LOD0 that gets applied to lower LODs.

Thanks again and sorry for spamming, I was keen on getting an answer quickly before I have to rework a large portion of my project:P