x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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 - alt text

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 -alt text

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) - alt text

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. :)

Product Version: UE 4.17
Tags:
more ▼

asked Sep 07 '17 at 08:06 PM in Using UE4

avatar image

the_tubby1
28 6 6 11

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Sep 07 '17 at 09:41 PM

avatar image

Deathrey
7.7k 129 29 289

avatar image Nuclear Arbitor Sep 11 '17 at 01:15 PM

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

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. alt text

edit: i'm tired; i said offense intended when i meant none :|

seam-guide.jpg (248.3 kB)
avatar image the_tubby1 Sep 25 '17 at 01:23 PM

No offense taken XD. I am very aware the second unwrap is a pile of shit, 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.

(comments are locked)
10|2000 characters needed characters left

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. - ![alt text][1] and the Lightmap - ![alt text][2]

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 - ![![alt text][3]][3]

bear in mind that the lightmap resolution for this object is set to 512. [1]: /storage/temp/224669-tree-image.png [2]: /storage/temp/224670-blender-uv-image.png [3]: /storage/temp/224713-screenshot00009.png

tree-image.png (117.6 kB)
screenshot00009.png (434.1 kB)
screenshot00009.png (434.1 kB)
more ▼

answered Dec 22 '17 at 01:04 PM

avatar image

the_tubby1
28 6 6 11

avatar image Makigirl Dec 23 '17 at 04:02 PM

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... alt text

ligthuv.jpg (653.2 kB)
avatar image the_tubby1 Dec 23 '17 at 05:39 PM

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.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question