Last active
March 29, 2017 09:01
-
-
Save totutote/b9242a1a97adfcee2fc85abdd4fbd127 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 "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