Skip to content

Instantly share code, notes, and snippets.

@smokelore
Created June 22, 2016 12:28
Show Gist options
  • Save smokelore/916d41205130470928e350b39cd9561b to your computer and use it in GitHub Desktop.
Save smokelore/916d41205130470928e350b39cd9561b to your computer and use it in GitHub Desktop.
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