Shader "Custom/ViewPortTexture"
{
Properties
{
_Mask ("Culling Mask", 2D) = "black" {}
_MaskLevel ("Mask Alpha", Range(0, 1)) = 0.5
}
SubShader
{
Tags {"Queue" = "Background"}
Blend SrcAlpha OneMinusSrcAlpha
Lighting Off
ZWrite On
ZTest Always
Alphatest LEqual [_MaskLevel]
Pass
{
SetTexture [_Mask] {combine texture}
}
}
}
一個用作 Camera Mask 的 Shader. 😀