Direction light working.
Cleaned up some code in Renderer.cpp
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user