UV or not UV unwrap when exporting models from Blender to Unreal: when and why

Hello all,

This message is kinda of a first from a novice, it is the first I ask for help on the workings of Unreal (though I have posted one more thread regarding a project assignment I will be commisioning).
My background is I am an architect and I have been modeling and rendering Archviz for decades (AccuRender, Autocad 3D), now lately 4 odd years with Blender.
I was impressed with the video real-time capabilities and seamingly easy-to-use rendering of Unreal and I have started experimenting this past week.

Question 1: is if all static meshes need to be UV unwrapped; the question is not about workflow preference but rather if not having UV unwrapped causes an Engine error.
As far as preferences go, I can think of many surfaces where I need no UV unwrapping, for example in Blender, where the scale exists in the material pattern definition and no further mapping is necessary.
As a matter of fact, having purchased Archviz interiors from the Unreal Marketplace (ArchInteriors by Evermotion), while looking through them, it seems to me many static mesh assets were conceived this way (no UV unwrap - eg a floor with wood parquet pattern, or even simpler a painted wall surface of just color and roughness), while other static meshes where textures need to follow geometry in a more complicated way, were indeed unwrapped (eg the fabric on a folded over bed cover, or the woodgrain at the edge of a counter-top). … And I do hope I understood the Evermotion setup well enought to be correct on this point, almost certain I am.
**
Question 2:** is related to Q1, reading on Blender FBX export for Unreal import, I was instructed to unwrap all static meshes. Indeed when I didn’t unwrap in Blender I got an error importing in UE4, and the surfaces’ diffuse shader remained black, no matter what material I assigned. So do I need to unwrap every object in Blender to get a correct static mesh asset in UE4? And what about the extra texture channel for the Lightmass, I don’t get that.

Thanks to all who offer some understanding,
Christos

You will have two UVW Map channels. The first one is for your textures/materials, the second is for lightmass.

You are correct about the UVW map for your textures. They can be anything you want it to be, just like in Blender. All it does it determine how your material will lay on your geometry, as you sound like you know.

The second UVW map channel is the one for lightmass. UE4 basically bakes the lighting and shadow information into this map channel. If you have over lapping UVWs or UVWs that are messy, UE4 doesn’t know what to do with it. That’s why everything needs to be mapped out correctly in this channel. This is a pretty good article that helped me wrap my head around it when I first started: http://www.worldofleveldesign.com/categories/udk/udk-lightmaps-01-basics-and-important-principles-for-creating-using-lightmaps.php

I highly recommend learning how lightmass works and how to properly unwrap your UVWs. It can be a pain in the butt at first, but if you take a week to learn it you will never have a problem again, and as you can see by looking at this forums a LOT of the problems people have are caused from not understanding this process.

I hope this was clear, please don’t hesitate to ask more questions. I have a similar background as you so I’m can relate to what you’re experiencing.

Thank you James excellent link, very informative.
I set up two channels inBlender for textures, unwrap in the first for textures and in the other for lightmaps. When I export to FBX and import to UE4, I get channels 0, 1, 2… three channels total. The unwraps I did, I find UV mapping in UE engine’s channels 0 and 1, whereas channel 2 is empty. I am uncertain that the lightmaps use channel 1 wher I have stored the proper unwrapping and not the last empty channel 2.
Why am I getting the extra channel?
Can I assign which channel contains the data for the lightmaps?

PS: My lightmap UV’s were padded and in sets of coplanar faces, as explained in the article, once the proper channel was built… it turns out I’m a good (though slow) lightmap Baker! :slight_smile:

The first channel is also for baked normal maps, if you try to use any other channel, you’ll get artifacts and seams.

UE4 might be adding it’s own channel for lightmaps for some reason, check your import settings. Also search to see if it might be a Blender specific issue UE4 users have, I know there’s been issues with Blender, FBX, and UE4 in the past, don’t know if it’s a 100% seamless process yet.

Yes, you can assign which channel UE4 uses for lightmaps in the static mesh editor.

Thanks Zac, so I understand any baking of normals is in the same channel as the diffuse, channel 0?

Yes I read about that in the article (great article), but the location of the setting has since changed, now in UE4 here is how to access this setting

PS: Turns I’m a good lightmap Baker!.. already unwrapped in coplanar islands, padded so as not to bleed, from Blender, once I set the channel in UE4 I was cooking :slight_smile:

Blender screenshots of the two channels of UV maps

Difuse UV :

Lightmpas UV : all coplanar faces are individual UV islands, with padding around them

And UE4.16 screenshots :

Lightmap resolution 128: scragly shadow edges baked but the corners are a little curved, “softer” than they should

Lightmap resolution 1024: clean shadow edges baked and sharp corners

Looks great csimeon!

Did you test a version with autogenerated lightmaps from UE4? I made a similar mesh to yours and ended up with this which basically looks the same but wastes less space.

Which basically means you would get it for free (from the normal UVs).

By default UE4 has an option to automatically generate lightmap UV’s, so it will take the last channel and it uses the UV seams but does its own flattening and packing (which means if your seams aren’t good then you can’t get a good result from this) So that’s why it added the third channel. If you do your own lightmap UV’s then you want to turn this option off.

What version is this?
Did you have the seams already created in Blender? Like darthviper says
In my case it seems Unreal created the channel in addition to the two I had already, from Blender, but that was empty despite the fact that I had the same seams.

So if I understand correctly I can mark and test this seems in Blender, proceed to delete them and the channel, before export and then import in the Unreal to get the channel created automatically with the optimised layout of the UVs. Correctly?

No, you still need the UV that has your seams created, it will copy that UV channel to a new channel and then use their flattening algorithm to flatten it out and then pack it all together.

Best workflow:
First channel for your textures/material, second channel is for your Lightmap UV’s, if your first channel fulfills the requirements of the lightmap UV (not overlapping, stays in the 0-1 UV space) then you don’t need the second channel either.
After that, import to UE4 and in the Import window disable the option Generate Lightmap UV’s
This will use the last UV channel for lightmaps, so if you have two channels it will set the lightmap to use the second channel, if you have one then it will use that one.

If you enable it Generate Lightmap UV’s, it will add an additional UV channel and copy the last channel to that one and flatten it out/pack it and then assign the lightmap to that channel.

Yes, the normal UVs only, I only had one UV map and let UE4 generate the second UE map for the lightmap. You can try removing your lightmap UVs and letting UE4 do the work for you.

Best workflow is best! thank you

I can’t get this to work: when I turn the “Generate Lightmap UV’s” back on, it copies channel 0, not channel 1, into a new channel 2. And if that channel has a UV map extending outside the (0,1) space it does not re-pack to correct this. (It’s not a major deal because I can still use the best workflow, to get what I want, but I would like to understand)

When using Generate Lightmap UVs you can only have one UV channel. The second lightmap UV channel will be created automatically. Also even if the UV map for the first (base color UV) channel extends outside the 0-1 UV space it should get packed correctly as long as it’s not overlapping.

How often do you need to do the lightmass uvs yourself? I’ve been letting ue4 take care of it so far…