From c26b36bee465f16e3e3ed1b01ad613e7d2017102 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 3 Oct 2022 23:44:46 +0300 Subject: [PATCH] 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. --- shaderlib/cooktorrance.glsl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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