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

edit_mesh_overlay_facefill_vert.glsl « shaders « modes « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3b9aa77306fd79750088af53546e9be960fb6f00 (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

uniform mat4 ModelViewProjectionMatrix;

in vec3 pos;
in ivec4 data;

flat out vec4 faceColor;
flat out int faceActive;

#define FACE_ACTIVE   (1 << 2)
#define FACE_SELECTED (1 << 3)

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

	if ((data.x & FACE_ACTIVE) != 0) {
		faceColor = colorEditMeshActive;
		faceActive = 1;
	}
	else if ((data.x & FACE_SELECTED) != 0) {
		faceColor = colorFaceSelect;
		faceActive = 0;
	}
	else {
		faceColor = colorFace;
		faceActive = 0;
	}
}