]> git.tdb.fi Git - libs/gl.git/commitdiff
Actually use the light color in cooktorrance shader
authorMikko Rasa <tdb@tdb.fi>
Sun, 2 Aug 2020 12:04:41 +0000 (15:04 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 2 Aug 2020 12:04:41 +0000 (15:04 +0300)
shaderlib/cooktorrance.glsl

index e23f12190b5f77da6a425842a15986a44801b876..85d7f4f38e5b2af92b6d3cfa60c5a15bd2767b3a 100644 (file)
@@ -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)