Search Unity

[solved] Extremely simple Vertex Color shader won't work on Android

Discussion in 'Shaders' started by Razorwings18, Sep 29, 2014.

  1. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    The following shader works on Android:

    Code (CSharp):
    1. Shader "Mobile/Lit Vertex Color" {
    2.     Properties {
    3.        _MainTex ("Base (RGB)", 2D) = "white" {}
    4.     }
    5.     SubShader {
    6.        Pass {
    7.            Lighting On
    8.            ColorMaterial AmbientAndDiffuse
    9.            SetTexture [_MainTex] {
    10.               combine texture * primary DOUBLE
    11.            }
    12.        }
    13.     }
    14. }
    Still, this modification will not -it shows pink-. It works perfectly on Windows.

    Code (CSharp):
    1. Shader "Mobile/Lit Inverse Vertex Color" {
    2.     Properties {
    3.        _MainTex ("Base (RGB)", 2D) = "white" {}
    4.     }
    5.     SubShader {
    6.        Pass {
    7.            Lighting On
    8.            ColorMaterial AmbientAndDiffuse
    9.            SetTexture [_MainTex] {
    10.               combine texture * primary DOUBLE
    11.            }
    12.            SetTexture [_MainTex] {
    13.               ConstantColor (0.7,0.7,0.7,0.7)
    14.               combine one - previous * constant
    15.            }
    16.        }
    17.     }
    18. }
    My intention is just to invert and reduce the brightness of the first shader.
     
  2. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    The shader was only set via code, so it was not included in the build. Moving it to the Resources folder fixed it.