Correct way to lightmap?

Hi there,
I am fully aware of the many, many tutorials, questions and tips out there to finding the correct way to lightmap but these methods either aren’t working for me the way I feel they should, or i’m missing something crucial.

I have many models but for this question I’m going to use this specific one as my example -

This model is fairly complex despite its lowpoly style and for it to look half decent in UE4, it needs to be correctly lightmapped.

It has a texture UV which is done in blender with a simple “Smart UV Project”. Nothing fancy, just gets the faces on my simple texture. Here is a screenshot of what that looks like -

Now here is where I feel the issue is. I created a second UV map for the lightmap which, when unwrapping, I use “lightmap pack”. What I don’t know is the correct image size i’m supposed to use or the margin. Heres what my lightmap looks like and the settings I have. (Once the uvs are unwrapped I use Ctrl-A, and Ctrl-P to separate the faces and add space between them) -

Now in UE4, I always seem to need a high lightmap resolution. some lighting issues don’t go away unless I put up the LR as high as 1024 which i generally try to avoid doing as it seems to me to be unnecessary for such a model. I have used the other method of generating a lightmap through Unreal. this is still followed by the same issue. In general, my question is - Am I doing something wrong? Is there something I’m not seeing? Please help in any way you can without just sending me to some site I’ve likely already been to. Thanks for the help in advance. :slight_smile:

There is no unified “proper” way of unwrapping for lightmap, but there is a set of guidelines and recommendations.

In your particular case, generated lightmap UVs seem quite impractical for given model. Use much lower number of separate UV islands. For example, whole outer surface of the log can safely be a single UV island.
As for knowing correct lightmap size in advance, well of you can either approximate it in advance, eyeball it, or rely on UE4’s lightmap packing.

to expand on this, neither of your unwraps will work well for lightmaps and your second one is, no offense intended, complete ■■■■.

your first unwrap is clearly intended to use a palette of flat colours (at least for the base colour), which is ok. with that said, you should still have those islands taking up as much of their palette as possible (leave just a bit of padding. since your colours are flat, the texture itself can then be VERY small (1 pixel per palette colour). or the texture could be bigger, doesn’t really matter.

the second unwrap is just horrible in general. it’s conceptually similar to ptex but has a lot of practical issues. as a rule of thumb, you want as few islands as possible and you want those islands to be as big as possible. what you have done here is, in effect, to not use UVW mapping by breaking out each face. this is bad as it requires a LOT more padding. in your case you might actually have more padding then face. this results in a lower quality texture for a given size. as an example, you basically have to use 1024x1024 worth of memory for 512x512 worth of texture (that’s 4 times the memory).

i did a very rough seam guide for you on the main log.

edit: i’m tired; i said offense intended when i meant none :expressionless:

No offense taken XD. I am very aware the second unwrap is a pile of ■■■■, which is why I posted a question knowing it truly sucked but it was the only suggestion people gave when exporting from blender to UE4. I’m going to give your suggestions a test and see what I can come up with; been trying to find out a solution for weeks now and it is really pulling me away from game development in general until I can actually fix such an insignificant issue. Thanks for the response, i’m replying a little late because I didn’t get a notification another answer was posted for some reason. I’ll let you know how it goes.

Reviving this - I’ve done a lot to lightmaps since this post and am still having trouble. Here is a different model to show how I’ve used seams and such to unwrap a model and the result -

The model - Simple in design but a pain none the less. -

and the Lightmap -

Now I thought that the lightmap i had prepared would be fine. it had padding and was within the bounds and uses as few islands as possible; everything everyone says to do for lightmaps. Here is what it looks like in UE4 however -

][3]

bear in mind that the lightmap resolution for this object is set to 512.

Hi!

I think you’re still not on the right track…
Faces/islands that don’t share the same “kind” of light information /at hard edges/ should be separate!
Like the top and bottom part of a “skirt” should NOT be connected (one of them is fully lit the other is almost dark)! Your padding is also VERY low between these parts, they are touching each other. This will also give you artifatcs! :S
I did a “sketch” in photoshop how I would lay the lightmap uvs…

I guess that elaborates a little more on what I’m looking for. I will have to try that layout at some point. for now, my project is using dynamic lighting to avoid the use of baked lighting which is fine for the type of project. Not entirely sure what the problem with dynamic lighting is yet as of yet, maybe performance cost? anyway, I’ll try that type of Uv out and get back to set it as an answer if I don’t run in to more issues. Thanks.