summaryrefslogtreecommitdiffstats
path: root/src/demos/instancedRendering/shader/triangles.vp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-10-24 17:47:51 +0200
committerSven Gothel <[email protected]>2014-10-24 17:47:51 +0200
commitb2da4858e8b5cb2ec3131ed76e2c61ad4a8a2e1c (patch)
tree047c266b721c840f367c143b1724157ee1d5ae69 /src/demos/instancedRendering/shader/triangles.vp
parent4392e90ea2909d89895d992833bf9e71ae922a1d (diff)
parent5a37c7f33e5b3584a3561f240392814940a69956 (diff)
Merge pull request #7 from toruwest/master
Test case of how to use instanced rendering.
Diffstat (limited to 'src/demos/instancedRendering/shader/triangles.vp')
-rw-r--r--src/demos/instancedRendering/shader/triangles.vp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/demos/instancedRendering/shader/triangles.vp b/src/demos/instancedRendering/shader/triangles.vp
new file mode 100644
index 0000000..91cc6ef
--- /dev/null
+++ b/src/demos/instancedRendering/shader/triangles.vp
@@ -0,0 +1,17 @@
+// Copyright 2014 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+ #define attribute in
+ #define varying out
+#endif
+
+uniform mat4 mgl_PMatrix;
+uniform mat4 mgl_MVMatrix[NO_OF_INSTANCE];
+attribute vec3 mgl_Vertex;
+attribute vec4 mgl_Color;
+varying vec4 frontColor;
+
+void main(void) {
+ frontColor = mgl_Color;
+ gl_Position = mgl_PMatrix * mgl_MVMatrix[gl_InstanceID] * vec4(mgl_Vertex, 1);
+}