Broken lightmaps when building static lighting with foliage/HISMCs and normal maps

This is the original thread on the forums with all the screenshots and videos:

In short, using static lights, having “Use normal maps for static lighting” option on in the Project Settings and having foliage/HISMCs breaks lightmaps.

I sent a download link to a private project with broken lightmaps to Tim Hobson via PM on the forums and he requested for the forum’s post to be moved here as Bug Report.

Worth mentioning that once broken, there is no way to fix it (migrating content into a scratch project doesn’t help any longer).

Small update - the same bug happens in 4.13.0 preview 1 (just finished building lighting)

Alright, I did more digging. Here is what I found out.

My terrain material:

https://s10.postimg.org/fsz8vzo6x/ue4_broken_lightmaps3a.png

full:https://s9.postimg.org/ohj9sx9rh/ue4_broken_lightmaps3a.png

causes broken lightmaps (although it was working fine in 4.11 and worked fine until I placed foliage/HISMCs into the level):

https://s10.postimg.org/kd92lkew9/ue4_broken_lightmaps3.png

full: https://s9.postimg.org/radyaigl9/ue4_broken_lightmaps3.png

After modifying material like that:

https://s10.postimg.org/ef9bdzstl/ue4_broken_lightmaps4a.png

full: https://s9.postimg.org/u7fbg4iql/ue4_broken_lightmaps4a.png

the blotchyness/brokenness is gone:

https://s10.postimg.org/7qjti8189/ue4_broken_lightmaps4.png

full: https://s10.postimg.org/twemktmaf/ue4_broken_lightmaps4.png

but I am left with these horrible artifacts (looks like compression related, but again, was not present in 4.11 and 4.12.5 scratch scenes, before foliage/HISMCs):

https://s9.postimg.org/4ovnnxsb3/ue4_broken_lightmaps5.png

full: https://s10.postimg.org/dw4ncpelj/ue4_broken_lightmaps5.png

Hopefully it will be of help trying to figure out what’s going on - I am out of ideas :confused:

Thanks for posting the info. I’ll get to this tomorrow or Thursday once I get some other work out of the way. Thanks for posting the updates! this certainly helps.

Yesterday I tried using tiling normal map (generated new tiling diffuse and corresponding normal map using Substance Player and one of the free available substances). Didn’t get any “pixelation” or any other artifacts.

Is there a way to have no compression on normal map texture (to use RGBA instead of Normal DXT5) ? If I could use uncompressed normal map, I could verify that those are texture compression artifacts or not (and perhaps could use uncompressed global normal map for my terrain).

I am not sure if this will be a private reply, but I can’t have standard UV map that utilizes full 0,1 space. Here is why - the normal map is baked from whole high poly terrain and it defines large, global shape of the entire terrain. Then low poly terrain is chopped into chunks, LODed, and exported into UE4. Here is video showing how/why it’s done the way it’s done:

Note that diffuse texture is tiling (and has no corresponding normal map), while normal map is not tiling. So it’s impossible to have UV map for normal map occupy entire UV space.

Even if I didn’t use global normal map and instead used tiling normal map that corresponds to tiling diffuse map (small waves of sand), I’d still have to do it the way I did it to avoid seams between chunks (as it would be impossible to scale each chunk’s UV to be in exact same scale as neighboring chunk’s UV map)

If this was for PC/console, I wouldn’t have to cut terrain to chunks and then entire terrain would be in 1 piece and its UV would occupy whole UV space (or I’d use Landscape instead of static mesh). However I have to do this trickery for mobile tiled render :confused:

P.S. I just noticed that you can easily see it on your screenshots - on the first one, you see shape of dunes, its’ ridges and curvature. On the second screenshot you can’t see it - all you see now is diffuse map only. All global details are gone because you moved and scaled UV isle and now it doesn’t correspond to the details on the “global” normal map.

So, a miracle happened:

https://s9.postimg.org/vsj3rigwv/ue4_fixed_lightmaps1.png

full: https://s10.postimg.org/ve3xzevon/ue4_fixed_lightmaps1.png

All I really did was tweaking the material:

https://s9.postimg.org/y0703nlu7/ue4_fixed_lightmaps1a.png

full: https://s9.postimg.org/3te22lj71/ue4_fixed_lightmaps1a.png

Not sure if it makes any sense as I only lerped normal map with flat normal map and swaped order in which they are being lerped.

I think this issue is connected to this: UE 4.12 is the worst build for mobile VR - massive performance issues out of nowhere - XR Development - Unreal Engine Forums in a sense that without my setup for normal map, I either get no normal map or corrupted normal map or nice normal map with horrible performance when looking straight down on the terrain while standing on it (if I get away from the terrain and look down from above, I get no performance drop)