Browse Source

Possible fix for PBR Artifacts

dragonCASTjosh 8 years ago
parent
commit
45d619e80c
2 changed files with 3 additions and 2 deletions
  1. 1 1
      bin/CoreData/Shaders/HLSL/BRDF.hlsl
  2. 2 1
      bin/CoreData/Shaders/HLSL/IBL.hlsl

+ 1 - 1
bin/CoreData/Shaders/HLSL/BRDF.hlsl

@@ -26,7 +26,7 @@
     //VdotH     = the dot product of the camera view direction and the half vector 
     float3 Fresnel(float3 specular, float VdotH)
     {
-        return SchlickFresnel(specular, VdotH);
+        return SchlickGaussianFresnel(specular, VdotH);
     }
 
     // Smith GGX corrected Visibility

+ 2 - 1
bin/CoreData/Shaders/HLSL/IBL.hlsl

@@ -229,7 +229,7 @@
 
     float GetMipFromRoughness(float roughness)
     {
-        float Level = 3 - 1.15 * log2( roughness );
+        float Level = 3 - 1.15 * log2(roughness);
         return 9.0 - 1 - Level;
     }
 
@@ -264,6 +264,7 @@
     ///     ambientOcclusion: ambient occlusion
     float3 ImageBasedLighting(in float3 reflectVec, in float3 tangent, in float3 bitangent, in float3 wsNormal, in float3 toCamera, in float3 diffColor, in float3 specColor, in float roughness, inout float3 reflectionCubeColor)
     { 
+        roughness = max(roughness, 0.08);
         reflectVec = GetSpecularDominantDir(wsNormal, reflectVec, roughness);
         const float ndv = saturate(dot(-toCamera, wsNormal));