- Home /
Unity 5 skybox lighting bug
Hello, I was playing around in unity 5 this morning and stumbled upon a bug(or atleast I think that its a bug).
Whenever I load a scene with a skybox enabled the lighting changes dramatically.
The code used in my video is simple, I just reload the loaded level when I press space:
if (Input.GetKeyDown(KeyCode.Space))
{
Application.LoadLevel(loadIndex);
}
Here is a video that demonstrates it. My question is, is this a bug, and is anyone able to reproduce this?
I noticed the same thing few $$anonymous$$utes ago: using Application.LoadLevel seems to screw up Enviroment lightning settings, for example Ambient Intensity does nothing when adjusting it after LoadLevel
When I see your video, i don't think there are any bug.
Scene1 is using Skybox ambient, so you get the skybox ambient light (bluish colour). Scene2 is using Color ambient and no skybox, so you get the grey colour ambient light.
You start the Scene1 and then load Scene2, ambient change from bluish to grey colour. I don't see any wrong with that.
Thare are no scene 1 and scene 2.. I'm loading the same scene. It is 100% the same scene
I'm having the same problem! Have you fixed it in any way? Please let me know.
Answer by Raynoko · Mar 13, 2015 at 01:03 PM
Try set up "baking light" in Directional light. choose "mixed" or "realtime", hope helpful
Answer by ZorbaTHut · Jan 08, 2017 at 06:42 PM
This appears to be the result of a Unity bug caused by loading a scene during a specific event (one report says that this occurs when loading in Awake(); I haven't tested it.) There's a pretty simple workaround; call DynamicGI.UpdateEnvironment();
explicitly. It'll tell Unity to update lighting settings.
Probably want to do this exactly once, right before the load screen goes away.
Your answer
Follow this Question
Related Questions
Why are some of my sprites brighter than others? 1 Answer
Toggling between skyboxes/lighting with a button 1 Answer
Accidentally Clicked Refresh Assets and This Happened. How Do I Fix It? 0 Answers
Weird black lines 1 Answer
Add Light Source to Sun in Environmental Lighting with Unity 5 by Script? 3 Answers