Enviroment lighting settings from subscene

Hello,

I’m currently utilizing Entities Graphics 1.0.6 and have encountered an issue related to lighting within the context of a subscene system.

My setup involves a main scene loaded upon startup, along with several level scenes presented as subscenes. These subscenes are loaded additively using the SceneSystem.LoadSceneAsync() method with the appropriate flag.

When I individually open each subscene in the editor, everything displays correctly, taking into account the Environment Lighting settings. However, when I load them additively as subscenes, the Environment Lighting from the main scene is applied instead. Is there a way to replace the Environment Lighting of the main scene with the lighting data from the subscenes?

I’m particularly interested in exploring options for loading levels via subscenes without requiring structural changes to my system. This is because the SceneManager.SetActiveScene() method, which determines the scene from which lighting settings are used, doesn’t support scenes involving subscenes.

Thank you in advance for any assistance you can provide!

Hi!

In my case i use only one active subscene, so i bake needed RenderSettings fields in a baker, and then on runtime apply them back to RenderSettings by getting a singleton

If you need to apply these settings per subscene and load multiple scenes at the same time - well, it is more complicated. You can try utilize Material Property component data to bake needed environment settings and then use this data in your shaders. An ugly workaround due to data duplication

https://docs.unity3d.com/Packages/com.unity.entities.graphics@1.0/manual/material-overrides.html