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

**URL:** <https://forums.unrealengine.com/t/broken-lightmaps-when-building-static-lighting-with-foliage-hismcs-and-normal-maps/366448>\
**Category:** World Creation\
**Tags:** normal-map, static-lighting, unreal-engine, Foliage, bug-report, Lightmap, question\
**Created:** [August 8, 2016, 4:16am UTC](https://forums.unrealengine.com/t/broken-lightmaps-when-building-static-lighting-with-foliage-hismcs-and-normal-maps/366448 "2016-08-08T04:16:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [August 8, 2016, 4:16am UTC](https://forums.unrealengine.com/t/broken-lightmaps-when-building-static-lighting-with-foliage-hismcs-and-normal-maps/366448/1 "2016-08-08T04:16:18Z")

</div>

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

> **[Sick and tired of UE4 having its own mind - suddenly broken lightmaps](https://forums.unrealengine.com/showthread.php?118149-Sick-and-tired-of-UE4-having-its-own-mind-suddenly-broken-lightmaps)**
>
> I’ve been working on my project since UE 4.9 (mostly evenings, sometimes weekends). Yesterday I decided to rebuild lighting (UE 4.12.5; re-built lighting several times using this current version). After I did it, lightmaps became completely broken: ...

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.

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [August 8, 2016, 4:26am UTC](https://forums.unrealengine.com/t/broken-lightmaps-when-building-static-lighting-with-foliage-hismcs-and-normal-maps/366448/2 "2016-08-08T04:26:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [August 9, 2016, 1:21am UTC](https://forums.unrealengine.com/t/broken-lightmaps-when-building-static-lighting-with-foliage-hismcs-and-normal-maps/366448/3 "2016-08-09T01:21:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [August 10, 2016, 12:55am UTC](https://forums.unrealengine.com/t/broken-lightmaps-when-building-static-lighting-with-foliage-hismcs-and-normal-maps/366448/4 "2016-08-10T00:55:43Z")

</div>

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

My terrain material:

[https://s10.postimg.org/fsz8vzo6x/ue4\_broken\_lightmaps3a.png](https://s10.postimg.org/fsz8vzo6x/ue4_broken_lightmaps3a.png)

full:[https://s9.postimg.org/ohj9sx9rh/ue4\_broken\_lightmaps3a.png](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](https://s10.postimg.org/kd92lkew9/ue4_broken_lightmaps3.png)

full: [https://s9.postimg.org/radyaigl9/ue4\_broken\_lightmaps3.png](https://s9.postimg.org/radyaigl9/ue4_broken_lightmaps3.png)

After modifying material like that:

[https://s10.postimg.org/ef9bdzstl/ue4\_broken\_lightmaps4a.png](https://s10.postimg.org/ef9bdzstl/ue4_broken_lightmaps4a.png)

full: [https://s9.postimg.org/u7fbg4iql/ue4\_broken\_lightmaps4a.png](https://s9.postimg.org/u7fbg4iql/ue4_broken_lightmaps4a.png)

the blotchyness/brokenness is gone:

[https://s10.postimg.org/7qjti8189/ue4\_broken\_lightmaps4.png](https://s10.postimg.org/7qjti8189/ue4_broken_lightmaps4.png)

full: [https://s10.postimg.org/twemktmaf/ue4\_broken\_lightmaps4.png](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](https://s9.postimg.org/4ovnnxsb3/ue4_broken_lightmaps5.png)

full: [https://s10.postimg.org/dw4ncpelj/ue4\_broken\_lightmaps5.png](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 😕

---

<div class="post-metadata">

**Author:** ![Tim\_Hobson](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tim\_Hobson](https://forums.unrealengine.com/u/Tim_Hobson)\
**Post date:** [August 10, 2016, 2:40am UTC](https://forums.unrealengine.com/t/broken-lightmaps-when-building-static-lighting-with-foliage-hismcs-and-normal-maps/366448/5 "2016-08-10T02:40:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [August 12, 2016, 1:34pm UTC](https://forums.unrealengine.com/t/broken-lightmaps-when-building-static-lighting-with-foliage-hismcs-and-normal-maps/366448/6 "2016-08-12T13:34:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [August 12, 2016, 9:18pm UTC](https://forums.unrealengine.com/t/broken-lightmaps-when-building-static-lighting-with-foliage-hismcs-and-normal-maps/366448/7 "2016-08-12T21:18:35Z")

</div>

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:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/d/d/6dd74dc3c4aaab423cd1c0acb664899c0479f70d.jpeg "ss2 dev stream 24") ](https://www.youtube.com/watch?v=_iWNcmuaW-M)

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 😕

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.

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [August 13, 2016, 5:10am UTC](https://forums.unrealengine.com/t/broken-lightmaps-when-building-static-lighting-with-foliage-hismcs-and-normal-maps/366448/8 "2016-08-13T05:10:29Z")

</div>

So, a miracle happened:

[https://s9.postimg.org/vsj3rigwv/ue4\_fixed\_lightmaps1.png](https://s9.postimg.org/vsj3rigwv/ue4_fixed_lightmaps1.png)

full: [https://s10.postimg.org/ve3xzevon/ue4\_fixed\_lightmaps1.png](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](https://s9.postimg.org/y0703nlu7/ue4_fixed_lightmaps1a.png)

full: [https://s9.postimg.org/3te22lj71/ue4\_fixed\_lightmaps1a.png](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.

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [August 16, 2016, 3:56am UTC](https://forums.unrealengine.com/t/broken-lightmaps-when-building-static-lighting-with-foliage-hismcs-and-normal-maps/366448/9 "2016-08-16T03:56:15Z")

</div>

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](https://forums.unrealengine.com/showthread.php?120231-UE-4-12-is-the-worst-build-for-mobile-VR-massive-performance-issues-out-of-nowhere) 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)
