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: 747b33e9a7282b3c3265917a9ae224e6c2486115 (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 WorldClipPlanes[4];
#endif

in vec3 pos;

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

    gl_ClipDistance[0] = dot(WorldClipPlanes[0], g_pos);
    gl_ClipDistance[1] = dot(WorldClipPlanes[1], g_pos);
    gl_ClipDistance[2] = dot(WorldClipPlanes[2], g_pos);
    gl_ClipDistance[3] = dot(WorldClipPlanes[3], g_pos);
	}
#endif

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