From: Mikko Rasa Date: Mon, 3 Oct 2022 20:44:46 +0000 (+0300) Subject: Refactor handling some material parameters in cooktorrance.glsl X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=c26b36bee465f16e3e3ed1b01ad613e7d2017102 Refactor handling some material parameters in cooktorrance.glsl Occlusion is now passed as a parameter to the lighting function. Emission is handled outside of it since it's not properly a part of the Cook-Torrance BRDF. --- diff --git a/shaderlib/cooktorrance.glsl b/shaderlib/cooktorrance.glsl index 25289ed5..5e933d5a 100644 --- a/shaderlib/cooktorrance.glsl +++ b/shaderlib/cooktorrance.glsl @@ -153,7 +153,7 @@ vec3 cooktorrance_environment(vec3 normal, vec3 look, vec3 base_color, float met return (k_diff*base_color+k_spec)*ambient_color.rgb; } -vec3 cooktorrance_lighting(vec3 normal, vec3 look, vec3 base_color, float metalness, float roughness) +vec3 cooktorrance_lighting(vec3 normal, vec3 look, vec3 base_color, float metalness, float roughness, float occlusion) { vec3 color = vec3(0.0); for(int i=0; i