shadow.glsl
637 字节
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
@export ecgl.sm.depth.vertex
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
attribute vec3 position : POSITION;
attribute vec2 texcoord : TEXCOORD_0;
#ifdef VERTEX_ANIMATION
attribute vec3 prevPosition;
uniform float percent : 1.0;
#endif
varying vec4 v_ViewPosition;
varying vec2 v_Texcoord;
void main(){
#ifdef VERTEX_ANIMATION
vec3 pos = mix(prevPosition, position, percent);
#else
vec3 pos = position;
#endif
v_ViewPosition = worldViewProjection * vec4(pos, 1.0);
gl_Position = v_ViewPosition;
v_Texcoord = texcoord;
}
@end
@export ecgl.sm.depth.fragment
@import clay.sm.depth.fragment
@end