blob: 63891b9354031029029e4b42912daac74949c500 (
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
|
#version 120
uniform bool use_clip_planes;
uniform vec4 clip_plane[4];
varying vec4 clip_distance;
uniform mat4 MV;
uniform mat4 MVP;
attribute vec3 pos;
attribute float primitive_id;
varying float primitive_id_var;
void main()
{
if (use_clip_planes) {
vec4 g_pos = MV * vec4(pos, 1.0);
clip_distance[0] = dot(clip_plane[0], g_pos);
clip_distance[1] = dot(clip_plane[1], g_pos);
clip_distance[2] = dot(clip_plane[2], g_pos);
clip_distance[3] = dot(clip_plane[3], g_pos);
}
primitive_id_var = primitive_id;
gl_Position = MVP * vec4(pos, 1.0);
}
|