Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Light layers in HDRP

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

  1. jay3sh

    jay3sh

    Joined:
    Dec 30, 2013
    Posts:
    19
    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:
    789
    You have to enable it on the HD render Pipeline Settings as well
    upload_2019-1-26_23-47-13.png
     
    NgocLien, Gametyme and jay3sh like this.
  3. jay3sh

    jay3sh

    Joined:
    Dec 30, 2013
    Posts:
    19
    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:
    909
    i try do it but i got this what i miss



     
  5. hippocoder

    hippocoder

    Digital Ape

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

    SebLagarde

    Unity Technologies

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

    OfficialHermie

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

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    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:
    789
    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
     
  10. eco_bach

    eco_bach

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

    CosmosBear

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

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    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:
    789
    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:
    397
    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:
    934
    Lex4art likes this.
  16. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    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
     
  18. sergiobd

    sergiobd

    Joined:
    May 14, 2014
    Posts:
    37
    In my case, the checkbox in HDRP settings is greyed out and active, but the light layer dropdown is still greyed out on each light.
     
  19. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789

    You have to enable Light Layers on the HD Render Pipeline asset, then you can also enable it in the global frame settings (Edit => Project Settings => HDRP Default Settings => Rendering) after that you should be able to enable the setting on lights, meshes, and also use it for shadows and light probes.
     
  20. kikesa72

    kikesa72

    Joined:
    Nov 20, 2015
    Posts:
    9
    And dont miss:
     
  21. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    438
    and what about LightLayers and Instanced rendering? There seems to be some serious issues.
     
    Arathorn_J and wahmpire like this.
  22. dsketchbook

    dsketchbook

    Joined:
    Jun 3, 2017
    Posts:
    4
    Why is everything all over the place in Unity! Why would you put the light layers in Quality > HDRP. Why would you design the software LIKE this!!! Why not keep it where the other layer options are in Unity OR put it in the light options? Seriously you can see why people give up learning Unity as nothing is united in the software!
     
    bootchec likes this.
  23. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    dsketchbook likes this.
  24. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    You can find explanation of the settings here: https://forum.unity.com/threads/fin...-getting-started-settings-new-feature.833056/ . Help to understand what do what.
    Also Unity have a lot of legacy and have been build by a lot of different people, there is work plan to gather settings together.
     
    hippocoder and dsketchbook like this.
  25. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Do lighlayers also work when baking lightmaps?
    For me it looks like they don´t. o_O
     
    OBiwer likes this.
  26. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Nope, lightmapper don't support light layer
     
  27. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    Does light layers properly work with directional light? I’m seeing that it’s still affecting unrelated objects. On 2021 LTS.
     
  28. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    755
    Anybody know if light layers will ever work for ui raw images with lit materials? Right now they are affected by the default but i see no way to turn that off and turn on a different layer for them.