From 42ddb3bad6908e4a1ea90b51c93770c6576eb85f Mon Sep 17 00:00:00 2001 From: Moritz Willy Becher Date: Wed, 13 Jan 2021 14:30:27 +0100 Subject: [PATCH] apply ambient occlusion to all ibl light --- src/Renderer/shaders/pbr.frag | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Renderer/shaders/pbr.frag b/src/Renderer/shaders/pbr.frag index b4991948..3c5986fc 100644 --- a/src/Renderer/shaders/pbr.frag +++ b/src/Renderer/shaders/pbr.frag @@ -358,6 +358,10 @@ void main() #ifdef HAS_OCCLUSION_MAP ao = texture(u_OcclusionSampler, getOcclusionUV()).r; f_diffuse = mix(f_diffuse, f_diffuse * ao, u_OcclusionStrength); + // apply ambient occlusion too all lighting that is not punctual + f_specular = mix(f_specular, f_specular * ao, u_OcclusionStrength); + f_sheen = mix(f_sheen, f_sheen * ao, u_OcclusionStrength); + f_clearcoat = mix(f_clearcoat, f_clearcoat * ao, u_OcclusionStrength); #endif #ifdef USE_PUNCTUAL