Project Settings > 'Allow Static Lighting' vs. World Settings > 'Force No Precomputed Lighting'

Does anyone know, what the difference between both of these options to disable static lighting is? I did find some infos, that these are the same, but do not believe this.

From the fact, that disabling Static Lighting in Project settings did result in a huge ‘shader recompile’ I deduce, that this might be the better (= more optimized) way to do it.

Anyone who can comment on this?

BTW: rebuild lighting with Force No Precomputed Lighting - I found, that the Lightmaps in the World Settings are still shown, so need to close World Settings window and reopen to reflect the changes.

and, slightly off topic: what about Precomputed Visibility, which is tightly coupled to lightmass? Did not do any tests here…

1 Like

Checking “Force No Precomputed Lighting” and starting a lighting build is the best known way to eliminate your baked lighting.

Thank you for the reply. Can you explain, what the differences are and why this is the better approach?

Hi @herb64

It depends.
But the main difference is if you disable it from project settings then it will affect the entire game (all levels), while in the world setting you can do it per level - so for example if you have levels that you don’t want/need any static light you can make sure of it with check the box of “Force No Precomputed Lighting” while other levels still use static light.

Hope that helps.

1 Like

Hi @Loki8Toki , thank you. This is a very good argument. I did a check in shader complexity, looks like the generated shaders are the same in terms of performance - I just was unsure because of the tons of shaders, that did get compiled on first editor restart after disabling static lighting in project settings.
EDIT: revisiting these options again because of other problems, did a check and found, that disabling Allow Static Lighting in Project settings is slightly cheaper than using Force No Precomputed Lighting in Lightmass settings. Its absolutely not an issue at all, just wanted to share this observation.

1 Like

Revisiting that thread again. In my original post I mentioned, that I did not yet test Precomputed Visibility with these options. I now did find some issues with this.

In short:

  • It looks to me like a bug, that the Force No Precomputed Lighting does also delete any existing Precomputed Visibility Cells instead of just removing existing lightmap textures.
  • Also it is weird, that unchecking Allow Static Lighting does not allow to create Precomputed Visibility. While Build > Build Lighting Only is grayed out, Build > Precompute Static Visibility is still available.

I understand, that Precomputed Visibility relies on Lightmass (I assume it uses some functionality within Lightmass that does not need to be reinvented) - but I do not see any reasons, why Visibility Cells should not be working without having baked lightmaps. One is Occlusion culling related, the other purely rendering.

Some more details of what I did:

Issue #1:
Disabled static lighting in Project Settings by unchecked “Allow Static Lighting”.

  • Build > Build Lighting Only is now grayed out (as expected)
  • Build > Precompute Static Visibility is still available - indicates, that this funcionality is meant to be available also with disabled static lighting

But using the Precompute Static Visibility function leads to
LogStaticLightingSystem: Warning: WorldSettings.bForceNoPrecomputedLighting is true, Skipping Lighting Build!
Any potentially existing Visibility Cells (r.ShowPrecomputedVisibilityCells) are deleted immediately in this case and there’s no way to recreate them.

Issue #2
Switch on Allow Static Lighting in Project settings again.
Now it is possible to rebuild the Visibility cells using Build > Precompute Static Visibility. This needs Force No Precomputed Lighting to be unchecked, otherwise Lightmass is completely blocked from running as with Static Lighting disabled in Project Settings and there are no cells created.

So far ok, so I have valid visibility cells and no lightmaps. No warnings in Editor Viewport. But the build complains

Lights with unbuilt interactions: 1
    Light DirectionalLight_1
Primitives with unbuilt interactions: 348
    Long list

Now pressing Play and getting the good old known


OK, something not clean, but this can be fixed easily: just do a build Build > Build Lighting Only with Force No Precomputed Lighting - and lightmass runs without creating lightmaps.

But the Force No Precomputed Lighting option also deletes the Visibility Cells again. And now we run in an endless circle. Rebuild the cells needs to uncheck Force No Precomputed Lighting which in turn leads to the LIGHTING NEEDS TO BE REBUILT…

Maybe the warning does not appear in a Shipping build, but the fact, that it does appear at all makes me believe, that there’s some issue.