Lightmaps for non-rectangular objects

I apologize for what seems like it should be an obvious question, but I have been pulling my hair out trying to squeeze the answer to my issue out of Google and this site’s search functions.

How do I configure my lightmap UV so that non-rectangular objects (i.e. lots of oblique faces) don’t end up with nasty seams?

I have tried in a variety of configurations, but no matter where or how I try to configure my shells, I end up with these mismatched edges. The only thing I have not tried is aligning my faces to the grid on my UV map, because they are triangular faces, so I can’t do that.

I have no issues lightmapping simple rectangular objects, because every single tutorial/demo of lightmaps I can find restricts itself to such objects. I found only one page that even came close to discussing spheres, but it was for spheres with smooth-shaded faces, which are not what I want.

Is the answer simply that what I want is impossible in this engine? Is it required that meshes have some “unseen side” where the ugly seams are to be hidden? Is it impossible to have a properly shaded icosphere from all angles?

Thank you!

Hi Neuropolitan,

It would be helpful to see the UV layout for your Lightmap as well.

To avoid seams you do not need do a flat mapped UV where the faces are separated, but keep the object as a single UV island that has been pelted. If you’ve separated the individual faces you will get artifacts like this. Tree it similarly to unwrapping a sphere and let the smoothing groups do the rest.

The documentation here can help: Understanding Lightmapping in Unreal Engine | Unreal Engine 5.1 Documentation

-Tim

Hello Tim, thank you for the response!

I have seen this word ‘pelt’ floating around but can’t seem to find any info on it. I have thoroughly reviewed the article you posted before, but the term pelt does not appear in it. Google’s doing that thing where even if I put “pelt” in quotes it decides that term is less relevant and shows me generic lightmap results. Are you suggesting the entire sphere can be one UV island? I have tried a range of UV configurations, from every-face-separated and padded to only two islands split along the center of the sphere. That’s of course my confusion, it seems the island would have to have a seam somewhere…? Unless this ‘pelting’ is somehow allowing every side to stay welded without overlap or wacky stretching?

If it’s still helpful to see my UVs I can pull some out, but like I said I’ve tried about six configurations and no matter where I put the seams it glitches there.

Looking at the results above, I don’t think it’s necessary to really see the UVs, but typically when asking lightmapping questions it’s really helpful to see how the UVs are laid out to offer feedback and more quickly see where the issue may be.

I really only use 3Ds Max and Maya, so I’m not sure if Pelt Mapping is a term reserved for those programs. It may be called something else in Modo, Blender, and other modeling programs.

This has some tutorials for 3Ds Max and other programs that should at least give you a general idea how to proceed.

As far as worrying about stretching that’s not really a concern with Lightmaps. Overlapping faces is a bigger concern. UV Stretching to some degree is relatively OK.

I’ve made a simple test project with the following setups for 4 different examples to hopefully show some ways to go about this and final results. The first row has no objects casting shadows and the results are pretty equal across the different spheres regardless of lightmap. However, if you look at the next row with the colum casting shadows you can clearly start to see the shadow errors, especially on flat mapped.

UV Example Project

  1. Unwrapped lightmap to be two halves of the sphere and set Lightmap Coordinate Index to 1.
  2. Used the default Sphere unwrap for 3Ds Max. Lightmap Coordinate Index is set to 0.
  3. Flat Mapped so that each face is separated. Notice the artifacts between the faces. Increasing Lightmap Resolution helps, but still shows errors. Especially on the lower LM resolutions.
  4. Smoothed sphere using lightmap with two halves like #1.

Anywhere there is a seam in the UV when shadow casting across it can show some artifacts like the split. Using higher resolutions can hide this a bit better, but also having a different layout for the UV can help.