2 // Vertex shader for procedural bumps
4 // Authors: Randi Rost, John Kessenich
6 // Copyright (c) 2002-2006 3Dlabs Inc. Ltd.
8 // See 3Dlabs-License.txt for license information
11 varying vec3 LightDir;
14 uniform vec3 LightPosition;
16 attribute vec3 Tangent;
20 EyeDir = vec3(gl_ModelViewMatrix * gl_Vertex);
21 gl_Position = ftransform();
22 gl_TexCoord[0] = gl_MultiTexCoord0;
24 vec3 n = normalize(gl_NormalMatrix * gl_Normal);
25 vec3 t = normalize(gl_NormalMatrix * Tangent);
29 v.x = dot(LightPosition, t);
30 v.y = dot(LightPosition, b);
31 v.z = dot(LightPosition, n);
32 LightDir = normalize(v);
37 EyeDir = normalize(v);