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.
  2. Dismiss Notice

Resolved URP Render Objects support for Rendering Layers

Discussion in 'SRP Dev Blitz Day 2022 - Q&A' started by Prodigga, Sep 28, 2022.

  1. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,121
    There was some movement on this here
    https://forum.unity.com/threads/ren...sing-support-for-rendering-layer-mask.867391/

    Here is the last pull request I know of with any movement on this before it was shelved:
    https://github.com/Unity-Technologies/Graphics/pull/1891

    It seemed to have been shelved because the URP team was trying to figure out how to make it work with shadows and such.

    I think it would be useful to have even if it didn't work with lighting systems.

    Using RenderObjects for an Occlusion Effect is a common example:
    https://github.com/Unity-Technologies/UniversalRenderingExamples/wiki/Occlusion

    If we were allowed to specify Render Layer's in the RenderObject's pass then we could dedicate certain layers to be for certain effects.

    For example, in my project RenderingLayer 25 could be for the Occlusion Effect. RenderingLayer 26 could be for Outline effect. RenderingLayer 27 could be for SomeOtherCoolEffect.

    Now any MeshRenderer in the game can 'opt in' to be a part of any number of my effects! I just have to include it in the appropriate RenderingLayer. This is easy to control at runtime too. IE when the cursor hovers over an object, add RenderLayer 26 to its RenderingLayerMask and boom - outline effect around the item your cursor is hovering over..!
     
    goncalo-vasconcelos likes this.
  2. LukasCh

    LukasCh

    Unity Technologies

    Joined:
    Mar 9, 2015
    Posts:
    102
    Prodigga likes this.