summaryrefslogtreecommitdiffstats
path: root/src/GLSLShaderTest/toon.vert
diff options
context:
space:
mode:
Diffstat (limited to 'src/GLSLShaderTest/toon.vert')
-rw-r--r--src/GLSLShaderTest/toon.vert19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/GLSLShaderTest/toon.vert b/src/GLSLShaderTest/toon.vert
new file mode 100644
index 0000000..d044af7
--- /dev/null
+++ b/src/GLSLShaderTest/toon.vert
@@ -0,0 +1,19 @@
+//
+// Vertex shader for cartoon-style shading
+//
+// Author: Philip Rideout
+//
+// Copyright (c) 2004 3Dlabs Inc. Ltd.
+//
+// See 3Dlabs-License.txt for license information
+//
+
+varying vec3 Normal;
+varying vec3 LightDir;
+
+void main(void)
+{
+ Normal = normalize(gl_NormalMatrix * gl_Normal);
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+ LightDir = vec3(normalize(gl_LightSource[0].position));
+}