Commit a39080a0 authored by Christopher Tenter's avatar Christopher Tenter

- fix specular lighting of directional lights in the shader pipeline

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18403 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 75a4a361
......@@ -32,7 +32,7 @@ vec3 LitPointLight(vec3 vPosition,
cLight += ldotn * cLightDiffuse * g_cDiffuse;
// specular
vec3 h = normalize(vLightDir - normalize(vPosition)); // half vector between light and view direction
vec3 h = normalize(vLightDir - vec3(0,0,-1)); // half vector between light and view direction
float hdotn = max(dot(h, vNormal), 0.0);
cLight += (pow(hdotn, SHININESS) * cLightSpecular) * g_cSpecular;
......@@ -59,7 +59,7 @@ vec3 LitDirLight(vec3 vPosition,
cLight += ldotn * cLightDiffuse * g_cDiffuse;
// specular
vec3 h = normalize(vLightDir - normalize(vPosition)); // half vector between light and view direction
vec3 h = normalize(vLightDir - vec3(0,0,-1)); // half vector between light and view direction
float hdotn = max(dot(h, vNormal), 0.0);
cLight += (pow(hdotn, SHININESS) * cLightSpecular) * g_cSpecular;
......@@ -92,7 +92,7 @@ vec3 LitSpotLight(vec3 vPosition,
cLight += ldotn * cLightDiffuse * g_cDiffuse;
// specular
vec3 h = normalize(vLightDir - normalize(vPosition)); // half vector between light and view direction
vec3 h = normalize(vLightDir - vec3(0,0,-1)); // half vector between light and view direction
float hdotn = max(dot(h, vNormal), 0.0);
cLight += (pow(hdotn, SHININESS) * cLightSpecular) * g_cSpecular;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment