Hello, I am trying to understand the Rendering > Lighting settings for scenes when it comes to additive scenes.
I have a scene where I want to separate the dynamic scene from the static scenes. The dynamic scene is the main/active scene which will instantiate enemy meshes at runtime. The static scene will just be environment in the background, non-interactable.
Correct me if I am wrong, but I understand that at runtime, the Lighting settings for all additive scenes will be ignored, only the active scene Lighting settings are used. This seems counter productive to me.
At design time, my dynamic scene has nothing - no lights, no ground, no skybox, nothing; but my static scene will lights, emissive materials, static meshes, baked light map, etc. everything because I need to view them in at design time.
So, what should be the proper workflow to ensure the light information from the designed scene will be used at runtime?
Have you tested it? I don’t think you need to do anything. Set your environment scene as your active scene and loading additive scenes shouldn’t change anything.
After posting this I realized there is SetActiveScene(), which will use the active scene’s lighting settings, and is sufficient for my current obstacle.
However, I kept this post because I am still not 100% sure in other cases. Say, if I have more than 1 static scene then what happens?
For example, in a town, maybe I have a
tavern - indoors, warm lighting,
cemetery - outdoors, cold lighting
farm - outdoors, day and night cycle lighting.
In this case, what would the lighting workflow be? Is there a built-in way to tween between the lighting settings, baked vs real time lights because SetActiveScene() doesn’t seem good enough.
Well, (as far as rendering goes) there really aren’t that many settings determined by the active scene. you have the ambient light, fog, skybox, and a few other minor things that I don’t mess with.
All of these “Active scene” render settings are really easy to script. Unity exposes them all in the API:
In my game, I only set these settings in the editor for testing purposes. Each environmental scene has a script that sets these render settings to whatever it wants to. That way I bypass the whole “active scene” thing completely.
Right now I’m just doing one environment scene at a time but, since I’m controlling everything through scripting, it should be easy enough to interpolate fog settings and ambient light (since I’m using a single color for that). Skyboxes would be much harder to interpolate obviously, but if I were going to attempt that I would also do it outside of the scene settings.
@sacb0y Thanks, I will go through the video. It seems like a lot of addition work to get things working!
@kdgalla I was hoping (although not much expectation) that there is a better built-in way to do it. Perhaps a framework on top of Playables and Timeline since we already have that.