Search Unity

UsePass not using the right Shader variant on iOS

Discussion in 'Shaders' started by C-Gabriel, Apr 13, 2017.

  1. C-Gabriel

    C-Gabriel

    Joined:
    Jan 27, 2016
    Posts:
    119
    Hello,

    I use a replacement shader for one of my cameras and I want the opaque elements to be rendered with a custom shader, but I want the transparent objects to stay the same. My replacement shader looks like this:

    Code (CSharp):
    1. Shader "Hidden/CustomReplShader"
    2. {
    3.     Properties
    4.     {
    5.     }
    6.  
    7.     SubShader
    8.     {
    9.         Tags { "RenderType" = "Distort" }
    10.         ZTest LEqual
    11.         Cull Off
    12.         Lighting Off
    13.  
    14.         LOD 200
    15.  
    16.         UsePass "CustomShaders/Particles/VFX"
    17.     }
    18.  
    19.     SubShader
    20.     {
    21.         Tags { "IgnoreProjector" = "True" "RenderType" = "Opaque" }
    22.         ZTest LEqual
    23.         Cull Back
    24.         Lighting Off
    25.  
    26.         LOD 200
    27.  
    28.         Pass
    29.         {
    30.             Blend Off
    31.  
    32.             Name "OPAQUE_REPLACEMENT"
    33.             Tags{ "LightMode" = "Always" }
    34.             Fog { Mode Off }
    35.  
    36.             Lighting Off
    37.             SeparateSpecular Off
    38.  
    39.             Color(0, 0, 0, 1)
    40.         }
    41.     }
    42.  
    43.     FallBack Off
    44. }
    The problem is that it is not using the proper shader variant on the device, but it does on windows. Any idea why this might be happening?
     
    Last edited: Apr 13, 2017