Skip to content

Instantly share code, notes, and snippets.

@totutote
Last active March 29, 2017 09:01
Show Gist options
  • Save totutote/b9242a1a97adfcee2fc85abdd4fbd127 to your computer and use it in GitHub Desktop.
Save totutote/b9242a1a97adfcee2fc85abdd4fbd127 to your computer and use it in GitHub Desktop.
Shader "Custom/SplitOutIn" {
Properties {
_MainTex( "2D Texture", 2D ) = "white" {}
_AlphaMap ("AlphaMap", 2D) = "white" {}
_AlphaBase( "AlphaBase", Range(-1, 1) ) = 1
}
SubShader {
Tags {
"Queue" = "Transparent"
"RenderType"="Opaque"
}
Cull off
CGPROGRAM
#pragma surface surf Lambert alpha
struct Input {
float2 uv_MainTex;
float2 uv_AlphaMap;
};
sampler2D _MainTex;
sampler2D _AlphaMap;
float _AlphaBase;
void surf (Input IN, inout SurfaceOutput o) {
o.Alpha = tex2D(_AlphaMap, IN.uv_AlphaMap).rgb - _AlphaBase;
o.Albedo = tex2D(_MainTex, IN.uv_MainTex).rgb;
}
ENDCG
}
FallBack "Diffuse"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment