瀏覽代碼

Fix PBR refraction without reflection

sebavan 6 年之前
父節點
當前提交
4e419294cc
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/Shaders/pbr.fragment.fx

+ 4 - 2
src/Shaders/pbr.fragment.fx

@@ -980,8 +980,10 @@ void main(void) {
         // Decrease Albedo Contribution
         // Decrease Albedo Contribution
         surfaceAlbedo *= (1. - refractionIntensity);
         surfaceAlbedo *= (1. - refractionIntensity);
 
 
-        // Decrease irradiance Contribution
-        environmentIrradiance *= (1. - refractionIntensity);
+        #ifdef REFLECTION
+            // Decrease irradiance Contribution
+            environmentIrradiance *= (1. - refractionIntensity);
+        #endif
 
 
         // Add Multiple internal bounces.
         // Add Multiple internal bounces.
         vec3 bounceSpecularEnvironmentReflectance = (2.0 * specularEnvironmentReflectance) / (1.0 + specularEnvironmentReflectance);
         vec3 bounceSpecularEnvironmentReflectance = (2.0 * specularEnvironmentReflectance) / (1.0 + specularEnvironmentReflectance);