Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/AlphaFade" {
- Properties {
- _Color ("Main Color", Color) = (1,1,1,1)
- _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
- _Alpha ("Alpha", Range(0,1)) = 1.0
- _Glossiness ("Smoothness", Range(0,1)) = 0.5
- _Metallic ("Metallic", Range(0,1)) = 0.0
- }
- SubShader {
- Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
- LOD 200
- Blend SrcAlpha OneMinusSrcAlpha
- CGPROGRAM
- #pragma surface surf Standard keepalpha
- sampler2D _MainTex;
- fixed4 _Color;
- float _Alpha;
- float _Metallic, _Glossiness;
- struct Input {
- float2 uv_MainTex;
- };
- 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;
- o.Alpha = _Alpha;
- // Metallic and smoothness come from slider variables
- o.Metallic = _Metallic;
- o.Smoothness = _Glossiness;
- }
- ENDCG
- }
- // enable shadow casting
- Fallback "Diffuse"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement