aboutsummaryrefslogtreecommitdiff
path: root/data/shaders/bump-poly.vert
diff options
context:
space:
mode:
Diffstat (limited to 'data/shaders/bump-poly.vert')
-rw-r--r--data/shaders/bump-poly.vert16
1 files changed, 16 insertions, 0 deletions
diff --git a/data/shaders/bump-poly.vert b/data/shaders/bump-poly.vert
new file mode 100644
index 0000000..0207c37
--- /dev/null
+++ b/data/shaders/bump-poly.vert
@@ -0,0 +1,16 @@
+attribute vec3 position;
+attribute vec3 normal;
+
+uniform mat4 ModelViewProjectionMatrix;
+uniform mat4 NormalMatrix;
+
+varying vec3 Normal;
+
+void main(void)
+{
+ // Transform the normal to eye coordinates
+ Normal = normalize(vec3(NormalMatrix * vec4(normal, 1.0)));
+
+ // Transform the position to clip coordinates
+ gl_Position = ModelViewProjectionMatrix * vec4(position, 1.0);
+}