Sebastien Vandenberghe 7 năm trước cách đây
mục cha
commit
28478bd9a6

+ 2 - 2
src/Materials/PBR/babylon.pbrBaseMaterial.ts

@@ -132,7 +132,7 @@
 
         public FORCENORMALFORWARD = false;
 
-        public GEOMETRYAA = false;
+        public SPECULARAA = false;
 
         public UNLIT = false;
 
@@ -1211,7 +1211,7 @@
                 defines.ALPHAFRESNEL = this._useAlphaFresnel || this._useLinearAlphaFresnel;
                 defines.LINEARALPHAFRESNEL = this._useLinearAlphaFresnel;
 
-                defines.GEOMETRYAA = scene.getEngine().getCaps().standardDerivatives && this._enableSpecularAntiAliasing;
+                defines.SPECULARAA = scene.getEngine().getCaps().standardDerivatives && this._enableSpecularAntiAliasing;
             }
 
             if (defines._areImageProcessingDirty) {

+ 5 - 5
src/Shaders/pbr.fragment.fx

@@ -1,4 +1,4 @@
-#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(GEOMETRYAA)
+#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA)
 #extension GL_OES_standard_derivatives : enable
 #endif
 
@@ -226,7 +226,9 @@ void main(void) {
     vec3 normalW = normalize(cross(dFdx(vPositionW), dFdy(vPositionW))) * vEyePosition.w;
 #endif
 
-#ifdef GEOMETRYAA
+#include<bumpFragment>
+
+#ifdef SPECULARAA
     vec3 nDfdx = dFdx(normalW.xyz);
     vec3 nDfdy = dFdy(normalW.xyz);
     float slopeSquare = max(dot(nDfdx, nDfdx), dot(nDfdy, nDfdy));
@@ -238,8 +240,6 @@ void main(void) {
     float geometricRoughnessFactor = 0.;
 #endif
 
-#include<bumpFragment>
-
 #if defined(FORCENORMALFORWARD) && defined(NORMAL)
     vec3 faceNormal = normalize(cross(dFdx(vPositionW), dFdy(vPositionW))) * vEyePosition.w;
     #if defined(TWOSIDEDLIGHTING)
@@ -434,7 +434,7 @@ void main(void) {
         float NdotV = clamp(NdotVUnclamped,0., 1.) + 0.00001;
         float alphaG = convertRoughnessToAverageSlope(roughness);
 
-        #ifdef GEOMETRYAA
+        #ifdef SPECULARAA
             // Adapt linear roughness (alphaG) to geometric curvature of the current pixel.
             // 75% accounts a bit for the bigger tail linked to Gaussian Filtering.
             alphaG += (0.75 * geometricAlphaGFactor);