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!