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

gpu_shader_2D_edituvs_edges_vert.glsl « shaders « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0fddbddddc5b107d0ca75950f405a9e17a439006 (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
31

uniform mat4 ModelViewProjectionMatrix;
uniform vec4 edgeColor;
uniform vec4 selectColor;

in vec2 pos;
in int flag;

#ifdef SMOOTH_COLOR
noperspective out vec4 finalColor;
#else
flat out vec4 finalColor;
#endif

/* TODO: Port drawing to draw manager and
 * remove constants duplications. */
#define VERT_UV_SELECT  (1 << 3)
#define EDGE_UV_SELECT  (1 << 5)

void main()
{
	gl_Position = ModelViewProjectionMatrix * vec4(pos, 0.0, 1.0);

#ifdef SMOOTH_COLOR
	bool is_select = (flag & VERT_UV_SELECT) != 0;
#else
	bool is_select = (flag & EDGE_UV_SELECT) != 0;
#endif

	finalColor = (is_select) ? selectColor : edgeColor;
}