varying vec3 v_fragpos; varying vec3 v_normal; #if NORMALMAP varying vec3 v_tangent; varying vec3 v_bitangent; attribute vec3 tangent; #endif uniform vec3 z_sun_direction; varying vec3 Lsun; void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; gl_TexCoord[0] = gl_MultiTexCoord0; v_normal = gl_NormalMatrix * gl_Normal; #if NORMALMAP v_tangent = gl_NormalMatrix * tangent; v_bitangent = cross(v_normal, v_tangent); #endif v_fragpos = (gl_ModelViewMatrix * gl_Vertex).xyz; Lsun = -(gl_NormalMatrix * normalize(z_sun_direction)); }