sebastien пре 7 година
родитељ
комит
c1bedab786

+ 2 - 2
src/Lights/babylon.spotLight.ts

@@ -50,7 +50,7 @@
         }
 
         /**
-         * Only used in Frostbite falloff mode, this defines the angle where 
+         * Only used in gltf falloff mode, this defines the angle where 
          * the directional falloff will start before cutting at angle which could be seen
          * as outer angle.
          */
@@ -59,7 +59,7 @@
             return this._angle
         }
         /**
-         * Only used in Frostbite falloff mode, this defines the angle where 
+         * Only used in gltf falloff mode, this defines the angle where 
          * the directional falloff will start before cutting at angle which could be seen
          * as outer angle.
          */

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

@@ -125,7 +125,7 @@
         public EXPOSURE = false;
 
         public USEPHYSICALLIGHTFALLOFF = false;
-        public USEFROSTBITELIGHTFALLOFF = false;
+        public USEGLTFLIGHTFALLOFF = false;
         public TWOSIDEDLIGHTING = false;
         public SHADOWFLOAT = false;
         public CLIPPLANE = false;
@@ -166,18 +166,18 @@
      */
     export abstract class PBRBaseMaterial extends PushMaterial {
         /**
-         * PBRMaterialLightFalloff Physical: light is falling off folliwing the inverse squared distance law.
+         * PBRMaterialLightFalloff Physical: light is falling off following the inverse squared distance law.
          */
         public static readonly LIGHTFALLOFF_PHYSICAL = 0;
 
         /**
-         * PBRMaterialLightFalloff Frostbite: light is falling off as described in the frostbite moving to PBR document 
+         * PBRMaterialLightFalloff gltf: light is falling off as described in the gltf moving to PBR document 
          * to enhance interoperability with other engines.
          */
-        public static readonly LIGHTFALLOFF_FROSTBITE = 1;
+        public static readonly LIGHTFALLOFF_GLTF = 1;
 
         /**
-         * PBRMaterialLightFalloff Frostbite: light is falling off like in the standard material 
+         * PBRMaterialLightFalloff Standard: light is falling off like in the standard material 
          * to enhance interoperability with other materials.
          */
         public static readonly LIGHTFALLOFF_STANDARD = 2;
@@ -1234,15 +1234,15 @@
 
                 if (this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_STANDARD) {
                     defines.USEPHYSICALLIGHTFALLOFF = false;
-                    defines.USEFROSTBITELIGHTFALLOFF = false;
+                    defines.USEGLTFLIGHTFALLOFF = false;
                 }
-                else if (this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_FROSTBITE) {
+                else if (this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_GLTF) {
                     defines.USEPHYSICALLIGHTFALLOFF = false;
-                    defines.USEFROSTBITELIGHTFALLOFF = true;
+                    defines.USEGLTFLIGHTFALLOFF = true;
                 }
                 else {
                     defines.USEPHYSICALLIGHTFALLOFF = false;
-                    defines.USEFROSTBITELIGHTFALLOFF = true;
+                    defines.USEGLTFLIGHTFALLOFF = true;
                 }
 
                 defines.RADIANCEOVERALPHA = this._useRadianceOverAlpha;

+ 7 - 7
src/Materials/PBR/babylon.pbrMaterial.ts

@@ -346,24 +346,24 @@
 
         /**
          * In order to support the falloff compatibility with gltf, a special mode has been added 
-         * to reproduce the frostbite light falloff.
+         * to reproduce the gltf light falloff.
          */
         @serialize()
-        public get useFrostbiteLightFalloff(): boolean {
-            return this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_FROSTBITE;
+        public get useGLTFLightFalloff(): boolean {
+            return this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_GLTF;
         }
 
         /**
          * In order to support the falloff compatibility with gltf, a special mode has been added 
-         * to reproduce the frostbite light falloff.
+         * to reproduce the gltf light falloff.
          */
-        public set useFrostbiteLightFalloff(value: boolean) {
-            if (value !== this.useFrostbiteLightFalloff) {
+        public set useGLTFLightFalloff(value: boolean) {
+            if (value !== this.useGLTFLightFalloff) {
                 // Ensure the effect will be rebuilt.
                 this._markAllSubMeshesAsTexturesDirty();
 
                 if (value) {
-                    this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_FROSTBITE;
+                    this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_GLTF;
                 }
                 else {
                     this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_STANDARD;

+ 2 - 2
src/Shaders/ShadersInclude/pbrLightFunctions.fx

@@ -11,7 +11,7 @@ float computeDistanceLightFalloff(vec3 lightOffset, float lightDistanceSquared,
 {   
     #ifdef USEPHYSICALLIGHTFALLOFF
         float lightDistanceFalloff = 1.0 / ((lightDistanceSquared + 0.001));
-    #elif USEFROSTBITELIGHTFALLOFF
+    #elif USEGLTFLIGHTFALLOFF
         // Prevents infinity issues at 0.
         const float minDistanceSquared = 0.01*0.01;
         float lightDistanceFalloff = 1.0 / (max(lightDistanceSquared, minDistanceSquared));
@@ -47,7 +47,7 @@ float computeDirectionalLightFalloff(vec3 lightDirection, vec3 directionToLightC
         // not directional light type)
         vec4 lightDirectionSpreadSG = vec4(-lightDirection * concentrationKappa, -concentrationKappa);
         falloff = exp2(dot(vec4(directionToLightCenterW, 1.0), lightDirectionSpreadSG));
-    #elif USEFROSTBITELIGHTFALLOFF
+    #elif USEGLTFLIGHTFALLOFF
         // On the CPU
         // float lightAngleScale = 1.0 f / max (0.001f, ( cosInner - cosOuter ));
         // float lightAngleOffset = -cosOuter * angleScale;