blob: ab0fb775e5420c34cfc9a7932b593831d2454d84 (
plain)
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
|
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 ModelMatrix;
#ifdef USE_WORLD_CLIP_PLANES
uniform vec4 WorldClipPlanes[6];
uniform int WorldClipPlanesLen;
#endif
in float weight;
in vec3 pos;
out vec2 weight_interp; /* (weight, alert) */
void main()
{
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
/* Separate actual weight and alerts for independent interpolation */
weight_interp = max(vec2(weight, -weight), 0.0);
#ifdef USE_WORLD_CLIP_PLANES
{
vec3 worldPosition = (ModelMatrix * vec4(pos, 1.0)).xyz;
for (int i = 0; i < WorldClipPlanesLen; i++) {
gl_ClipDistance[i] = dot(WorldClipPlanes[i].xyz, worldPosition) + WorldClipPlanes[i].w;
}
}
#endif
}
|