Direction light working.

Cleaned up some code in Renderer.cpp
This commit is contained in:
Tleety
2014-05-27 03:09:52 +02:00
parent 7d82c43df9
commit 2db52ded2f
9 changed files with 192 additions and 54 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ vec4 phong(vec3 position, vec3 normal, vec3 specular)
vec3 surfaceToViewer = normalize(-position);
vec3 halfWay = normalize(surfaceToViewer + directionToLight);
float dotSpecular = max(dot(halfWay, normal), 0.0);
float specularFactor = pow(dotSpecular, specularExponent * 2.0);
float specularFactor = pow(dotSpecular, specularExponent);
vec3 Is = specular.r * ls * specularFactor;
//Attenuation