Addative scene loading and light settings 2019.4 LTS

Hello!
We have a main scene with a camera and some loading scripts in it, then we additively load our map into the game alongside our camera scene, and in most cases, this works perfectly fine.

But every so often we get lighting data in our build that is not the same as what our artist are seeing in the editor.

A few team members and I have been trying for about 2 weeks now to solve this problem and we think we have it fixed by making sure that our first scene that is loaded has the EXACT same light settings in the settings menu as the scene that’s being loaded with it, which is simple enough if you just have the 1 loading scene and 1 world scene.

But we have 1 loading scene and 50+ world scenes that you can leave from and go to at runtime, and each of those scenes has slightly adjusted lighting settings (some are baked, some are real times, some have different baking settings than others) So how is it supposed to be possible for us to keep the same lighting settings on the load/camera scene as we switch between the different world scenes?

…bump :confused:

Hey sniffle36,

the topic of Lighting settings and additive scene loading is a tricky one, because these settings can conflate two different things. There are settings that only affect baking, i.e. if you load two scenes together with these settings being different that’s perfectly fine.

However, there are also settings which affect baking AND runtime behavior. One such setting for instance is the Lightmap mode (directional or non-directional), which is a value that determines how we read the baked data at runtime and how we interpret the values for lighting. These are settings which cannot simply be different for additive scenes, because if they are we arrive at a contradiction when reading the values. Hence, there’s a rule: The first loaded scene always takes precedence when evaluating conflicting settings.

In 2019.3 we added Lighting Settings assets, which are referenced by each scene. These are assets which contain the settings from the Lighting window, and which can then be reference by many additive scenes, making it easier to author one common set of settings for many scenes in a project.

We often have trouble with a “loading scene” because it interacts with different baked scenes. I’m assuming that “main scene” in your project is unbaked. You could switch the settings asset to the one of the additive scene you are loading before actually adding the additive scene via script. That way, the main scene will always match the settings of the additive scene.

Cheers