aboutsummaryrefslogtreecommitdiff
path: root/shaders/normal.vert
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/normal.vert')
-rw-r--r--shaders/normal.vert27
1 files changed, 27 insertions, 0 deletions
diff --git a/shaders/normal.vert b/shaders/normal.vert
new file mode 100644
index 0000000..34ddce3
--- /dev/null
+++ b/shaders/normal.vert
@@ -0,0 +1,27 @@
+#version 150
+in vec3 in_position ;
+in vec3 in_normal ;
+in vec2 in_texMapping ;
+
+uniform mat4 pMat ;
+uniform mat4 mvMat ;
+uniform vec3 light ;
+
+out vec3 trueNormal ;
+out vec2 texCoord ;
+out float intensity ;
+out vec4 location ;
+out vec3 light2 ;
+out vec2 texMapping ;
+out mat3 normalMat ;
+
+// (-4.330127,5.0,7.4999995)
+void main() {
+ light2 = light ; //multMat(mvMat * vec4(light,1)).xyz ;
+
+ location = mvMat * vec4(in_position, 1.0) ;
+ gl_Position = pMat * location;
+ texCoord = vec2(in_position) * vec2(0.5) + vec2(0.5);
+ texMapping = in_texMapping ;
+ trueNormal = inverse(transpose(mat3(mvMat))) * (-in_normal) ;
+}