i have a small test scene setup with 2 static lights in it. whenever i run the program with the glsl shaders i wrote, the highlighted area moves whenever i move. i know how to fix it in the ogl pipeline but im not sure how to do it in glsl. heres the code.
//vertex program
uniform sampler2D diffmap, lightmap, normalmap, specmap;
varying vec3 lightDir;
varying vec3 normal;
void main()
{
lightDir = normalize(vec3(gl_LightSource[0].position));
normal = normalize(gl_Normal * gl_NormalMatrix);
gl_Position = ftransform();
gl_TexCoord[0] = gl_MultiTexCoord0;
}
//fragment program
uniform sampler2D diffmap, lightmap, normalmap, specmap;
varying vec3 lightDir;
varying vec3 normal;
void main()
{
vec4 dmap = texture2D(diffmap, gl_TexCoord[0].st) * gl_FrontMaterial.diffuse;
vec4 smap = texture2D(specmap, gl_TexCoord[0].st);
//vec4 lmap = texture2D(lightmap, gl_TexCoord[0].st);
//vec4 nmap = texture2D(normalmap, gl_TexCoord[0].st);
float intensity = max(dot(normal, lightDir), 0.0);
//vec4 matEmission = gl_FrontMaterial.emission;
gl_FragColor = dmap * intensity;
}
i have a feeling the problem is in my vertex program but im not quite sure. when i disable the shader the ogl pipeline renders properly without the light moving.