Seems like using separate blend factors for color and alpha channels in shaders is not supported on Windows Phone platform.
The shader below will be marked as unsupported because of this line:
Shader "Custom/SimpleShader"
{
Properties
{
[HideInInspector] _MainTex ("", 2D) = "" {}
}
SubShader
{
Pass
{
Lighting Off
Fog { Mode off }
ZWrite Off
ZTest Always
Cull Off
Blend SrcAlpha OneMinusSrcAlpha, Zero One
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct v2f
{
float4 pos : POSITION;
half2 uv : TEXCOORD0;
};
uniform sampler2D _MainTex;
v2f vert(appdata_img v)
{
v2f o;
o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
o.uv = v.texcoord.xy;
return o;
}
fixed4 frag(v2f i) : COLOR
{
return tex2D(_MainTex, i.uv);
}
ENDCG
}
}
FallBack Off
}
But I’ve found a workaround for this issue and that’s the reason of why I’m positng it here. This will work:
Shader "Custom/SimpleShader"
{
Properties
{
[HideInInspector] _MainTex ("", 2D) = "" {}
[HideInInspector] _SrcFactor ("", Float) = 5 // SrcAlpha
[HideInInspector] _DstFactor ("", Float) = 10 // OneMinusSrcAlpha
[HideInInspector] _SrcFactorA ("", Float) = 0 // Zero
[HideInInspector] _DstFactorA ("", Float) = 1 // One
}
SubShader
{
Pass
{
Lighting Off
Fog { Mode off }
ZWrite Off
ZTest Always
Cull Off
Blend [_SrcFactor] [_DstFactor], [_SrcFactorA] [_DstFactorA]
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct v2f
{
float4 pos : POSITION;
half2 uv : TEXCOORD0;
};
uniform sampler2D _MainTex;
v2f vert(appdata_img v)
{
v2f o;
o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
o.uv = v.texcoord.xy;
return o;
}
fixed4 frag(v2f i) : COLOR
{
return tex2D(_MainTex, i.uv);
}
ENDCG
}
}
FallBack Off
}
So it seems like shader compilation bug, @Aras
I’m on Unity 4.6.1f1, btw.