Cannot build lighting for a (previously working) level


my team and I have recently transitioned our project from UE 4.11 to 4.14.

We’re having a lot of troubles changing the lighting for one of our levels.

If we reuse the old lighting actors, no problem emerges. As soon as we introduce different lighting actors (even just a default light source), or change the parameters of the old working actors, a crash occurs. Actually Lightmass manages to build the lightmaps, but when it comes to import them, the loading bar always stucks at 14% and UE crashes.

I’ve also observed that:

  • The crash is independent from the usage of Lighting Scenarios.
  • The new lighting we’re trying to implement works perfectly with other levels.
  • The crash occurs even if I copy all the actors in a fresh level.

After the new lighting build crashes, I can see these lines in the project log:

[2016.12.19-09.38.41:114][974]LogWindows:Error: === Critical error: ===
[2016.12.19-09.38.41:115][974]LogWindows:Error: Fatal error: [File:D:\Build\++UE4+Release-4.14+Compile\Sync\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp] [Line: 791] 
[2016.12.19-09.38.41:115][974]LogWindows:Error: Rendering thread exception:
[2016.12.19-09.38.41:115][974]LogWindows:Error: Assertion failed: SizeX <= GetMax2DTextureDimension() [File:D:\Build\++UE4+Release-4.14+Compile\Sync\Engine\Source\Runtime\Windows\D3D11RHI\Private\D3D11Texture.cpp] [Line: 469] 
[2016.12.19-09.38.41:319][974]LogExit: Executing StaticShutdownAfterError
[2016.12.19-09.38.43:234][974]LogWindows: FPlatformMisc::RequestExit(1)

First off, differently from other versions of the engine, I cannot manage to find RenderingThread.cpp and D3D11Texture.cpp on my machine (isn’t this fact alone suspicious?).

In any case the log mentions:

Assertion failed: SizeX <= GetMax2DTextureDimension()

What does this exactly mean? Is there a lightmap considered too large to be imported? And how can I prevent this from happen? So far all the parameters I’ve touched have done nothing good.

Thank you for your time.

I was getting a crash like this once upon a time. My issue was that one of my instanced foliage actors had too many instances. The lightmap area needed to hold all the lightmap information was bigger than my maximum lightmap resolution. The solution, then, is to either increase the maximum lightmap resolution or split up any actors with big lightmap usage into multiple smaller ones since the instances all need to be on the same lightmap.

Thanks for your answer! Unfortunately the issue is not caused by the foliage, but I sense that our lightmaps could actually be exceeding the maximum resolution.

Finally I’ve found the issue.

Among 5000+ actors, there was a single ■■■■ mesh with an enormous value in its Z-coordinate. Like thousands of billions.

I don’t actually know if it has been mistakenly left there by some level editor, or by some bugged automation (in the engine or plugins). Since the actor didn’t have a mesh set, I’m more inclined to think it was a bug.

In any case, what I do know is that it’s not the first time this kind of issue gives me really bad headaches. Some coordinate checks from the engine would surely be appreciated, to prevent such fatal malfunctionings.

Hi Jacopo,

Can you provide the following info or try the suggestions.

  • What size lightmaps are you using for you foliage? Default values should never be used when using lots of foliage, instead, you should enable “Lightmap Resolution” and use a lower value like 16/8/4. Since these actors are clustered together they get packed into a lightmap. Using lower lightmap values can reduce build time and smaller size on disk.
  • If you use a lower lightmap resolutions for the foliage and any other assets in your level do you still get the crash?
  • Looking at your Log from the Crash Report submitted it looks like you have 8GB RAM. is this correct? If so, it could be running out of memory when building lighting, although, that typically produces a MapCheck window with “Lightmass Crashed” error.
  • RenderingThread.cpp and D3D11Texture.cpp: What type of build are you using? GitHub or Binary release from the Launcher. If it’s from GH you may want to recompile or redownload and compile the engine to see if these files are included. I see them in all builds I have currently, GH and Binary releases.
  • “The new lighting we’re trying to implement works perfectly with other levels.” Is there anything specific to this style of lighting that is worth noting? I really don’t suspect anything here since you’re getting the crash that happens with the light build. That’s typically going to fall back on the lightmap textures and RAM usage for the bake and CPU power vs just what’s set in a light setup. Unless you’re tweaking some of the settings in the World Settings: Lightmass. That can definitely have an impact.
  • Swarm Agent Verbose Log

If it’s only reproducible with this level and none of the suggestions above work, can you migrate it to a blank project and see if you get the crash, if so, Can you share that with me to see if I can reproduce on my end.


Hi there,

first of all sorry for the late answer - I’ve been annihilated by other tasks.

As a said in a previous post, I fortunately managed to solve the issue, but thanks for your kindness. The problem was an empty static mesh actor whose coordinates sent it in outer space… it was producing an enormous lightmap.

Regarding your questions:

  1. For the foliage lightmaps we’re using a resolution of 8. The foliage surely wasn’t causing the issue, because even with no foliage at all the build was crashing.
  2. Yes, I have 8GB of RAM. In this specific case I was not running out of memory, although that often happens on my machine (I’m not actually responsible of the lighting build).
  3. RenderingThread.cpp and D3D11Texture.cpp: I have a Binary release from the Launcher. Trying to recompile the engine, I realised that not just those two files were missing, but all the .cpp’s. I had to refresh the Visual Studio Project from UE4 Editor, then all the source files showed up.
  4. We’re working a lot on the Lightmass World Settings, but the crash was happening with all sort of values (even the defaults).
  5. I forgot about the Swarm Agent log verbosity, thanks for the reminder :slight_smile:


How did you get this? I cannot find the problematic actor.

Hi! I had to check them all one by one… but you could program a script which checks the coordinates looking for enormous values, if this is the same case as mine.