Search Unity

Question How to add pass to ShaderVariantCollection if it is not part of UnityEngine.Rendering.PassType enum?

Discussion in 'Shaders' started by thebarryman, Aug 18, 2022.

  1. thebarryman

    thebarryman

    Joined:
    Nov 22, 2012
    Posts:
    130
    I am able to add shader variants to a ShaderVariantCollection to be warmed by passing in a ShaderVariant struct with the following format -
    //
    // Summary:
    // Shader to use in this variant.
    public Shader shader;
    //
    // Summary:
    // Pass type to use in this variant.
    public PassType passType;
    //
    // Summary:
    // Array of shader keywords to use in this variant.
    public string[] keywords;

    But what if the LightMode tag is something other than what is included in the PassType enum (as is often the case with new shaders, for example VFX Graph)? Or if it is a named pass without a light mode tag?
     
    ksgy and iuries like this.
  2. ksgy

    ksgy

    Joined:
    Apr 21, 2021
    Posts:
    6
    @thebarryman Were you able to find a answer/solution to this? I'm facing the same issue
     
  3. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,019