Search Unity

Update shader to unity5

Discussion in 'Shaders' started by Spiral12, Mar 3, 2015.

  1. Spiral12

    Spiral12

    Joined:
    Jun 6, 2013
    Posts:
    5
    Hi Im using a shader that looks like photoshop's overlay blending mode.

    When I updated my project to unity5, the shader show this error:

    "Support for SetTexture combiner +- has been removed"

    This is the shader:

    Code (CSharp):
    1. Shader "Custom/Photoshop Overlay"
    2. {
    3.     Properties
    4.     {
    5.         _MainTex ("Base (RGB), Alpha (A)", 2D) = "" {}
    6.     }
    7.     SubShader
    8.     {
    9.         LOD 100
    10.         Tags
    11.         {
    12.             "Queue" = "Transparent"
    13.             "IgnoreProjector" = "True"
    14.             "RenderType" = "Transparent"
    15.         }
    16.         Pass
    17.         {
    18.             Cull Off
    19.             Lighting Off
    20.             ZWrite Off
    21.             Fog { Mode Off }
    22.             Offset -1, -1
    23.             ColorMask RGB
    24.            // AlphaTest Greater .01
    25.             Blend SrcAlpha OneMinusSrcAlpha
    26.             ColorMaterial AmbientAndDiffuse
    27.             SetTexture [_MainTex]
    28.             {
    29.                 Combine Texture +- Primary, Texture * Primary
    30.             }
    31.             SetTexture [_MainTex]
    32.             {
    33.                 Combine Texture +- previous, Texture * Primary
    34.             }
    35.         }
    36.     }
    37. }
    How do I fix it?
     
  2. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    You'll need to write it as a Surface shader or fragment shader. The fixed pipeline is becoming a thing of the past.