From d4b675bbcdb50d9246f6f6885832cfc443058863 Mon Sep 17 00:00:00 2001 From: Joey de Vries Date: Sat, 21 Oct 2017 10:07:19 +0200 Subject: [PATCH] Set max specular IBL reflection mip level to 4.0 to match the number of generated mips. --- src/6.pbr/2.2.1.ibl_specular/2.2.1.pbr.fs | 2 +- src/6.pbr/2.2.2.ibl_specular_textured/2.2.2.pbr.fs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/6.pbr/2.2.1.ibl_specular/2.2.1.pbr.fs b/src/6.pbr/2.2.1.ibl_specular/2.2.1.pbr.fs index be6d129..945132f 100644 --- a/src/6.pbr/2.2.1.ibl_specular/2.2.1.pbr.fs +++ b/src/6.pbr/2.2.1.ibl_specular/2.2.1.pbr.fs @@ -128,7 +128,7 @@ void main() vec3 diffuse = irradiance * albedo; // sample both the pre-filter map and the BRDF lut and combine them together as per the Split-Sum approximation to get the IBL specular part. - const float MAX_REFLECTION_LOD = 5.0; + const float MAX_REFLECTION_LOD = 4.0; vec3 prefilteredColor = textureLod(prefilterMap, R, roughness * MAX_REFLECTION_LOD).rgb; vec2 brdf = texture(brdfLUT, vec2(max(dot(N, V), 0.0), roughness)).rg; vec3 specular = prefilteredColor * (F * brdf.x + brdf.y); diff --git a/src/6.pbr/2.2.2.ibl_specular_textured/2.2.2.pbr.fs b/src/6.pbr/2.2.2.ibl_specular_textured/2.2.2.pbr.fs index b460568..0d98d8d 100644 --- a/src/6.pbr/2.2.2.ibl_specular_textured/2.2.2.pbr.fs +++ b/src/6.pbr/2.2.2.ibl_specular_textured/2.2.2.pbr.fs @@ -157,7 +157,7 @@ void main() vec3 diffuse = irradiance * albedo; // sample both the pre-filter map and the BRDF lut and combine them together as per the Split-Sum approximation to get the IBL specular part. - const float MAX_REFLECTION_LOD = 5.0; + const float MAX_REFLECTION_LOD = 4.0; vec3 prefilteredColor = textureLod(prefilterMap, R, roughness * MAX_REFLECTION_LOD).rgb; vec2 brdf = texture(brdfLUT, vec2(max(dot(N, V), 0.0), roughness)).rg; vec3 specular = prefilteredColor * (F * brdf.x + brdf.y);