From 7d07a63ebfd89c060207f56516c7fdd5d07687c2 Mon Sep 17 00:00:00 2001 From: Nehon Date: Thu, 5 Nov 2015 23:01:25 +0100 Subject: [PATCH] Changes the way the fresnel term is computed in the PBR.glsllib for direct lighting, fixing some artifact when having a point light --- jme3-core/src/main/resources/Common/ShaderLib/PBR.glsllib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jme3-core/src/main/resources/Common/ShaderLib/PBR.glsllib b/jme3-core/src/main/resources/Common/ShaderLib/PBR.glsllib index 682d53213..c9cdeed76 100644 --- a/jme3-core/src/main/resources/Common/ShaderLib/PBR.glsllib +++ b/jme3-core/src/main/resources/Common/ShaderLib/PBR.glsllib @@ -80,7 +80,7 @@ void PBR_ComputeDirectLight(vec3 normal, vec3 lightDir, vec3 viewDir, float D = alpha2 / denom; // Compute Fresnel function via Schlick's approximation. - float fresnel = fZero + ( 1.0 - fZero ) * pow( 1.0 - hdotv, 5.0 ); + float fresnel = fZero + ( 1.0 - fZero ) * pow( 2.0, (-5.55473 * hdotv - 6.98316) * hdotv); //G Shchlick GGX Gometry shadowing term, k = alpha/2 float k = alpha * 0.5;