Lighting "always" needs to be rebuilt


I’m not sure what’s changed in my project to cause this as I’ve not had problems until recently…

I build lighting (any quality level), Swarm finishes building (thankfully I’m running this distributed over 6 machines so it only takes 15 mins or so…) Lighting appears to be rebuilt.

As soon as I hit play in the editor the message pops up “Lighting needs to be rebuilt (16 unbuilt objects)”. Even though I’ve just built it and it’s been successfully imported!

This is really frustrating and I’ve no idea what’s caused this to start happening. Is there any way to find out what these “unbuilt” objects are?


I’ve set some of my lights to “stationary” instead of “static” and the number of unbuilt lighting objects goes down when running… Is there a specific setting on a static mesh/object within the radius of one of the lights that would be causing this?


Quick update on this - should anyone have the same problem again.

There’s definitely a bug somewhere… I cleaned out the Intermediate and Saved folders rebuild lighting and it works fine in PIE on my laptop. If I package it, lighting breaks as soon as I run the .exe!

I copied the project (with lighting already built) to another computer with UE4. Packaged the content on there, lighting is fine when running the .exe!

It would be great to get to the bottom of why the packaging is breaking on my laptop…?

I had this issue as well, in my case it was caused by using the “light as if static option” on movable meshes. As soon as one of these meshes touched the radius of a light that it did not touch in its initial position the “lighting needs to be rebuild” message would pop up.

This also happened when the mesh was moved in a packaged game. Maybe this is also happening in your scene?

This is usually a bug. Enter the console command ‘DumpUnbuiltLightInteractions’ in game and post what it says, that can give a clue as to which objects are causing the problem.

Blueprints that add static meshes with Static mobility in a construction script are a common cause. Also, foliage with too many instances to fit them all in one texture.

Thanks for the info Arnage, I was able to repro and fix that bug, the fix will be in the upcoming 4.8 release.

Sorry for the long delay in responding back DanielW.

I think I may have accidentally found the solution today though.

The space on my laptop was running low for no good reason. I eventually narrowed it down to the UE4 derived cache data in my user profile. There was 30gb or so of stuff sitting in there. I did some googling and found out it was OK to delete all of this as it gets regenerated as required.

Since then lighting builds on my laptop no longer seem to have this issue. :slight_smile:

So question on this, you note that foliage with too many instances for them to all fit into one lightmap. I don’t see this anywhere in documentation but how do you go about making more instance clusters of foliage. So for example we have a forest scene and all the foliage is in one group but there are not layers to foliage correct? When I am in Foliage select mode there is only the option to “select all”. How do I get instances in different clusters? I am getting Unlit errors after lighting only on my two foliage levels an none of the others.

Hi Daniel, I am experiencing this issue due to the exact reason you described.

What is the workaround for this? It seems like it should be a perfectly valid use case to build out a procedural layout and lightmap it using Unreal’s great tools for doing both, but unfortunately this does not seem to be possible…