Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Application.LoadLevel (Application.loadedLevel) resets level but causes light intensity to change

Discussion in 'General Graphics' started by engieelec, Mar 7, 2015.

  1. engieelec

    engieelec

    Joined:
    Feb 5, 2015
    Posts:
    10
    Hello,

    I have been following the Unity Live Training Jan. 5th 2015: Creating a Breakout Game for Beginners tutorial that is available on YouTube. I have completed it using Unity 5 but I am having a small problem that I can't figure out.

    The problem is that the light intensity is reduced for some reason after the scene is reset.

    The second image shows that the intensity is reduced after calling Application.LoadLevel (Application.loadedLevel);

    Any ideas what could be causing the intensity to be reduced? I did not modify any properties of the directional light.
     

    Attached Files:

    • 1.png
      1.png
      File size:
      77.2 KB
      Views:
      1,980
    • 2.png
      2.png
      File size:
      64.7 KB
      Views:
      1,983
    Tom463 likes this.
  2. Shadeless

    Shadeless

    Joined:
    Jul 22, 2013
    Posts:
    136
    I have the exact same Issue. The lighting gets screwed but the values in the inspector stay the same.
     
    Tanaka-Einzbern likes this.
  3. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,816
    Submit a bug report?
     
    Ludwant likes this.
  4. Shadeless

    Shadeless

    Joined:
    Jul 22, 2013
    Posts:
    136
    Hi there, I have figured out the issue. :D

    The issue is that Continuous Baking of the Lightmap doesn't work properly after Application.LoadLevel(). Somehow after you reset the level, the Lightmap snapshot gets lost?

    I also tried removing the Skybox while Continious Baking was on, and there was no notable difference in the lighting after reset with Application.LoadLevel(). So I guess the GI (Global Illumination) or Ambient Lighting that's happening from the Skybox doesn't get baked after you reset the level???

    The fix is to go to Window -> Lighting -> Lightmap Tab -> Disable Continuous Baking -> Press Build to bake the lighting once manually. And now the lighting remains consistent.

    Note that if you add more lights or make some changes I think you have to bake again?

    UT get on it!

    Cheers
     
  5. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Have you submitted a bug report with all these details? If you haven't, you should probably do. And post the case number here just in case someone from Unity sees this thread.
     
  6. Shadeless

    Shadeless

    Joined:
    Jul 22, 2013
    Posts:
    136
    I'll just leave this here?

    Edit: Removed Link..
     
    Last edited: Mar 17, 2015
  7. Taytay208

    Taytay208

    Joined:
    Mar 16, 2015
    Posts:
    1
    You...are AWESOME! Thank you! This was such a stupid issue and I guess that makes sense, hopefully they fix this issue soon but for now I appreciate the help! :D
     
  8. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,816
    Don't link your Fogbugz on a public forum people. Those links let people see all bugs/source/projects linked to your email address.
     
  9. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    Well, that sounds like a bad design...
     
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The first thing you do is post in the correct forum. Posting randomly means you don't care about it. Moved.
     
  11. zillabunny

    zillabunny

    Joined:
    Mar 19, 2015
    Posts:
    1
    worked for me!! thanks!!
     
    theANMATOR2b likes this.
  12. Tanaka-Einzbern

    Tanaka-Einzbern

    Joined:
    Mar 19, 2015
    Posts:
    1
    Wowwwwwwwwwww !

    Thank you very much, I spend a lot time by this error and i though that my Unity might be broken installer.
     
  13. Shadeless

    Shadeless

    Joined:
    Jul 22, 2013
    Posts:
    136
    Nice! I'm glad it helped. :D
     
  14. petediddy

    petediddy

    Joined:
    Mar 17, 2015
    Posts:
    19
    This was also the fix for my issue. Hopefully Unity folks will get this addressed so we don't need to do this each time. Thanks for finding and posting the fix, Shadeless!
     
  15. TheChris1984

    TheChris1984

    Joined:
    Mar 25, 2015
    Posts:
    1
    Did anyone file a bugreport yet?
     
  16. Shadeless

    Shadeless

    Joined:
    Jul 22, 2013
    Posts:
    136
    I did, and they notified me it's been taken into account. :)
     
    jaimemh, Ludwant and TheChris1984 like this.
  17. Rouli

    Rouli

    Joined:
    Mar 31, 2015
    Posts:
    1
    Same issue here. Thx for the Help!
     
  18. Ludwant

    Ludwant

    Joined:
    Mar 31, 2015
    Posts:
    1
    Thank you thank you thank you thank you! I have been trying to fix this issue for several days now, and it finally works! Wow, thanks Shadeless, you are a life saver.
     
  19. JadsonAlmeida

    JadsonAlmeida

    Joined:
    Jan 30, 2014
    Posts:
    9
    Man, you save my time! Thx alot!
     
  20. Sar3k

    Sar3k

    Joined:
    Jun 14, 2014
    Posts:
    2
    Thank you so much ..
     
  21. Cvachha

    Cvachha

    Joined:
    Feb 1, 2015
    Posts:
    3
    Thank you. Worked perfectly.
     
  22. Centurium

    Centurium

    Joined:
    May 16, 2015
    Posts:
    1
    It worked! Thanks.
     
  23. AlanPereiraArt

    AlanPereiraArt

    Joined:
    Apr 29, 2014
    Posts:
    17
    Had this problem today, thanks very much!
     
  24. draobrehtom

    draobrehtom

    Joined:
    Jul 4, 2015
    Posts:
    1
    Thank's, man. Work's.
     
  25. drhmiri

    drhmiri

    Joined:
    Jun 17, 2014
    Posts:
    82
    This is still an issue in version 5.1.1f1 but many thanks to Shadeless for the solution.
     
  26. Kuba

    Kuba

    Moderator

    Joined:
    Jan 13, 2009
    Posts:
    416
  27. edinhofilho98

    edinhofilho98

    Joined:
    Jul 22, 2015
    Posts:
    1
    Obrigado cara, ajudou pakas, muito valeu, saudades! // Thank you man, ur helped my project, really thank u!
     
  28. Draco18s

    Draco18s

    Joined:
    Aug 15, 2011
    Posts:
    110
    Another thank you!
     
  29. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    137
    Just wanted to point out this issue happened when I updated to a newer version today. I had to turn "auto bake" off like Shadeless pointed out. I also deleted all my lightmapsnapshots and reflection probes(not sure it was required) and re-bake. I ticked back auto the continuous bake features of auto do work now after I did the above. Thanks Shadedless for your fix.
     
  30. Gruguir

    Gruguir

    Joined:
    Nov 30, 2010
    Posts:
    340
    Same here (5.2.1p2) :(
     
  31. drhmiri

    drhmiri

    Joined:
    Jun 17, 2014
    Posts:
    82
    Did Shadeless' solution (above) not help?
     
  32. Gruguir

    Gruguir

    Joined:
    Nov 30, 2010
    Posts:
    340
    Sure, this solution works, but the issue is still there.
     
  33. halil-ibrahim

    halil-ibrahim

    Joined:
    Oct 24, 2015
    Posts:
    1
    Thank you man
    :)
     
  34. CosmosBear

    CosmosBear

    Joined:
    Aug 2, 2012
    Posts:
    67
    This works fine with the editor but do you guys know if there is a working fix for an actual game build?
     
  35. drhmiri

    drhmiri

    Joined:
    Jun 17, 2014
    Posts:
    82
    When I build a standalone, it works too...
     
  36. maxxa05

    maxxa05

    Joined:
    Nov 17, 2012
    Posts:
    186
    I got a similar bug, but it's probably not the exact same thing, so I started another thread here. You could check out my observations though, maybe it's related.
     
    drhmiri likes this.
  37. SergeyEvseev

    SergeyEvseev

    Joined:
    Aug 29, 2014
    Posts:
    6
    Same issue. 5.2.2p1.
     
  38. kankeus

    kankeus

    Joined:
    Dec 3, 2013
    Posts:
    12
    I'm having the same issue too and being very frustrated... 5.2.2p2
    When I set the realtime Resolution and baked Resolution lower, it doesn't happen so often at Application.LoadLevel(), but still about 1/5 times. It doesn't matter if I have auto baking on or off... It's strange that it only seems to affect the ground texture and some prefabs and the "darkening" is different at different times, as in it's not always completely dark, but still not right... When I switch to deferred rendering path, it seems to happen every time.

    Feels like the lightmap or something doesn't get loaded fast enough?

    Please help. :/
     

    Attached Files:

  39. yago_hp

    yago_hp

    Joined:
    Dec 29, 2015
    Posts:
    1
    works for me! thanks a lot o/
     
  40. Dadagi

    Dadagi

    Joined:
    Dec 20, 2015
    Posts:
    1
    Thank you a lot man
    hope the best for you
     
  41. rawrrrz

    rawrrrz

    Joined:
    Jun 2, 2013
    Posts:
    16
    I just spent a good 3-4 hours on this myself and your post finally helped me fix it, thanks so much! To clarify, I unchecked all the different baking options, and clicked check for EACH SCENE. I was testing with 4 different scenes, and it turned out that one of them had a skybox, one was trying to use a null skybox as it's ambient light source, and the other two were using different colors at varied intensity! XD!

    After I set them all up with the same skybox material, made sure I'd chose skybox for ambient lighting, matched their intensities, and re-baked each scene, it worked like a charm!

    Wow do I feel like an ass.. 4 AM?! Such a simple stupid little thing and literally just kept me up all night! So, thanks again for pointing me in the right direction, now I can finally take a nap! lol :D
     
  42. Farelle

    Farelle

    Joined:
    Feb 20, 2015
    Posts:
    504
    version 5.3.4f1 I stumbled on the same issue, shadeless solution worked for me, but I'm a little disappointed that it was supposed to be fixed already :eek:
     
    PiFLYON, bcgreen24 and exon101 like this.
  43. Ilingis

    Ilingis

    Joined:
    Dec 13, 2012
    Posts:
    63
    I had the same problem. Thanks for the solution!
     
  44. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    I just got this in 5.4.0f3. @Shadeless workaround worked for me.
     
  45. megabrobro

    megabrobro

    Joined:
    Jul 8, 2017
    Posts:
    109
    Hi, I've been using Unity for a year or two, and have had many release iterations of Unity. I am currently on the latest Unity beta 2018.2.0.b2 (I also tried latest stable).

    Every time I change scene all the lighting drops, there is no "Continous Baking" option in the location stated in this thread. I've tried finding a similar option in Lighting Settings and Light Explorer.

    The scenes are dark as soon as you have changed scene in Editor, the Build versions work fine.

    Was this fixed? And is this now a separate issue that has similar unwanted results? Anyone know how I can fix it in Editor? thanks
     
  46. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Try to disable the "Auto Generate" checkbox next to the "Generate Lighting" button and then press the "Generate Lighting" button to generate the lightmaps and save them with the scene.
     
  47. orson-welles

    orson-welles

    Joined:
    Nov 3, 2017
    Posts:
    3
    Does not work for me. Every time I press Play or close and reopen the project the lightprobes are dark.

    Captura de pantalla 2018-12-15 a las 20.54.41.png Captura de pantalla 2018-12-15 a las 20.55.54.png
     
  48. DRKDesigns11111

    DRKDesigns11111

    Joined:
    Nov 14, 2021
    Posts:
    1
    There isn't even an option to do this on my screen though (I use a mac)