Search Unity

Feature Request Any plans to expose rendering layers for filtering?

Discussion in 'Universal Render Pipeline' started by r9shackleford, Mar 10, 2023.

  1. r9shackleford

    r9shackleford

    Joined:
    Jul 23, 2019
    Posts:
    23
    Currently, the Universal Renderer Data allows you to filter based on builtin layers(which are shared with physics):

    And on the renderer feature, which also accepts a builtin layer:

    But not rendering layers. Is there any plan to add this?

    This is already exposed internally on FilteringSettings, which accepts a renderingLayerMask. We use a patched version of the URP internally which makes a small modification to expose this, see my post here for the changes+rationale.
     
  2. ali_mohebali

    ali_mohebali

    Unity Technologies

    Joined:
    Apr 8, 2020
    Posts:
    119
    Hi there, just to confirm that this is indeed planned, and it's one of our priorities in our backlog.
     
  3. Allan-MacDonald

    Allan-MacDonald

    Joined:
    Sep 21, 2015
    Posts:
    112
  4. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    345
    I noticed that this exists in filtering settings a while ago too and was very suprised that it hasn't made it into the renderer feature yet. I just forked the render objects feature and added support for it myself too ^^ and it has been working great for months. Very much recommend doing this for everyone, although exposing it in the UI is a bit more troublesome (see the linked thread above, it's mentioned there as well), but very much doable too.

    I have a dedicated physics layer for "rendering only" objects to divide this a bit more clearly and manage everything else from player silhouette to outlines etc etc. through the rendering layers. Which is super nice because rendering layers are not exclusive opposed to physics layers, so you can do put a renderer on the Character and Outline Layer.
     
    Last edited: Nov 12, 2023
    Fressbrett and Allan-MacDonald like this.
  5. Fressbrett

    Fressbrett

    Joined:
    Apr 11, 2018
    Posts:
    97
    that sounds pretty cool, I would love to have this distinction between rendering and physics. It’s been quite troublesome having to sustain both needs within a 32bit mask, especially when you want to switch layers during runtime for physics reasons but don’t want that to affect rendering.

    Is your solution still working, and would you mind sharing it?

     
  6. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    345
    It is still working (at least in 2022.x).
    Unfortunately I can't share code from the company repo :confused:

    There are a few things on the render objects renderer feature that can be improved if you ask me. I should probably just rewrite my entire hack in my free time and publish it somehow yes ^^
     
    Fressbrett likes this.