Browse Source

Fix pbr webgl1

sebavan 6 years ago
parent
commit
ff7f45d134
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/Shaders/ShadersInclude/pbrFunctions.fx

+ 2 - 0
src/Shaders/ShadersInclude/pbrFunctions.fx

@@ -229,6 +229,7 @@ vec3 computeAnisotropicSpecularTerm(float NdotH, float NdotL, float NdotV, float
     return fresnel * specTerm;
     return fresnel * specTerm;
 }
 }
 
 
+#ifdef CLEARCOAT
 vec2 computeClearCoatTerm(float NdotH, float VdotH, float clearCoatRoughness, float geometricRoughnessFactor, float clearCoatIntensity) {
 vec2 computeClearCoatTerm(float NdotH, float VdotH, float clearCoatRoughness, float geometricRoughnessFactor, float clearCoatIntensity) {
     clearCoatRoughness = max(clearCoatRoughness, geometricRoughnessFactor);
     clearCoatRoughness = max(clearCoatRoughness, geometricRoughnessFactor);
     float alphaG = convertRoughnessToAverageSlope(clearCoatRoughness);
     float alphaG = convertRoughnessToAverageSlope(clearCoatRoughness);
@@ -249,6 +250,7 @@ vec3 computeClearCoatAbsorption(float NdotVRefract, float NdotLRefract, vec3 cle
         clearCoatIntensity);
         clearCoatIntensity);
     return clearCoatAbsorption;
     return clearCoatAbsorption;
 }
 }
+#endif
 
 
 float adjustRoughnessFromLightProperties(float roughness, float lightRadius, float lightDistance)
 float adjustRoughnessFromLightProperties(float roughness, float lightRadius, float lightDistance)
 {
 {