Hi guys ! I have now upgraded from 4 to 5.4.2f2… Disaster ! I had to fix all the loadlevel with the scene management… but i have a problem with the directional light ! If i play the scene from unity it’s OK, but if i restart the level, or i start the level from the main menu the direction light becomes more dark and strange… Please help me…
13 Answers
13For those in the most recent version of Unity as of this date:
You have to go to Window → Lighting. In that Window, look for the “Debug Settings”. Untick the “Auto Generate” checkbox and hit the “Generate Lighting” button beside it. That should take care of it in the editor.
Yes, only for the scene you just loaded via API. I was having this issue when I loaded the scenes like this.
– ArwymHmmm, I bumped into the issue that Stencil buffer is not working properly after "Generate Lighting" ...
– AllundoI am not sure what you mean by that, but my render queue of the material is set to "From Shader".
– DanaScullyRelax, it’s pretty simple.
When you select a scene, Unity will automatically bake all the lights and render things. BUT when you open a scene while playing the game in the editor, Unity will NOT bake the lights,render them, fix the effects and all, and this causes everything to stay dark.
This only happens in the editor. If you build your game, you will see that this will not happen. Hope it helped =)
I HAVE FOUND IT! This is a problem with the skybox loading between scenes. To fix it, go to Window>Rendering>Lighting>Environment. There you should see the Source in the Environment Lighting section set to Skybox by default. When I changed this to color(on ALL scenes) it fixed all my problems with lighting. Every project is different, but this worked better than all of the other solutions I have tried.
For anyone that may come across this issue in the future, I fixed it by unchecking Baked Global Illumination and checking Auto Generate under the lighting tab.
This worked. You just have to make sure all scenes are using the generated lighting settings which you can generate just by clicking NEW on the WINDOWS > RENDERING > LIGHTING > SCENE window under Lighting Settings As. Click NEW. Now under Mixed Lighting, DISABLE Baked Global Illumination. Use this lighting profile on every scene to fix this. Thanks to Chengus for this <3
– Newb_NinjaI was suspicious this would make things look ugly or change the feel of the scene, but after slightly increasing the colour brightness it looks basically identical. Underrated answer
– BabitchThis and Newb_Ninja's responses should be at the top! Fixed my issue without having to make the filesize MASSIVE by rendering the lights after downgrading a project to Unity 2021.3.6f!
– XaviVHere’s an update for what worked for me with Unity 2021.3.12f1.
The previous answers in this thread helped me get to these solutions, so kudos to everyone who wrote answers before me!
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. ![]()
I just spent 2 hours trying to figure this one out.
Come on unity. This is super basic.
This seems to happen when the load scene has a different lighting setup than the second scene. It also seems to be that the scene you are in when you build, is NOT the scene that gets lighting set. I dont know how else to explain it. I have a menu. I have levels. The menu is the first scene and has no light. when I build from the menu, all is well. When I build from any other scene, the build has darkened lighting. This is a very weird and confusing issue that needs resolution.
– triangle4studiosMine was solved by simply setting
Window / Rendering / Lighting / Scene / Lighting Settings
with a custom source to anything other than the default None.
If you want to default ‘Light Setting After Reseting Them’ OR If you create another scene & lighting was not matching to default Scene(SampleScene), Then you are in the right place…just read the below description.
1. Select your Directional light in the Hierarchy
2. Change the Light Mode of the Light component Baked to Mixed
3. (Optional) Go to Window > Rendering > Lighting Settings > Lightmapping Settings (inner tab) Change the following value, and then click on Generate Lighting
Direct Important = 1
Indirect Samples = 500
Environment Smaples = 500
Direct Filter = Advanced
Tested on Unity 2019.1
I can tell you put a lot of work into this answer, but it's hard to read. Could you edit it to be a little easier to read? I can't seem to edit the question for you, SO-style.
– tankorsmashSure but my material is a simple one that I created from the create tab and selected the Partciles/Alpha blended shader for it.
– DanaScullyI tried for hours to get this working. I loaded a scene from a loading screen, along with 2 additive scenes and ENSURED the main scene was set as the active scene, but still it was inheriting the lighting settings from the loading screen. Finally decided to try the generate lighting option which worked, but damn it’d be nice if things actually worked as expected. If I set a specific scene as the active scene, it should just automatically switch the lighting settings for that scene. At least I learned that I have a lot of reading up to do on lighting in Unity.
EDIT: Nevermind I have figured this out
I’m having the opposite problem, is there any way to keep the darkened lighting instead of the brighter one? I’d like to use the darker lighting from not fixing it but it then renders the proper-brighter lighting when I build the game.
Thanks, This Worked for me too
Generating light worked for me, but this a problem that should not occur like @ xealgo said



Just did it but still the same. tried both meshfilter.sharedmesh and cloth.sharedmesh
– DanaScully