- Home /
Question by
DoubleNoe7 · Mar 07, 2013 at 10:58 AM ·
transparencyalpha
How Do I make my texture transparent given this code?
Shader "Custom/FresnelShader" { Properties { _Shininess ("Shininess", Range (0.01, 3)) = 1
_MyColor ("Shine Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
float _Shininess;
fixed4 _MyColor;
struct Input {
float2 uv_MainTex;
float3 viewDir;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
//o.Normal = UnpackNormal(tex2D(_Bump, IN.uv_Bump));
half factor = dot(normalize(IN.viewDir),o.Normal);
o.Albedo = c.rgb+_MyColor*(_Shininess-factor*_Shininess);
o.Emission.rgb = _MyColor*(_Shininess-factor*_Shininess);
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
Comment