When I added lights, the levels/scenes I loaded via code appeared darkened. After trying out hints from various posts online, here are the solutions that worked for me with Unity 2021.3.12f1.
Two Methods to avoid scene darkening.
- Match lighting in your scenes.
- In Lighting Settings, Click “Generate Lighting” for all your affected scenes.
1) Match lighting in your scenes.
When the lighting was different from one scene to the next, the first scene was always properly lit, but the second was darkened. When I loaded multiple scenes in a sequence, all the scenes that had the exact same lighting setup were all lit as designed, but any scene that had any deviation from the original was darkened. I got rid of the darkening by just having all the lighting in my scenes be *exactly* the same.
2) In Lighting Settings, Click “Generate Lighting” for all your affected scenes.
I added a start screen and end screen, on 2D canvases, and that messed up the lighting consistency across scenes. The following resolved that.
a. Open Lighting Settings: Window > Rendering > Lighting
b. Click “Generate Lighting” at the bottom of that window (any tab). Do this for ALL your scenes that have 3D lighting. I didn’t do it for my 2D start & end screens, as they didn’t have “lighting”. (I did try adding the same lighting to those 2D screens, but that didn’t stop the darkening from happening.)
c. For each scene that you “Generate Lighting” for, a new folder will be created (inside your scenes folder) containing LightingData and ReflectionProbe files.
d. Now that each scene has its own lighting data, Unity won’t try to recreate it for each scene, and everything should be lit as designed.
e. If you want to remove the generated lighting for a particular scene, just delete the created folder associated with that scene. If you change the lighting in a scene, just press Generate Lighting for that scene again, and it will overwrite the old lighting data for it.
I hope these approaches can help some people.