From d50dde4c9765b7de79217ee61930b597989083ea Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Sun, 14 Dec 2014 02:48:47 +0100 Subject: [PATCH] Revert "Try to fix ibl precision issue" This reverts commit 1cf592394bdf2e31996a8bc9aeb1da189455447b. --- data/shaders/importance_sampling_specular.frag | 2 +- data/shaders/utils/SpecularIBL.frag | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/shaders/importance_sampling_specular.frag b/data/shaders/importance_sampling_specular.frag index 006568100..c997fafb7 100644 --- a/data/shaders/importance_sampling_specular.frag +++ b/data/shaders/importance_sampling_specular.frag @@ -29,5 +29,5 @@ void main(void) weight += NdotL; } - FragColor = FinalColor / max(weight, 1.); + FragColor = FinalColor / weight; } diff --git a/data/shaders/utils/SpecularIBL.frag b/data/shaders/utils/SpecularIBL.frag index c0b9b0b9e..053348a7f 100644 --- a/data/shaders/utils/SpecularIBL.frag +++ b/data/shaders/utils/SpecularIBL.frag @@ -7,5 +7,5 @@ vec3 SpecularIBL(vec3 normal, vec3 V, float roughness) // Assume 8 level of lod (ie 256x256 texture) float lodval = 8. * (1. - roughness); - return textureLod(probe, sampleDirection, lodval).rgb; + return clamp( textureLod(probe, sampleDirection, lodval).rgb, 0., 1.); }