summaryrefslogtreecommitdiff
path: root/shaders/humus-raytracedshadows/5.vert
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2011-09-08 23:02:27 -0700
committerEric Anholt <eric@anholt.net>2011-09-08 23:03:26 -0700
commitd46e939d8f28ed1c4162a33e99378d5797e4e3a1 (patch)
treef8b4f027e364551548ae84d2a45e4e232bf6d964 /shaders/humus-raytracedshadows/5.vert
parent701c7392029e2364d3de14d31f22e99ae421e389 (diff)
Add some Humus demos I had around.
Diffstat (limited to 'shaders/humus-raytracedshadows/5.vert')
-rw-r--r--shaders/humus-raytracedshadows/5.vert26
1 files changed, 26 insertions, 0 deletions
diff --git a/shaders/humus-raytracedshadows/5.vert b/shaders/humus-raytracedshadows/5.vert
new file mode 100644
index 0000000..3c3c10a
--- /dev/null
+++ b/shaders/humus-raytracedshadows/5.vert
@@ -0,0 +1,26 @@
+#define saturate(x) clamp(x,0.0,1.0)
+#define lerp mix
+#line 0
+
+
+uniform vec3 lightPos;
+
+uniform float scale;
+uniform vec3 offset;
+
+varying vec3 lightVec;
+varying vec3 normal;
+
+void main(){
+ vec4 pos = gl_Vertex;
+ pos.xyz *= scale;
+ pos.xyz += offset;
+
+ gl_Position = gl_ModelViewProjectionMatrix * pos;
+
+ lightVec = normalize(lightPos - pos.xyz);
+ normal = gl_Vertex.xyz;
+}
+
+
+