浏览代码

Changes the way the fresnel term is computed in the PBR.glsllib for direct lighting, fixing some artifact when having a point light

Nehon 10 年之前
父节点
当前提交
7d07a63ebf
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      jme3-core/src/main/resources/Common/ShaderLib/PBR.glsllib

+ 1 - 1
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;