X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=shaderlib%2Fcooktorrance.glsl;fp=shaderlib%2Fcooktorrance.glsl;h=25289ed57bc916af3eb41a4f9893d99289399618;hp=8a69d473e83935adf8d8d866b2beab07518e22ea;hb=afffed5bf161b5972a02f055225701118ed5a4e7;hpb=0b9f7e786f7bf4c751c62f345a932916b113e40c diff --git a/shaderlib/cooktorrance.glsl b/shaderlib/cooktorrance.glsl index 8a69d473..25289ed5 100644 --- a/shaderlib/cooktorrance.glsl +++ b/shaderlib/cooktorrance.glsl @@ -164,9 +164,8 @@ vec3 cooktorrance_lighting(vec3 normal, vec3 look, vec3 base_color, float metaln color += cooktorrance_one_light_direct(normal, look, incoming.direction, base_color, metalness, roughness)*incoming.color*shadow; } - color += cooktorrance_environment(normal, look, base_color, metalness, roughness); - - color *= get_occlusion_value(); + float occlusion = get_occlusion_value(); + color += cooktorrance_environment(normal, look, base_color, metalness, roughness)*occlusion; if(use_emission) color += get_emission_color();