summaryrefslogtreecommitdiff
path: root/shaders/humus-raytracedshadows/5.vert
diff options
context:
space:
mode:
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;
+}
+
+
+