Created
November 12, 2021 19:08
-
-
Save sim2kid/5ecf3fc11380cb2ed014dd62ff4e58c1 to your computer and use it in GitHub Desktop.
Two Sided Cutout Shader Unity
This file contains hidden or 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 "Transparent/TwoSidedCutOut" | |
{ | |
Properties | |
{ | |
_Color("Main Color", Color) = (1,1,1,1) | |
_MainTex("Base (RGB) Trans (A)", 2D) = "white" {} | |
_Cutoff("Alpha cutoff", Range(0,1)) = 0.5 | |
} | |
SubShader | |
{ | |
Tags {"Queue" = "AlphaTest" "IgnoreProjector" = "True" "RenderType" = "TransparentCutout"} | |
Cull off | |
LOD 300 | |
CGPROGRAM | |
#pragma surface surf Lambert alphatest:_Cutoff | |
sampler2D _MainTex; | |
fixed4 _Color; | |
struct Input | |
{ | |
float2 uv_MainTex; | |
}; | |
void surf(Input IN, inout SurfaceOutput o) | |
{ | |
fixed4 MAIN = tex2D(_MainTex, IN.uv_MainTex) * _Color; | |
o.Albedo = MAIN.rgb; | |
o.Alpha = MAIN.a; | |
} | |
ENDCG | |
} | |
FallBack "Transparent/Cutout/Diffuse" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment