Search Unity

Light layers in HDRP

Discussion in 'Graphics Experimental Previews' started by jay3sh, Jan 27, 2019.

  1. jay3sh

    jay3sh

    Joined:
    Dec 30, 2013
    Posts:
    8
    I'm playing with lighting in an HDRP project. I want to use a bunch of spot lights to generate baked lightmaps for a group of static meshes, and a direct light for certain animated objects in realtime mode. I could do this by grouping the objects in layers and limiting the lights' culling masks to respective layers. In pre-SRP world the lights had cullingMask to make them illuminate only the objects in a particular layer. How can the same be achieved in an HDRP project, because the lights in such projects don't have the old layer selection drop down.

    I found in HDRP project in the Light properties I could check "Show Additional Settings" under Features. This gives a "Light Layer" drop down field. But it's disabled to some default value as shown in the screenshot. How can I use it to illuminate objects in a specific layer?

    light-layers-in-unity-hdrp.PNG

    (Using Unity v2018.3.2f1)
     
  2. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    616
    You have to enable it on the HD render Pipeline Settings as well
    upload_2019-1-26_23-47-13.png
     
    jay3sh likes this.
  3. jay3sh

    jay3sh

    Joined:
    Dec 30, 2013
    Posts:
    8
    Awesome. That did it. Also liked the fact that Light Layers are now separate from regular layers.
     
  4. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    876
    i try do it but i got this what i miss



     
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,201
    As feedback for Unity's UI team I recommend greyed out items have an appropriate on hover message to explain why it is so.
     
    OfficialHermie likes this.
  6. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    543
  7. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    508
    I also would VERY MUCH like to see comments for greyed-out items.
     
  8. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,399
    So I've enabled Light Layers in my HDRP settings, but where is the Culling mask drop down now in my actual light? Still don't see it...Unity 2019.2.1f1
     
  9. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    616
    You have to enable More Options for the light under the General tab. (The little gear icon to the right)
    upload_2019-8-31_12-17-52.png
     
    Skunk-Software likes this.
  10. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,399
    Yes thanks. Well hidden!
     
  11. CosmosBear

    CosmosBear

    Joined:
    Aug 2, 2012
    Posts:
    54
    Wow, thanks a bunch I would have never guessed!!
     
  12. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    111
    I'm not getting the angulr diameter parameter i directional lights(Unity 2019.3.0a12 , hdrp 7.0.1)
     
  13. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    616
    You might have the wrong one expanded, check and see if you have two General tabs. This is probably a mistake made so it will probably go back to being under one tab or completely renamed.
    upload_2019-9-17_10-51-46.png
     
  14. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    283
    Necrobumping this post a bit, but I don't think this feature works anymore on the latest HDRP version.
     
  15. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    543
    Lex4art likes this.
  16. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    283
    I'm, unfortunately, not that oblivious to forget about such a trivial thing.

    I ensured to its fullest that everything is configured correctly as described in the package manager manual, but lights simply continue to affect all the objects no matter the settings (unless their mask is set to nothing, in which case they're fully culled from the lighting pipeline).

    The mask render targer is properly generated and the mask value gets properly written to it, but the lights themselves don't react to it in any way. Tested on HDRP 7.1.8, both Unity 2019.3.6 and 2020.1.21a exhibit such an issue. Using an earlier 7.X.X HDRP version, reimporting shaders and wiping the library folder don't help.
     
    Last edited: Feb 4, 2020
  17. Drakostorm

    Drakostorm

    Joined:
    Nov 19, 2016
    Posts:
    1
    i also thought there was something wrong with it , appears that if you go down a bit you will find another Light Layers check box . these greyed out ones are in the Default Frame settings so you have to check boxes below to activate them here
     
unityunity