I am new to unity and am developing for iPhone. I come from writing engines on both ios and Android. So I am well acquainted with writing shaders and render context for Alpha. I just don’t know how this works in Unity.
If I switch to the standard shader, I see the texture alpha kick on in the editor. But if I switch to mobile diffuse, I don’t see any alpha. I look at the shaders and sure enough, the shader is outputting the alpha.
So it must be a context issue. How do I enable alpha? I tried this with a custom shader:
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
// Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Standard fullforwardshadows
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
};
half _Glossiness;
half _Metallic;
fixed4 _Color;
void surf (Input IN, inout SurfaceOutputStandard o) {
// Albedo comes from a texture tinted by color
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
o.Albedo = c.rgb;
// Metallic and smoothness come from slider variables
o.Metallic = _Metallic;
o.Smoothness = _Glossiness;
o.Alpha = c.a;
}
ENDCG
}
Still no alpha (I haven’t actually sent this to a device, this is just what I am seeing in the editor–which I am assuming I should be able to see the alpha, correct?) What am I doing wrong here?
Thanks in advance