Maps need lighting rebuilt

Hello there!

I feel very silly for asking this, I’m sure the answer is quite simple, but I can’t figure it out. And I’ve seen nothing on the forums or here regarding the issue.

Ever since I updated to 4.7 I’ve been getting the error “Maps need lighting rebuilt” Every time I try to rebuild the scene. I’ve tried building light only and it does nothing. When I select Build Geometry, that’s when the error pops up. I’ve tried different projects, new projects and the same happens.

I use 4.2 for the current project I’m working on and the light building works perfectly, but I just can’t figure out what I’m doing wrong in 4.7.

Any help will be most welcomed.

Cheers!

Does a build all (as opposed to lighting only) solve it? There’s a bug in 4.7 where building lighting only won’t rebuild BSP geometry which could lead to this.

Another thing to try - set ‘r.Shadow.WholeSceneShadowUnbuiltInteractionThreshold 100000’ before loading your built level. If that gets rid of the message, you’re hitting a different bug that will be fixed in 4.8 wrt ‘lighting needs to be rebuilt’ message showing up incorrectly.

I’ve done all kinds of rebuilding and nothing. I tried 4.6 yesterday and I got the same error. But today I’ve tried 4.5 and it works wonderfully! The problem is not with the lighting per se, it is when I try to build the geometry.

Sorry, mate, but I don’t know how or where to set set ‘r.Shadow.WholeSceneShadowUnbuiltInteractionThreshold 100000’. Could you please explain. Thank you.

I don’t really know whether this fits your problem, but I had a similar issue as well. I rebuilt the lighting for my map, and it looked okay (PIE didn’t tell me that lighting needs to be rebuilt after a rebuild). However, I then saved everything (without touching ANY object!), and after I reopened my map, lighting needed to be rebuilt again!

My issue was, that I didn’t know what was causing this issue, since I don’t have procedural generated levels and my level is quite huge. So I added some c++ code which told me which object was causing the issue:

void ATLL_PlayerController::DebugLightingOutput()
{
#if WITH_EDITOR
	UE_LOG(LogMainMenu, Warning, TEXT("Finding objects which need lighting rebuild..."));
	for (TActorIterator<AActor> ActorItr(GetWorld()); ActorItr; ++ActorItr)
	{
		const int32 numInteractions = ActorItr->GetNumUncachedStaticLightingInteractions();

		if (numInteractions > 0)
		{
			UE_LOG(LogMainMenu, Warning, TEXT("Actor Name: %s"), *ActorItr->GetName());
			UE_LOG(LogMainMenu, Warning, TEXT("Actor Location: %s"), *ActorItr->GetActorLocation().ToString());
			UE_LOG(LogMainMenu, Warning, TEXT("Num Interactions: %d"), numInteractions);
		}
	}
#endif
}

I put this into my player controller since I had to use “GetWorld()” and I wanted to output a list of all invalid objects on a button press.

It turned out, that I had a blueprint with an “Actor” component (which added another actor to this blueprint as a component) and this was causing the issue after a reload. In my case, I avoided the error by making this actor a dynamic actor so that it wouldn’t have static lighting.

Hope this helps in any way.

Btw., maybe Epic could add a way for us to get a list of all actors / components in our level which needs lighting to be rebuilt - IN THE EDITOR. I googled and it seems there was console command for that in UDK, which is still mentioned in UE4 but was removed.

I’m having the exact same problem. But I’m in 4.15. Of course, errors on deadline day too.