Search Unity

LWRP specify custom layer mask per renderer features

Discussion in 'Universal Render Pipeline' started by Trojet, Jul 5, 2019.

  1. Trojet

    Trojet

    Joined:
    Jul 5, 2019
    Posts:
    1
    im having an issue where im using a custom renderer type within my rederer pipeline asset, this custom Forward renderer is having 2 renderer feaures, the first one is using the outline effect which is applicable on everything as a layer mask, the second just change characters color when behind something big ( buildings, houses, trees .. ) but even small objects (grass ...) are changing the parts of the character behind that object which is anoying .
    so is it possible to set a custom layer per renderer feature or setting multiple custom forward renderers to my pipeline renderer asset ?
     
  2. CruS

    CruS

    Joined:
    May 29, 2013
    Posts:
    9
    wondering the same..!
     
  3. tjmaul

    tjmaul

    Joined:
    Aug 29, 2018
    Posts:
    467
    You can set a different layer for each Draw call. This means that you can have layer settings for each ScriptableRendererFeature (that forwards this setting to a ScriptableRenderPass) or for each ScriptableRenderPass. But coding this is up to you.

    More specific to your question is why the grass writes to the depth buffer which is used to decide wether to change the character color if its behind something or not.

    You can also just try change the render order so that grass or small objects are drawn after the “behind something”-color is drawn.