]> git.tdb.fi Git - libs/gl.git/blobdiff - shaderlib/cooktorrance.glsl
Actually use the light color in cooktorrance shader
[libs/gl.git] / shaderlib / cooktorrance.glsl
index 1e00e1f5f6c426ef9fce488e3c92d9c80fed00ac..85d7f4f38e5b2af92b6d3cfa60c5a15bd2767b3a 100644 (file)
@@ -49,7 +49,7 @@ vec3 get_emission_color()
        if(use_emission_map)
                return texture(emission_map, texcoord.xy).rgb;
        else
-               return basic_material.emission.rgb;
+               return pbr_material.emission.rgb;
 }
 
 /* Computes the diffuse reflection of the macrosurface */
@@ -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)