Created
June 22, 2016 12:28
-
-
Save smokelore/916d41205130470928e350b39cd9561b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "CookbookShaders/Transparent" | |
{ | |
Properties | |
{ | |
_Color("Color", Color) = (1,1,1,1) | |
_MainTex("Albedo (RGB)", 2D) = "white" {} | |
} | |
SubShader { | |
// Transparent (ordering) | |
Tags | |
{ | |
"Queue" = "Transparent" | |
"IgnoreProjector" = "True" | |
"RenderType" = "Transparent" | |
} | |
// Removes back geometry | |
Cull Back | |
CGPROGRAM | |
// Alpha blending | |
#pragma surface surf Standard alpha:fade | |
sampler2D _MainTex; | |
fixed4 _Color; | |
struct Input | |
{ | |
float2 uv_MainTex; | |
}; | |
void surf(Input IN, inout SurfaceOutputStandard o) | |
{ | |
float4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; | |
o.Albedo = c.rgb; | |
o.Alpha = c.a; | |
} | |
ENDCG | |
} | |
FallBack "Diffuse" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment