- Home /
Mobile controlled transparency shader
I'm pretty new to any shader or programming. So my issue is, i had done following shader:
Shader "Mobile/Background A" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Alpha("_Alpha", Float) = 1
}
SubShader {
Tags {"Queue" = "Background" }
Material { }
Lighting Off
Zwrite off
CGPROGRAM
#pragma surface surf Lambert alpha
sampler2D _MainTex;
fixed _Alpha;
struct Input {
fixed2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
o.Albedo = c;
o.Alpha = _Alpha;
}
ENDCG
}
Fallback "Diffuse"
}
It is not fast enough. Is there any obvious mistakes that i made?
WBR.
Comment