Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

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,475
    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,475
    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,475
    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,475
  6. Sickwitit

    Sickwitit

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

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,475
    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:
    246
    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:
    101
    Same issue in 5.6.0 f3...
     
  17. _creatio_

    _creatio_

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

    kalibcrone

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

    churi24

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

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    586
    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:
    397
    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:
    114
    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.
     
  27. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    100
    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 while it breaks on me.
    A bug fix must have higher priority than a new feature because bug make current features unusable and new features cant still be used reliably, so it's better to fix and have one feature working than make a new one and have no features working.
    I know, making new things is fun... But fixing bugs, actual work, comes first
     
    Last edited: Jan 7, 2020
    NewMagic-Studio likes this.
  28. NewMagic-Studio

    NewMagic-Studio

    Joined:
    Feb 25, 2015
    Posts:
    205
    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:
    205
    Yes, and not a normal bug but a very important one
     
    forestrf likes this.
  30. blurdot

    blurdot

    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:
    205
    In my case using Forward rendering solved the issue
     
unityunity