I am trying to import few meshes (big medieval houses) into my model but no matter what I try, after building lights in UE4 I get crazy shadow patches all over my mesh. I’ve researched it and tried few solutions proposed by other folks but nothing works. If I generate the lightmap in my 3D software, I get crazy ugly results. if I let UE4 generate it, it looks much better but then I get the overlapping UVs error. some people suggested aligning the UV islands directly on the grid lines and make sure they have good margins. I have 1000s of UVs in each model, that’s going to take me ages.
I am honestly pretty frustrated with UE4 recently. I find myself spending more time troubleshooting and debugging rather than building my scene. (not to mention the times it crashes on FBX imports but that’s a known bug in 4.5.1 I guess)
at the moment, any help will be appreciated.
p.s: is this a UE4 only issue? every time I searched for overlapping UVs, bleeding shadows on google, I got either UE4 or UDK related threads. I am just wondering if Unity users face the same nightmare
This also happens in Unity. Sadly I usually do this the old fashioned way, hand by hand… even if there are 1000s of UVs… There are a few softwares which advertise themself for fixing this exact issue, but I highly doubt it, it would work for every single model, because every model is different, though I haven’t tested it ,myself.
I though I should repost the solution I found to this issue. This is relevant only if you use Blender as your primary modeling tool.
The solution is based on the tutorial posted by a very nice German guy in the UE4 wiki:
create a second UV channel inside Blender.
select the UV channel.
Open the Image/UV editor and create a new Image. accept the defaults and click OK.
from the 3D viewport select your object and switch to edit mode.
select the entire geometry (A key) and press U. Select Smart UV project.
in the UV editor, select all the uv islands and click on UV → Average UV and then UV → Pack UV islands.
Change the margins to 0.004
in UE4, import your mesh, make sure to uncheck “generate lightmap UV”. Open the static mesh and change the lightmap resolution to 128.
I found this to work 99% of the time and I was so happy so I decided to post the solution. hopefully someone can find it useful.
for an interactive tutorial I would suggest following the original tut posted on the UE4 wiki.
All the credit go to this person, not me
This was made by Phillip (Fighter5347), who is one of our moderators and he is very active with the community!
I also wanted to address a few of your concerns you mentioned in your original post as well:
If I generate the lightmap in my 3D
software, I get crazy ugly results. if
I let UE4 generate it, it looks much
better but then I get the overlapping
The generated LMs within UE4 are great at re-packing your texture UVs. However, it will not create new edge seams and break apart any UV islands to repack. This is why the Overlapping UV error is more than likely happening. If everything in your texture UV has been separated into Uv islands and split well enough the repack should go off without a hitch. Also, it’s always good to check to make sure that the 2nd UV for lightmaps is being used, which you can find under the Mesh Editor > Details Panel > Static mesh Settings > Lightmap Coordinate Index = 1 (or whatever channel will be used for your lightmap. 0 is default texture, 1 is default LM UV)
(not to mention the times it crashes
on FBX imports but that’s a known bug
in 4.5.1 I guess)
This is a bug that is still affecting some. (UE-3032) This one is happening when you import the mesh and you have the option “generate lightmap UVs” checked (is checked by default) and it cannot generate properly because the mesh UV is too complex or has unbroken edges. This will cause the crash. 99% of the time unchecked this on import will not crash the editor.
is this a UE4 only issue? every time
I searched for overlapping UVs,
bleeding shadows on google, I got
either UE4 or UDK related threads. I
am just wondering if Unity users face
the same nightmare
This is not a UE4 or UDK only thing. Unreal just makes sure you’re aware of the issue by giving the “Lightmaps are overlapping” warning and the “Lightmaps need to be rebuilt” warning. Lightmaps are common in games, even with last gen and new generation games. They are a great way to get good shadow resolution with minimal overhead of having to do everything with dynamic lighting, which can hamper FPS depending on your scene complexity.
Lightmapping will not be going away anytime soon, until dynamic lighting solutions can provide similar results that static lighting can.
If you have any specific questions feel free to ask. I am very active in the community with lightmapping and helping community developers with their troubleshooting.
Thank you very much for taking the time to answer all of my concerns. everything is now super clear to me and makes a lot more sense.
if its not too much to ask, would you mind responding to my other post regarding VS 2013 performance with c++ and UE4. few folks replied back but I haven’t really got this to work. I would love to get into c++ scripting at some point.
if its not too much to ask, would you
mind responding to my other post
regarding VS 2013 performance with c++
and UE4. few folks replied back but I
haven’t really got this to work. I
would love to get into c++ scripting
at some point.
Honestly, I’m not a programmer so it’d be difficult for me to say specifically. However, I did assign this to one of the other guys on our support team. Hopefully they’ll be able to provide some insight into what’s going on and if there are some things that can improve it’s performance.