Download

Skeletal Meshes, Overlapping UVs, Additional UV Layers and Lighting.

Hi everyone! :smiley:

To cut a long story short I want to have overlapping UV islands on my the primary UV layer of my Skeletal Meshes. The primary reason I want to do this is to save time and texture space. But I am concerned that overlapping UVs on my Skeletal Meshes is going to return lighting issues and I want to find out if there is a way to over come this, or if the way I want to over come it is possible / workable.

First a little more detail to explain exactly what I am trying to do: Say for example I am modelling a Sports car and this Sports car is completely symmetrical. That is the left side and the right side of the car are identical, same colours, same normals. So when I UV unwrap this Sports car, lets say I have a large UV island for the right passenger door. So what I want to do is unwrap the left passenger door and place it directly on top of the right passenger door, so that they share the same UV space. That way, I save literal space in the texture and it also means I don’t have to paint two identical doors on the texture. This seems like a great time saving technique to me. But is it going to cause lighting errors?

Now, I am aware that with Static Meshes there is a simple and effective work around for this problem. Inside Blender 3D it is possible to give a mesh object multiple UV layers. So for example I can give the mesh object 1 UV layer called “Diffuse” and unwrap that layer to the textures, diffuse, normal etc, with overlapping UVs. Then I can assign an additional UV layer to the mesh object and call it for example “Light” and perform the UV unwrap again but this time with no overlapping UV islands. Then inside Unreal Engine 4, I can tell the engine to reference Lightmap Index “1” instead of “0” and the engine will use the “Light” UV layer for calculating lighting so that no errors occur due to overlapping UVs.

So my question really is this: Is it possible to use this same technique with Skeletal Meshes? To give my skeletal meshes an additional “Light” UV layer and some how tell UE4 to reference that second UV layer (without overlapped UVs) for lightning calculations.

Is this possible and if so where and how would I tell UE4 to reference the 2nd UV layer? Any tips or advice on these topics would be gratefully received. Thanks! :slight_smile:

What kind of a problem with lighting are you having when you use overlapping UV’s? It shouldnt matter for skeletal meshes at all and it should matter for static meshes either as long as you dont build the lights using that UV layout.

Btw, you can tell textures which UV channel to use via Texture Coordinate node. But only the normal map would affect the lighting so you should be fine if you dont have mirrored UV’s in the layout.

Unwrapping UVs for Lightmaps | Unreal Engine Documentation This page contains an explanation of Additional UV layers for Lightmaps for Static Meshes. But there is not a corresponding explanation for Skeletal Meshes

Hi Jacky! Thank you for your reply. :slight_smile: Well I haven’t encountered any lighting errors yet, but I was kind of concerned that I would do if I make skeletal meshes with overlapping UVs. So are you you saying that it is okay to have Skeletal Meshes with overlapping UVs? So for example, the Sports Car with two doors sharing the same UV space should be okay? Okay I’ll just have to test it out, thanks!

Yeah, check out my car here. It has a ton of overlapping UV’s but the only errors you would see are caused by the mesh itself(lack of chamfered edges, n-gons, etc.)

Cool car! :smiley: Okay that re-assures me Jacky. Thanks mate! I’ll keep working with overlapping UVs and everything should be fine. If I do run into any problems I’ll ask again. Thanks! :wink:

Thanks, but that shouldn’t encourage you to use overlapping UV’s. :slight_smile: Non overlapping UV’s will let you add details/customize your textures a lot easier in the long run so dont use overlapping UV’s if you can. Or use a second UV channel with no overlapping UV’s in case you want to add dirt or some other stuff to the vehicle later on so that you dont have any tiling or stretching texture problems.

You can do practically anything with your UV’s for your textures, and for skeletal meshes it doesn’t matter since they don’t use lightmaps since they are dynamic. For static meshes, you can still use overlapping UV’s but that then requires a second UV channel for the lightmaps to where they aren’t overlapping.

Good tips, thanks Jacky! :slight_smile:

Okay, got it. Thanks Darthviper! :slight_smile: