Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ID_color_vert.glsl « shaders « snap_context_l « mesh_snap_utilities_line - git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6fb7cbb9cb80efabc4efee3e1f25e5be481909b0 (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
uniform mat4 ModelViewProjectionMatrix;

#ifdef USE_CLIP_PLANES
uniform mat4 ModelMatrix;
uniform bool use_clip_planes;
uniform vec4 clip_plane[4];
out vec4 clip_distance;
#endif

in vec3 pos;

void main()
{
#ifdef USE_CLIP_PLANES
	if (use_clip_planes) {
		vec4 g_pos = ModelMatrix * vec4(pos, 1.0);

		for (int i = 0; i != 4; i++) {
			clip_distance[i] = dot(clip_plane[i], g_pos);
		}
	}
#endif

	gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
}