aboutsummaryrefslogtreecommitdiffstats
path: root/src/GLSLShaderTest/dimple.vert
diff options
context:
space:
mode:
authornobody <nobody@28c7f869-5b4e-e670-f602-82bfaf57f300>2005-10-17 21:17:15 +0000
committernobody <nobody@28c7f869-5b4e-e670-f602-82bfaf57f300>2005-10-17 21:17:15 +0000
commit96a50f0092524c823a31d2e6b2882d9b9f098292 (patch)
treefacc740ba800f3a3f68e0fb585965b22f78b653c /src/GLSLShaderTest/dimple.vert
parentd73245421b294f50b9d4728bcbc717876f83d250 (diff)
This commit was manufactured by cvs2svn to create tagpostmerge-1_4-1_3_3-A
'postmerge-1_4-1_3_3-A'.
Diffstat (limited to 'src/GLSLShaderTest/dimple.vert')
-rw-r--r--src/GLSLShaderTest/dimple.vert41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/GLSLShaderTest/dimple.vert b/src/GLSLShaderTest/dimple.vert
new file mode 100644
index 0000000..0707d71
--- /dev/null
+++ b/src/GLSLShaderTest/dimple.vert
@@ -0,0 +1,41 @@
+
+//
+// dimple.vert: Vertex shader for bump mapping dimples (bumps)
+//
+// author: John Kessenich
+//
+// Copyright (c) 2002: 3Dlabs, Inc.
+//
+
+varying vec3 LightDir;
+varying vec3 EyeDir;
+varying vec3 Normal;
+
+//uniform vec3 LightPosition;
+//uniform float Scale;
+vec3 LightPosition = vec3(0.0, 0.0, 5.0);
+float Scale = 1.0;
+
+void main(void)
+{
+ vec4 pos = gl_ModelViewMatrix * gl_Vertex;
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec3 eyeDir = vec3(pos);
+// gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_TexCoord[0] = gl_Vertex;
+
+ vec3 n = normalize(gl_NormalMatrix * gl_Normal);
+ vec3 t = normalize(cross(vec3(1.141, 2.78, 3.14), n));
+ vec3 b = cross(n, t);
+
+ vec3 v;
+ v.x = dot(LightPosition, t);
+ v.y = dot(LightPosition, b);
+ v.z = dot(LightPosition, n);
+ LightDir = normalize(v);
+
+ v.x = dot(eyeDir, t);
+ v.y = dot(eyeDir, b);
+ v.z = dot(eyeDir, n);
+ EyeDir = normalize(v);
+}