Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug URP 14.0.4 Rendering Layers are totally broken

Discussion in 'Universal Render Pipeline' started by larsbertram1, Nov 29, 2022.

  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,694
    as soon as i enable rendering layers (in the "URP-HighFidelity" asset in a new and "empty" project) lighting goes nuts and point lights e.g. will not affect any object when using forward or forward+.
    also the ui of the light component is broken: selecting "rendering layers" -> "everything" will set it to "nothing". manually activating all layers will set it to "nothing" as well.

    it used to work in beta 14 i think...

    renderingLayers.PNG
     
  2. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    289
    By the way, this also exists in latest URP 15. (2023.1.a20)
     
  3. Jar_Coding

    Jar_Coding

    Joined:
    Oct 5, 2017
    Posts:
    15
    I can confirm that this is broken in 2022.2f1 too. Looks like GetMeshRenderingLayer in Lighting.hlsl does not get any infos about the rendering layers of the mesh. After deleting the following line I get the light correctly but unfortunately without the layer feature. :rolleyes:
    Code (CSharp):
    1. if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)
    Coming from 2021.3 the feature worked as excepted.

    In short: the whole section here in the documentation Rendering Layers | Universal RP | 14.0.4 (unity3d.com) does not work :)
     
    Last edited: Dec 9, 2022
  4. fendercodes

    fendercodes

    Joined:
    Feb 4, 2019
    Posts:
    157
    Renderering Layers are broken for me too in Unity 2022.2.0f1. How could they let that slip through the cracks! They do work for a Directional Light but not Point or Spot. Has anyone submitted a bug for this yet?
     
  5. Jar_Coding

    Jar_Coding

    Joined:
    Oct 5, 2017
    Posts:
    15
    I submitted a bug report for this today ;)
     
  6. fendercodes

    fendercodes

    Joined:
    Feb 4, 2019
    Posts:
    157
    Nice. Link it here when you can!
     
  7. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    402
    nice to see we are not alone on this one

    i also noticed in render layers has issues with additional lights color temperature in that the temp color leaks thru into all render layers not getting masked
     
  8. MustardBoy

    MustardBoy

    Joined:
    Jul 10, 2015
    Posts:
    6
    it work with "Deferred", but not with "Forward" and "Forward+"

    WorkDeferred.jpg
     
  9. ChrisJohnson

    ChrisJohnson

    Joined:
    Feb 20, 2013
    Posts:
    62
    Does anyone know if this has been fixed yet? I’m using 2022.2.3f1 with URP/deferred rendering, and there doesn't seem any way for me to get light layers to work.
     
  10. KimmoFactor

    KimmoFactor

    Joined:
    Dec 29, 2020
    Posts:
    27
    ChrisJohnson likes this.
  11. peterbay

    peterbay

    Unity Technologies

    Joined:
    Nov 2, 2017
    Posts:
    91
    fendercodes and ChrisJohnson like this.
  12. ChrisJohnson

    ChrisJohnson

    Joined:
    Feb 20, 2013
    Posts:
    62
    Nice, that will be great!
     
  13. Sir_Mallory

    Sir_Mallory

    Joined:
    Feb 12, 2014
    Posts:
    6
    Glad to hear this about the lights! But in Unity 2022.4, there's a similar issue in the URP renderer. In Filtering, when I try to click on the opaque or transparent layer mask and then I deselect a layer, the corresponding gameobject keeps on being rendered unless it's on Default layer, throwing the error "IndexOutOfRangeException: Index was outside the bounds of the array."
    I don't know if it's a bug or a mistake of mine.
     
  14. leeharris_unity

    leeharris_unity

    Joined:
    Jan 12, 2020
    Posts:
    43
    I don't know if it's a related issue, but after upgrading my project from 2021.3 to 2022.2, any existing System.Flags enums (which I personally was using in ScriptableObjects) could no longer be set to anything other than Nothing or Everything in the inspector panel, though the existing value has been retained regardless. Creating new Flags enums works fine, so it's a bit of a weird one.
     
  15. ChrisJohnson

    ChrisJohnson

    Joined:
    Feb 20, 2013
    Posts:
    62