Search Unity

Feedback How to set the important LightMode tag of shaders generated from ShaderGraph?

Discussion in 'Shader Graph' started by XRA, Jun 19, 2021.

  1. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    265
    This is very important for working with custom passes in both HDRP and URP.

    When Unity collects/culls/etc all renderers into the cullResults, it collects the LightMode tags as part of the cullResults.

    By specifying ShaderTagId(s) and setting up a DrawingSettings struct, the render pass will filter only the renderers with shaders that use those tags (this is how all rendering in URP and HDRP works), when calling context.DrawRenderers

    Is it possible to define a custom LightMode tag in ShaderGraph, and if not, why not? I would really like to know why it isn't supported.

    I can see that the LightMode tag is written using the PassDescriptor struct, so I don't see why it would be challenging to optionally expose an override for just the Forward descriptor (as a control on the master node).

    Is there a Unity version where this feature is likely to be added?
     
  2. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    445
    It's absolutely required to be able to set LightMode in a ShaderGraph to enable specific features for VFX Graph since I can't just drag & drop a shader into VFX graph because it requires a compatible asset (like a ShaderGraph with enabled VFX compatibility).

    Is this issue still open or does a solution/workaround exist?

    Thanks :).