diff options
author | kcr <kcr@28c7f869-5b4e-e670-f602-82bfaf57f300> | 2005-12-06 19:46:01 +0000 |
---|---|---|
committer | kcr <kcr@28c7f869-5b4e-e670-f602-82bfaf57f300> | 2005-12-06 19:46:01 +0000 |
commit | a6f7445079ee5b8b24e48c456dff31ff70e1b5b1 (patch) | |
tree | 3f88c2f94c24fa5e1a6ab9a2d75bfe9778c92422 /src/GLSLShaderTest/toon.vert | |
parent | c6805f980728cf8ebe1a329dc0e584c741accc8d (diff) |
Issue 198 : Need more shader example programs
1) Added Phong shading example
2) Minor mod to SphereGLSL
3) Added toon shader
Diffstat (limited to 'src/GLSLShaderTest/toon.vert')
-rw-r--r-- | src/GLSLShaderTest/toon.vert | 19 |
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)); +} |