Skip to content
Snippets Groups Projects
Commit a39080a0 authored by Christopher Tenter's avatar Christopher Tenter
Browse files

- 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
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment