summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2012-12-11 11:05:52 -0800
committerMatt Turner <mattst88@gmail.com>2012-12-11 11:05:52 -0800
commitde28b8ba484266a03b8650326b306785d75720b3 (patch)
tree2113476378d3799659bd3d7ee57335630d0810f5 /data
Initial import
Diffstat (limited to 'data')
-rw-r--r--data/simple.frag6
-rw-r--r--data/simple.vert39
2 files changed, 45 insertions, 0 deletions
diff --git a/data/simple.frag b/data/simple.frag
new file mode 100644
index 0000000..abdaed5
--- /dev/null
+++ b/data/simple.frag
@@ -0,0 +1,6 @@
+varying vec4 color;
+
+void main(void)
+{
+ gl_FragColor = color;
+}
diff --git a/data/simple.vert b/data/simple.vert
new file mode 100644
index 0000000..7d771c4
--- /dev/null
+++ b/data/simple.vert
@@ -0,0 +1,39 @@
+#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)
+{
+ /* FINISHME: Transform the vertex by each of the bones that influence
+ * FINISHME: it.
+ */
+ vec4 p_ws = m[0] * position;
+
+ /* FINISME: Blend the transformed locations.
+ */
+
+
+ /* Transform the final world-space position to camera-space and
+ * project.
+ */
+ gl_Position = vp * p_ws;
+
+ color = abs(vert_color);
+}