summaryrefslogtreecommitdiff
path: root/data/simple.vert
blob: d9cebc20447440be5da1e9b356e86a97177659db (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
32
33
34
35
36
37
38
#version 120

/* Array of bone (model) matrices.
 */
uniform mat4 m[6];

/* View-projection matrix.
 */
uniform mat4 vp;

attribute vec4 position;
attribute vec4 vert_color;

/* Each bone is influenced by two bones.  The .x and .y fields specify
 * the bones that influence this vertex.  The .z field specifies the
 * weight of the first bone.
 */
attribute vec4 weight;

varying vec4 color;

void main(void)
{
	vec4 px_ws = m[int(weight.x)] * position;
	vec4 py_ws = m[int(weight.y)] * position;

	/* FINISME: Blend the transformed locations.
	 */
	vec4 p_ws = px_ws;


	/* Transform the final world-space position to camera-space and
	 * project.
	 */
	gl_Position = vp * p_ws;

	color = abs(vert_color);
}