-
Notifications
You must be signed in to change notification settings - Fork 6
/
VolumeStencil.shader
38 lines (33 loc) · 997 Bytes
/
VolumeStencil.shader
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Shader "BASICxSHADER/Shadow/VolumeStencil" {
Properties {
_Intensity ("Intensity", Range (0, 1)) = 0.5
}
SubShader {
Cull Off ZWrite Off ZTest Always
Pass {
Blend SrcAlpha OneMinusSrcAlpha
Stencil {
Ref 0
Comp NotEqual
}
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// Properties
uniform half _Intensity;
//------------------------------------------------------------------------
// Vertex Shader
//------------------------------------------------------------------------
float4 vert(float4 vertex : POSITION) : SV_POSITION {
return UnityObjectToClipPos(vertex);
}
//------------------------------------------------------------------------
// Fragment Shader
//------------------------------------------------------------------------
fixed4 frag() : SV_Target {
return fixed4(0, 0, 0, _Intensity);
}
ENDCG
}
}
}