Search Unity

Unity 5 - Directional Light and Culling Mask Problem

Discussion in 'Global Illumination' started by Tiles, May 2, 2015.

  1. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    I have a background scene. And my game should run in front of this background scene. The background scene has a day night cycle. So i need a independand lighting for my game so that i can play the game in the night time cycle too.

    I use two cameras to display the content. The objects are in corresponding layers. gamecontent and levelcontent. The directional light for the level content has the layer gamecontent turned off in the culling mask. The directional light for the game has the layer levelcontent turned off in the culling mask.

    So the game light should not affect the background scene. And the level light should not affect the game in the foreground.

    But they do :/

    The light from the game lights the background scene, and the light from the background scene influences the game. Not so strong as if the culling masks would be ticked, but very visibly.

    Scene shows the background with game light on and off. It's quite a difference.

    Is this a bug? Or is there a trick to light my content really independant?
     

    Attached Files:

  2. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    One step further. It seems that this is caused by GI Intensity and Bounce Intensity of the light. Smells more and more like a bug ...
     
  3. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    Bump

    Can somebody confirm this behaviour please?
     
  4. SirPolly

    SirPolly

    Joined:
    May 15, 2013
    Posts:
    1
    NewMagic-Studio and Tiles like this.
  5. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
  6. Sickwitit

    Sickwitit

    Joined:
    Dec 22, 2014
    Posts:
    123
    I also have the same issue.
     
  7. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    This issue is listed as fixed in Unity 5.1. So when you have still issues with it in 5.1, then you should submit a new bug report.
     
  8. 8bit4life

    8bit4life

    Joined:
    Sep 30, 2014
    Posts:
    9
    It isn't fixed in 5.1 apparently..
     
  9. Koen-Matthijs

    Koen-Matthijs

    Joined:
    Aug 1, 2015
    Posts:
    5
    Nor in 5.2...
     
  10. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    not fixed in 5.3 release version either
     
  11. angralon

    angralon

    Joined:
    Feb 25, 2014
    Posts:
    9
    Wow, this bug is still not fixed?
    How do you bake your scenes? Is there any workaround?
     
  12. Deleted User

    Deleted User

    Guest

    I tried to make that same setup work, ended up having the background directional light as a realtime light, not baking it, remember to turn OFF the light before baking, or else there is a good chance unity will bake it. So we have a custom bake button, that turns off all realtime lights on bake.
     
  13. alternative_richie

    alternative_richie

    Joined:
    Sep 4, 2014
    Posts:
    15
    I just came across this and it's still not fixed in 5.4. I have a pitch, players and stadium. Using precomputed GI. Separate directional light for the players and stadium. The directional light set with a culling mask of "Players" still affects the Global Illumination by the looks of it. I just want it to light the players. The stadium light has the culling mask set to everything but the players layer, so it must be the global illumination is still using it. How do I exclude the player light from the global illumination?
     
  14. alternative_richie

    alternative_richie

    Joined:
    Sep 4, 2014
    Posts:
    15

    Ahh. I just figured that it must be bouncing. So I dropped the Bounce Intensity on the player directional light and that fixed it.
     
  15. diego-borghetti

    diego-borghetti

    Joined:
    Dec 12, 2014
    Posts:
    5
    Well, I just got into this problem. I'm using a layer to put my gizmos and that layer have a directional light (which should only affect the gizmos.. but isn't working correct, some of the light goes into my main scene).

    Thanks alternative_richie for the tip, that bounce intensity is a "good workaround" in my case.
    I just write to bump the thing up.... the first post is from 2010 :/

    Unity version: 5.5.1f1
     
  16. MaxRoetzler

    MaxRoetzler

    Joined:
    Jan 3, 2010
    Posts:
    136
    Same issue in 5.6.0 f3...
     
  17. _creatio_

    _creatio_

    Joined:
    Mar 21, 2013
    Posts:
    43
    Got into the same issue. Hope one day somebody from Unity will notice this topic.
     
  18. kalibcrone

    kalibcrone

    Joined:
    Sep 4, 2015
    Posts:
    10
    Same issue 5.5.3f1. My scene lighting looks totally different after building my project.
     
  19. churi24

    churi24

    Joined:
    Sep 17, 2013
    Posts:
    98
    Same on Unity 2017.1.0f3
     
  20. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    723
    Same on Unity 2017.2.0.f3
     
    mathias_ody likes this.
  21. Vita_Lin

    Vita_Lin

    Joined:
    Jul 12, 2018
    Posts:
    1
    Same issue 5.6.1f1. How can i workaround?:(
     
  22. mathias_ody

    mathias_ody

    Joined:
    Jul 12, 2015
    Posts:
    1
    Can confirm, still has the issue
     
  23. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    it's still a bug in 2018.2
     
  24. capitola

    capitola

    Joined:
    Dec 5, 2014
    Posts:
    2
    Bumping this because it is still there in 2018.3
    Just 2 more years until this becomes a decade old bug!

    Can someone share a workaround?
     
  25. Xander511

    Xander511

    Joined:
    May 30, 2014
    Posts:
    3
    I confirm: 2018.3 still a bug ...
     
  26. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    Hey, sorry to say that we acknowledge the bug but can't provide an ETA. It is always being pushed down the list by other priorities. I would advice to reopen and up vote the bug if you want this to become a priority.
     
    ROBYER1 likes this.
  27. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    231
    How can a decade old bug not be prioritized more than more recent bugs? How can it be that this bug still exists after being in Beast, then in Enlighten and now in your own cpu and gpu lightmappers? Being done from scratch, this is not a bug but being ignored :(
    I hate writting just to ask "why is this bug here" but lately I find so many bugs and Unity crashes so much on me that makes me feel bad for liking this engine so much.
    A bug fix must have higher priority than a new feature because bugs make current features unusable and new features aren't complete or stable, leaving overall something incomplete and unstable. That's why most of the time fixing is better than adding, it's better to have something that works that many things that don't.
    I know, making new things is fun... but fixing bugs should come first.
     
    Last edited: Nov 17, 2020
    NewMagic-Studio likes this.
  28. NewMagic-Studio

    NewMagic-Studio

    Joined:
    Feb 25, 2015
    Posts:
    454
    In my case it is a point light ignoring what is set in cullling mask and applying light to an item with a layer which should be ignored. I use 2018.3
     
    forestrf likes this.
  29. NewMagic-Studio

    NewMagic-Studio

    Joined:
    Feb 25, 2015
    Posts:
    454
    Yes, and not a normal bug but a very important one
     
    forestrf likes this.
  30. AlleywayNick

    AlleywayNick

    Joined:
    Jan 26, 2014
    Posts:
    26
    Just ran into this in 2018.3 and it makes me sad....
     
  31. NewMagic-Studio

    NewMagic-Studio

    Joined:
    Feb 25, 2015
    Posts:
    454
    In my case using Forward rendering solved the issue
     
  32. calpolican

    calpolican

    Joined:
    Feb 2, 2015
    Posts:
    425
    This problem is still present in 2020.1. I can't stop a direct light from baking in my floor. Any work around after 5 years of waiting?
     
    Last edited: Nov 12, 2020
    Pawciu and ROBYER1 like this.
  33. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Any update on this? How is this still a big 5 years later?
     
  34. DaftBrothers

    DaftBrothers

    Joined:
    May 24, 2017
    Posts:
    1
    Same on Unity 2020.3.0f1

    wtf?
     
  35. DeLannoy04

    DeLannoy04

    Joined:
    Jul 2, 2019
    Posts:
    42
    Still here on 2020.3.15 LTS
     
  36. calpolican

    calpolican

    Joined:
    Feb 2, 2015
    Posts:
    425
    Haven't check, but the URP roadmap says they added the possibility of puting layer masks to lights.
     
    ROBYER1 likes this.
  37. endasil_unity

    endasil_unity

    Joined:
    Jun 28, 2018
    Posts:
    19
    Still an issue in Unity 2021.2.2f1
     
  38. cgihow

    cgihow

    Joined:
    Feb 18, 2022
    Posts:
    1
    this is still a issue, i think it is right to say that unity team is not capable enough to fix this bugs
     
  39. charmingny

    charmingny

    Joined:
    Nov 1, 2021
    Posts:
    5