Created
October 15, 2012 16:45
-
-
Save jkrup/3893540 to your computer and use it in GitHub Desktop.
Mask shader for Unity3d
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 "Custom/bitmask" | |
{ | |
Properties | |
{ | |
//_MainTex ("Base", 2D) = "black" {} | |
_Mask ("Culling Mask", 2D) = "" {} | |
_Cutoff ("Alpha Cutoff", Range(0,1)) = 0 | |
} | |
SubShader | |
{ | |
Lighting Off | |
ZWrite On | |
Tags {"Queue" = "Geometry"} | |
//Blend OneMinusSrcAlpha DstAlpha | |
blend srcalpha dstalpha | |
Pass { | |
AlphaTest LEqual [_Cutoff] | |
//SetTexture [_Mask] { combine texture } | |
SetTexture [_Mask] { combine texture alpha } //Uncomment to see white | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment