I'm trying to setup a basic directional light that matches the fixed pipeline.
However, my GLSL version looks like a point light, with very dark edges.
Ambient is zero, specular is zero, and attenuation is off, so it doesn't interfere.
How can I match the same shading as seen in the fixed version?
//////////////////////////////////////////
// VERTEX SHADER
varying vec3 N;
varying vec3 L;
void main()
{
N = normalize(gl_NormalMatrix * gl_Normal);
L = normalize(gl_LightSource[0].position.xyz); // directional light
gl_Position = ftransform();
}
//////////////////////////////////////////
// FRAGMENT SHADER
varying vec3 N;
varying vec3 L;
void main()
{
N = normalize(N);
L = normalize(L);
float lamb = max( dot(N,L), 0.0 );
vec4 diffuseColor = vec4(1,1,1,1);
gl_FragColor = lamb * diffuseColor;
}