- " vec3 N = normalize(gl_NormalMatrix * gl_Normal);\n"
- " vec3 diffuse = gl_FrontMaterial.diffuse.rgb * max(0.0, dot(N, gl_LightSource[0].position.xyz));\n"
- " vec3 backDiffuse = gl_FrontMaterial.diffuse.rgb * max(0.0, dot(-N, gl_LightSource[0].position.xyz));\n"
- " vec4 ambientColor = gl_FrontLightModelProduct.sceneColor + gl_LightSource[0].ambient * gl_FrontMaterial.ambient;\n"
- " gl_FrontColor = ambientColor + gl_LightSource[0].diffuse * vec4(diffuse, 1.0);\n"
- " gl_BackColor = ambientColor + gl_LightSource[0].diffuse * vec4(backDiffuse, 1.0)\n;"
-// " gl_TexCoord[0] = gl_MultiTexCoord0;\n"
- " float fogCoord = abs(ecPosition.z);\n"
+ " float n = dot(normalize(gl_LightSource[0].position.xyz), normalize(-ecPosition));\n"
+ " vec3 diffuse = gl_FrontMaterial.diffuse.rgb * max(0.1, n);\n"
+ " vec4 ambientColor = gl_FrontLightModelProduct.sceneColor + gl_LightSource[0].ambient * gl_FrontMaterial.ambient;\n"
+ " gl_FrontColor = ambientColor + gl_LightSource[0].diffuse * vec4(diffuse, 1.0);\n"
+ " gl_BackColor = gl_FrontColor;\n"
+ " float fogCoord = abs(ecPosition.z);\n"