您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
56 行
1.2 KiB
56 行
1.2 KiB
Shader "UIWidgets/canvas_stencil"
|
|
{
|
|
Properties {
|
|
}
|
|
|
|
SubShader {
|
|
ZTest Always
|
|
ZWrite Off
|
|
|
|
Pass { // 0, stencil clear
|
|
ColorMask 0
|
|
Stencil {
|
|
Ref 128
|
|
Pass Replace
|
|
}
|
|
|
|
CGPROGRAM
|
|
#include "UIWidgets_canvas.cginc"
|
|
#pragma vertex vert
|
|
#pragma fragment frag_stencil
|
|
ENDCG
|
|
}
|
|
|
|
Pass { // 1, stencil intersect 0
|
|
Cull Off
|
|
ColorMask 0
|
|
Stencil {
|
|
WriteMask 127
|
|
PassFront IncrWrap
|
|
PassBack DecrWrap
|
|
}
|
|
|
|
CGPROGRAM
|
|
#include "UIWidgets_canvas.cginc"
|
|
#pragma vertex vert
|
|
#pragma fragment frag_stencil
|
|
ENDCG
|
|
}
|
|
|
|
Pass { // 2, stencil intersect 1
|
|
ColorMask 0
|
|
Stencil {
|
|
Ref 128
|
|
Comp Less
|
|
Pass Replace
|
|
Fail Zero
|
|
}
|
|
|
|
CGPROGRAM
|
|
#include "UIWidgets_canvas.cginc"
|
|
#pragma vertex vert
|
|
#pragma fragment frag_stencil
|
|
ENDCG
|
|
}
|
|
}
|
|
}
|