Download

Multiple UV sets for lightmap baking

Hello,

I’ve been reading other posts about multiple UV sets and from what I’ve learned is that if an object has 2 UV sets (coordinate index 0 and coordinate index 1 in unreal), there should be additional UV set (in coordinate index 2), that would include all the UV shells from coordinate index 0 and coordinate index 1 (where they would not overlap of course). So when baking a lightmap, the source lightmap index should be set to 2 and the destination lightmap index should be set to 3.

Is there any other way of letting Unreal know that I use 2 UV sets, so it can make 2 more identical UV sets where it would store the lightmap?
Because working this way is much more time consuming - making 3 UV sets instead of 2.

Thanks.

By default, the workflow should be that the first UV channel is for your material and the second is for your Lightmap UV’s

By default, it is set to generate an extra UV channel for lightmaps when you import a mesh, if you already have your lightmap UV’s setup for your mesh, then you need to make sure to uncheck that option when you import. If you have it set up like normal, then UE4 will automatically use the second UV channel for lightmaps.

The source/destination lightmap index are settings for the UE4 automatic lightmap UV tool, which I would avoid using. Instead, it would be better to setup your lightmap UV’s beforehand. you’ll get even better results if you do them yourself instead of using something like Automatic Flatten UV’s in 3ds Max, since that will split up the UV’s more than is necessary.

Thank you for your reply, just to be clear, I should use first UV channel for my materials and make a second UV channel for the lightmap (where there are no overlapping uv shells) and uncheck the Generate lightmap UVs should be unchecked at fbx import? What if I’d like to use more UV channels for the materials? Should I continue to use UV channel 3 (2 in unreal)?

Thanks.

Yep!

If you want to use more than one UV channel for shaders all you need to do is change the UV channel the Lightmap with be looking at in the mesh settings. Here it is, change the Lightmap Coordinate Index to the correct UV channel:

0ecfe82bc4a2bee7353c09b0eae8a5302d712709.jpeg

Thanks, this clears up the whole issue I’ve been having

No problem!

Note however as far as materials go, normal maps can only use the first UV channel, I can’t remember the specific issue, but UE4 is not set up to render normal maps with any other channels, they’ll end up going the wrong direction.

Here’s a post that explains the issue https://forums.unrealengine.com/showthread.php?45063-Multiple-Normal-Maps-on-Separate-UV-Channels&p=326918&viewfull=1#post326918

Good to know, thanks.
Will this issue be resolved?

Maybe, it’s something people have been requesting so that they can use multiple normal maps with different UV’s, but it’s a rare case that someone needs that so it’s definitely not a priority.

It’s not completely rare, wanting to have normal maps along the corners of meshes is pretty common, Metal Gear Solid 5 and Sunset Overdrive used it a lot. But there are some hacky ways to make it work http://polycount.com/discussion/160794/the-ultimate-trim-technique-from-sunset-overdrive There was a better thread about how to get tiling edge damage normal maps working as well, but it got closed down due to a breach of workflow NDA, but you can figure it our from those ideas and posts.