Lightmap UV coordinate index auto-assignment doesn't update on reimport

This is half a bug report, and half documentation of workflow for anyone who googles their way here. Mostly it’s just feedback on workflow stuff.

For awhile now I’ve had trouble getting my lightmaps set up correctly and I couldn’t figure out why. I am very familiar with the process, and the tools, having been using UE3/4 for many years. In a recent build of Ue4 some settings got shuffled…There are now three settings for lightmap coordinate assignments.

**Within BuildSettings:**SourceLightmap & DestinationLightmap

Within StaticMeshSettings:
LightmapCoordinateIndex

My problems setting things up correctly came from a few things:

First: The addition of the build-settings Lightmap boxes makes them seem highly prioritized. It is unclear if these values are used ONLY in the auto-lightmap UV generation (which I think is the case) or if they are also referenced on a mesh that HAS lightmap UVs-as in, on import these are looked at for what to set LightmapCoordinateIndex to.

Second: The BuildSetting Lightmaps have no tooltip to indicate that they are lightmap-UV-generation specific and NOT actually the important “final” lightmap index setting, which used to live near that spot in the UI–and which is something that is seems to sometimes be auto set, sometimes not (see below).

Third: The actually important LightmapCoordinadeIndex settingis de-prioritized/buried now under a collapse bar within Static Mesh settings (so, basically hidden).

Fourth: You can get yourself into a situation where that final lightmap index value is autoset incorrectly without realizing it. Here’s how:

It’s pretty standard-workflow to initially import a mesh with a second lightmap UVset, in which case Unreal will auto set up the FINAL lightmap coordinate index in the static mesh settings for you to be channel 1 and things work great. I do not know if that’s because the LightMapCoordinateIndex defaults to 1 (like UE3) or if it’s being read from the BuildSettings Lightmap settings.

However, if you initially import a mesh WITHOUT a second lightmap UVset…and you DONT want it to autogenerate lightmap UVs (lets say you just import a work-in-progress mesh to do a quick scale test)…then Unreal will auto setup (or autoclamp, I suppose) the FINAL lightmap coordinate index to be channel 0.

THEN: If you REIMPORT a mesh that previously did NOT have a second lightmap UVset, but now DOES, then the reimport process does NOT reset what the assigned lightmap coordinate index is, even if you’ve changed the Destination/Source Lightmap index settings.

You have to manually go in and change the LightMapCoordinateIndex back to 1…

I understand the need to preserve a non-default setting once it is set on a mesh, and I get how reevaluating the mesh’s lightmaps on each reimport might not be desired…but It’s very easy to be fooled by Unreal thinking it’s saving you time by autosetting that, and it creates a workflow that varies by situation, rather than being consistent…which leads to it being more error prone for the artists…or at least for me.

Personally, I think the lightmap Coordinate Index should never be auto-set to 0. Perhaps it could stay at 1 by default and if the baker tries to pull from an index that doesn’t exist, then it just falls back to a lower index…that would be more elegant for the user, I think, rather than sometimes needing to set the lightmapcoordinateIndex, sometimes not needing to, sometimes having it autoset, and sometimes needing to fix the autoset.

At the very least, perhaps some tooltips to those settings to clarify what the various settings do (and what is only relevant to the autoUV generation, if that’s the case) would help users navigate the tools a bit better.

Thanks!

HI Joe,

This has been a common issue I’ve seen with people using lightmapping that aren’t familiar with the process or even experienced developers. It’s something that needs to be better documented and it really hasn’t been since the feature was introduced in 4.5 to be a much more hands-off approach for those users who just want auto-generated UVs.

First: The addition of the
build-settings Lightmap boxes makes
them seem highly prioritized. It is
unclear if these values are used ONLY
in the auto-lightmap UV generation
(which I think is the case) or if they
are also referenced on a mesh that HAS
lightmap UVs-as in, on import these
are looked at for what to set
LightmapCoordinateIndex to.

You are correct that these settings are ONLY used for the auto-generation of lightmap UVs.

Second: The BuildSetting Lightmaps
have no tooltip to indicate that they
are lightmap-UV-generation specific
and NOT actually the important “final”
lightmap index setting, which used to
live near that spot in the UI–and
which is something that is seems to
sometimes be auto set, sometimes not
(see below).

The lightmap will be assigned on import for the first time if it’s being auto-generated, but not if you are here to regenerate or generate after the fact. This is left up to the user to be responsible for assigning it and making sure it’s set correctly. My assumption here, is that this was done this way since you have to activily seek out these setting under the Build Settings and hit the apply button to accept the changes.

Third: The actually important
LightmapCoordinadeIndex settingis
de-prioritized/buried now under a
collapse bar within Static Mesh
settings (so, basically hidden).

This is part of a problem that the Build Settings are not hidden by default, which I think it used to be by default in much older versions, but I could be wrong on that.


For the fourth option, I see where this can be frustrating but this is in line with intended workflows as to not assume that everyone will ever import or use these specific UV channels for lightmaps. There are other uses for the UVs imported than just for lightmaps. So making the assumption that any re-imported mesh should have it’s UVs set to Coordinate Index 1 is not something that will change that I can see.

I’ve entered a request ticket for the tooltips in the Build Settings to be updated to account for this with UEDOC-3550.

Thank you!

Tim

Thanks for the reply Tim…sounds like you get where I’m coming from. I’m very familiar with using multiple UVs for all sorts of material hijinks…and I DO agree that UE should not make the assumption that any reimported mesh’s Lmap coordinate index should be set to 1…it’s the inconsistency with it sometimes being autoset to 0 that felt awkward to me (rather than the baker just spitting out a warning and falling back silently to Idx 0).

However, it’s not my place to make philosophical recommendations about workflow–and I DO think simple things like collapsing the build settings by default and providing more descriptive tooltips would have resolved 99.99% of the confusion for me…Half of what got me stuck personally this time around was having a somewhat unreliable memory of how things USED to be in the engine, and assuming stuff had been shuffled/reordered/renamed/etc.

Thanks for the detailed response!

I also went ahead and entered in a ticket for a how-to that should cover the basics of using the generated lightmapping, best practices, and limitations so that this can hopefully resolve some additional confusion. Which, hopefully, I can work on in the near future after some other documentation work. It’s a common occurrence for confusion, that’s for sure!