From: Mikko Rasa Date: Sun, 2 Aug 2020 12:04:41 +0000 (+0300) Subject: Actually use the light color in cooktorrance shader X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=f38c24ad1765f39f620267c0a85e532cb851baac;p=libs%2Fgl.git Actually use the light color in cooktorrance shader --- diff --git a/shaderlib/cooktorrance.glsl b/shaderlib/cooktorrance.glsl index e23f1219..85d7f4f3 100644 --- a/shaderlib/cooktorrance.glsl +++ b/shaderlib/cooktorrance.glsl @@ -113,7 +113,7 @@ vec3 cooktorrance_one_light_direct(vec3 normal, vec3 look, vec3 light, vec3 ligh vec3 k_diff = (1.0-k_spec)*(1.0-metalness); float denom = max(4.0*max(dot(normal, -look), 0.0)*max(dot(normal, light), 0.0), 0.001); - return max(dot(normal, light), 0.0)*(k_diff*lambert_diffuse(base_color)+k_spec*ndist*geom/denom); + return max(dot(normal, light), 0.0)*light_color*(k_diff*lambert_diffuse(base_color)+k_spec*ndist*geom/denom); } vec3 cooktorrance_lighting(vec3 normal, vec3 look, vec3 base_color, float metalness, float roughness)