Download

Complex static meshes lightmapping workflow

Greetings!

I am quite recently started to work with Unreal Engine and I obviously have a lot of questions. Most of them are brilliantly covered by the documentation, but for one particular I decided to create this thread.
What is the appropriate and common way of making fairly complex objects like houses, for instance? Bacause of the fact we need lightmaps for everything it becomes really important to know how people usually manage this
Let’s have a look at the example below.

I have an object that was made for Unity and it was part of the static geometry, just one mesh with three textures.
If I import if to UE I won’t get proper lighting due to the abscence of the lightmap.
But if I unwrap the whole mesh to make a second UV channel, that will be a complete mess that you can barely handle: an enourmous amount of faces you need to fit.
So to make things easier I separated the mesh into several pieces and tested it.
The lightmap was crappy though: some weird black lines and shades. Mesh pieces were still very large.
So I made another iteration and separated the object to a whole bunch of smaller meshes that turned out into something normal. Yes, there are still some weird dark corners on the mesh, but not much visible.
And should I make a collision mesh for every single part of it? So now if I import it into the editor my house model is a list of different parts that just occupy space in the inspector.
We can not just make a prefab and put it there to work with the object a bit easier. At lease I haven’t found anything about that. What if I have dozens of objects?

My question is as follows: what I did wrong or what should be done instead for my particular case? Should I make pieces larger or try to handmade one lightmap for the whole mesh? (that is next to impossible I think)
While surfing the internet and Marketplace I noticed that such buildings are built by using small modular blocks and not taken as a separate large mesh.

Thanks

That’s not hugely complex, but that definitely wasn’t designed well.
First off-because of so many separate static meshes the performance will be very bad due to draw calls on each mesh, so it can help greatly to combine some meshes–start with combining meshes that use the same material.
As for lightmaps, you just have to go ahead and unwrap the UV’s. It looks like if that’s made of a bunch of separate meshes you’ll probably get some issues though due to how parts are intersecting and not welded together

Thank you for the reply, but I still can’t find the proper variant to make lightmaps. Looks like it does not matter whether UV islands have small gap between each other or large ones. Even if lightmap UV is done good there are a lot of artifacts. At first I decided to do it manually, putting all faces in order and so on. The result was not nice and I made some auto packing of islands (based on my handmade UV, so the scale of islands is correct) to make free space between them. But nothing works again!
Look at the screenshots below: I have a piece of modular building and it has this artifacts practically on every corner, no mater how the UV is done.
The highlighted area on lightmap UV is the representation of faces that are lit wrong on the screens, to make it easier.

I even decided to weld the horisontal wooden planks that wraps around the house into the model itself, to make it a single object - no result

Requesting help, cause I can not understand the proper set up for lightmaps, though there are a lot of examples in the internet and in the documentation.
PS: I understand there’s a lot of wasted uv space, but even if I would order it tight, there won’t be a significant change. I will do it later, but now it’s just for the sake of testing

[spoiler]
22d6f6d2857ed05913a8c4113274773bcdb56d05.jpeg


8b95b2a493074c22d8fda7abc9f751f66ca6611a.jpeg
[/spoiler]

The lightmap resolution is too low. But part of the issue is also too many separate objects and that for a single object you want to have UV islands that are similar in size, so those islands would need a larger lightmap to get enough detail but the large islands don’t need the increased resolution so you end up wasting resolution on large areas just to get more detail on the small parts. But there’s ways to model something like that so that you don’t have so many small objects.