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