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

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

uniform mat4 ModelViewProjectionMatrix;
uniform vec4 faceColor;
uniform vec4 selectColor;
uniform vec4 activeColor;

in vec2 pos;
in int flag;

flat out vec4 finalColor;

/* TODO: Port drawing to draw manager and
 * remove constants duplications. */
#define FACE_UV_ACTIVE (1 << 6)
#define FACE_UV_SELECT (1 << 7)

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

  bool is_selected = (flag & FACE_UV_SELECT) != 0;
  bool is_active = (flag & FACE_UV_ACTIVE) != 0;

  finalColor = (is_selected) ? selectColor : faceColor;
  finalColor = (is_active) ? activeColor : finalColor;
}