Sebastien Vandenberghe 7 lat temu
rodzic
commit
059340be82

Plik diff jest za duży
+ 7074 - 7071
Playground/babylon.d.txt


Plik diff jest za duży
+ 7333 - 7330
dist/preview release/babylon.d.ts


Plik diff jest za duży
+ 22 - 22
dist/preview release/babylon.js


+ 35 - 14
dist/preview release/babylon.max.js

@@ -36762,6 +36762,7 @@ var BABYLON;
                  * Occlusion Channel Strenght.
                  */
                 _this.occlusionStrength = 1.0;
+                _this.useLightmapAsShadowmap = false;
                 _this._transparencyMode = BABYLON.PBRMaterial.PBRMATERIAL_OPAQUE;
                 _this._useAlphaFromAlbedoTexture = true;
                 _this._useAmbientInGrayScale = true;
@@ -36805,8 +36806,20 @@ var BABYLON;
                 if (this.occlusionTexture) {
                     activeTextures.push(this.occlusionTexture);
                 }
+                if (this.lightmapTexture) {
+                    activeTextures.push(this.lightmapTexture);
+                }
                 return activeTextures;
             };
+            PBRBaseSimpleMaterial.prototype.hasTexture = function (texture) {
+                if (_super.prototype.hasTexture.call(this, texture)) {
+                    return true;
+                }
+                if (this.lightmapTexture === texture) {
+                    return true;
+                }
+                return false;
+            };
             PBRBaseSimpleMaterial.prototype.getClassName = function () {
                 return "PBRBaseSimpleMaterial";
             };
@@ -36857,6 +36870,14 @@ var BABYLON;
             __decorate([
                 BABYLON.serialize()
             ], PBRBaseSimpleMaterial.prototype, "doubleSided", null);
+            __decorate([
+                BABYLON.serializeAsTexture(),
+                BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", null)
+            ], PBRBaseSimpleMaterial.prototype, "lightmapTexture", void 0);
+            __decorate([
+                BABYLON.serialize(),
+                BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty")
+            ], PBRBaseSimpleMaterial.prototype, "useLightmapAsShadowmap", void 0);
             return PBRBaseSimpleMaterial;
         }(BABYLON.PBRBaseMaterial));
         Internals.PBRBaseSimpleMaterial = PBRBaseSimpleMaterial;
@@ -67406,11 +67427,11 @@ var BABYLON;
     /**
      * The strenght of the force in correspondence to the distance of the affected object
      */
-    var PhysicsRadialImpulseFallof;
-    (function (PhysicsRadialImpulseFallof) {
-        PhysicsRadialImpulseFallof[PhysicsRadialImpulseFallof["Constant"] = 0] = "Constant";
-        PhysicsRadialImpulseFallof[PhysicsRadialImpulseFallof["Linear"] = 1] = "Linear"; // impulse gets weaker if it's further from the origin
-    })(PhysicsRadialImpulseFallof = BABYLON.PhysicsRadialImpulseFallof || (BABYLON.PhysicsRadialImpulseFallof = {}));
+    var PhysicsRadialImpulseFalloff;
+    (function (PhysicsRadialImpulseFalloff) {
+        PhysicsRadialImpulseFalloff[PhysicsRadialImpulseFalloff["Constant"] = 0] = "Constant";
+        PhysicsRadialImpulseFalloff[PhysicsRadialImpulseFalloff["Linear"] = 1] = "Linear"; // impulse gets weaker if it's further from the origin
+    })(PhysicsRadialImpulseFalloff = BABYLON.PhysicsRadialImpulseFalloff || (BABYLON.PhysicsRadialImpulseFalloff = {}));
     /**
      * The strenght of the force in correspondence to the distance of the affected object
      */
@@ -67431,10 +67452,10 @@ var BABYLON;
          * @param {Vector3} origin the origin of the explosion
          * @param {number} radius the explosion radius
          * @param {number} strength the explosion strength
-         * @param {PhysicsRadialImpulseFallof} falloff possible options: Constant & Linear. Defaults to Constant
+         * @param {PhysicsRadialImpulseFalloff} falloff possible options: Constant & Linear. Defaults to Constant
          */
         PhysicsHelper.prototype.applyRadialExplosionImpulse = function (origin, radius, strength, falloff) {
-            if (falloff === void 0) { falloff = PhysicsRadialImpulseFallof.Constant; }
+            if (falloff === void 0) { falloff = PhysicsRadialImpulseFalloff.Constant; }
             if (!this._physicsEngine) {
                 BABYLON.Tools.Warn('Physics engine not enabled. Please enable the physics before you call this method.');
                 return null;
@@ -67458,10 +67479,10 @@ var BABYLON;
          * @param {Vector3} origin the origin of the explosion
          * @param {number} radius the explosion radius
          * @param {number} strength the explosion strength
-         * @param {PhysicsRadialImpulseFallof} falloff possible options: Constant & Linear. Defaults to Constant
+         * @param {PhysicsRadialImpulseFalloff} falloff possible options: Constant & Linear. Defaults to Constant
          */
         PhysicsHelper.prototype.applyRadialExplosionForce = function (origin, radius, strength, falloff) {
-            if (falloff === void 0) { falloff = PhysicsRadialImpulseFallof.Constant; }
+            if (falloff === void 0) { falloff = PhysicsRadialImpulseFalloff.Constant; }
             if (!this._physicsEngine) {
                 BABYLON.Tools.Warn('Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.');
                 return null;
@@ -67485,10 +67506,10 @@ var BABYLON;
          * @param {Vector3} origin the origin of the explosion
          * @param {number} radius the explosion radius
          * @param {number} strength the explosion strength
-         * @param {PhysicsRadialImpulseFallof} falloff possible options: Constant & Linear. Defaults to Constant
+         * @param {PhysicsRadialImpulseFalloff} falloff possible options: Constant & Linear. Defaults to Constant
          */
         PhysicsHelper.prototype.gravitationalField = function (origin, radius, strength, falloff) {
-            if (falloff === void 0) { falloff = PhysicsRadialImpulseFallof.Constant; }
+            if (falloff === void 0) { falloff = PhysicsRadialImpulseFalloff.Constant; }
             if (!this._physicsEngine) {
                 BABYLON.Tools.Warn('Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.');
                 return null;
@@ -67547,7 +67568,7 @@ var BABYLON;
          * @param {Vector3} origin the origin of the explosion
          * @param {number} radius the explosion radius
          * @param {number} strength the explosion strength
-         * @param {PhysicsRadialImpulseFallof} falloff possible options: Constant & Linear
+         * @param {PhysicsRadialImpulseFalloff} falloff possible options: Constant & Linear
          * @returns {Nullable<PhysicsForceAndContactPoint>}
          */
         PhysicsRadialExplosionEvent.prototype.getImpostorForceAndContactPoint = function (impostor, origin, radius, strength, falloff) {
@@ -67571,7 +67592,7 @@ var BABYLON;
             if (distanceFromOrigin > radius) {
                 return null;
             }
-            var multiplier = falloff === PhysicsRadialImpulseFallof.Constant
+            var multiplier = falloff === PhysicsRadialImpulseFalloff.Constant
                 ? strength
                 : strength * (1 - (distanceFromOrigin / radius));
             var force = direction.multiplyByFloats(multiplier, multiplier, multiplier);
@@ -67617,7 +67638,7 @@ var BABYLON;
     /***** Gravitational Field *****/
     var PhysicsGravitationalFieldEvent = /** @class */ (function () {
         function PhysicsGravitationalFieldEvent(physicsHelper, scene, origin, radius, strength, falloff) {
-            if (falloff === void 0) { falloff = PhysicsRadialImpulseFallof.Constant; }
+            if (falloff === void 0) { falloff = PhysicsRadialImpulseFalloff.Constant; }
             this._dataFetched = false; // check if the has been fetched the data. If not, do cleanup
             this._physicsHelper = physicsHelper;
             this._scene = scene;

Plik diff jest za duży
+ 22 - 22
dist/preview release/babylon.worker.js


Plik diff jest za duży
+ 6208 - 6205
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Plik diff jest za duży
+ 25 - 25
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 35 - 14
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -36762,6 +36762,7 @@ var BABYLON;
                  * Occlusion Channel Strenght.
                  */
                 _this.occlusionStrength = 1.0;
+                _this.useLightmapAsShadowmap = false;
                 _this._transparencyMode = BABYLON.PBRMaterial.PBRMATERIAL_OPAQUE;
                 _this._useAlphaFromAlbedoTexture = true;
                 _this._useAmbientInGrayScale = true;
@@ -36805,8 +36806,20 @@ var BABYLON;
                 if (this.occlusionTexture) {
                     activeTextures.push(this.occlusionTexture);
                 }
+                if (this.lightmapTexture) {
+                    activeTextures.push(this.lightmapTexture);
+                }
                 return activeTextures;
             };
+            PBRBaseSimpleMaterial.prototype.hasTexture = function (texture) {
+                if (_super.prototype.hasTexture.call(this, texture)) {
+                    return true;
+                }
+                if (this.lightmapTexture === texture) {
+                    return true;
+                }
+                return false;
+            };
             PBRBaseSimpleMaterial.prototype.getClassName = function () {
                 return "PBRBaseSimpleMaterial";
             };
@@ -36857,6 +36870,14 @@ var BABYLON;
             __decorate([
                 BABYLON.serialize()
             ], PBRBaseSimpleMaterial.prototype, "doubleSided", null);
+            __decorate([
+                BABYLON.serializeAsTexture(),
+                BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty", null)
+            ], PBRBaseSimpleMaterial.prototype, "lightmapTexture", void 0);
+            __decorate([
+                BABYLON.serialize(),
+                BABYLON.expandToProperty("_markAllSubMeshesAsTexturesDirty")
+            ], PBRBaseSimpleMaterial.prototype, "useLightmapAsShadowmap", void 0);
             return PBRBaseSimpleMaterial;
         }(BABYLON.PBRBaseMaterial));
         Internals.PBRBaseSimpleMaterial = PBRBaseSimpleMaterial;
@@ -67252,11 +67273,11 @@ var BABYLON;
     /**
      * The strenght of the force in correspondence to the distance of the affected object
      */
-    var PhysicsRadialImpulseFallof;
-    (function (PhysicsRadialImpulseFallof) {
-        PhysicsRadialImpulseFallof[PhysicsRadialImpulseFallof["Constant"] = 0] = "Constant";
-        PhysicsRadialImpulseFallof[PhysicsRadialImpulseFallof["Linear"] = 1] = "Linear"; // impulse gets weaker if it's further from the origin
-    })(PhysicsRadialImpulseFallof = BABYLON.PhysicsRadialImpulseFallof || (BABYLON.PhysicsRadialImpulseFallof = {}));
+    var PhysicsRadialImpulseFalloff;
+    (function (PhysicsRadialImpulseFalloff) {
+        PhysicsRadialImpulseFalloff[PhysicsRadialImpulseFalloff["Constant"] = 0] = "Constant";
+        PhysicsRadialImpulseFalloff[PhysicsRadialImpulseFalloff["Linear"] = 1] = "Linear"; // impulse gets weaker if it's further from the origin
+    })(PhysicsRadialImpulseFalloff = BABYLON.PhysicsRadialImpulseFalloff || (BABYLON.PhysicsRadialImpulseFalloff = {}));
     /**
      * The strenght of the force in correspondence to the distance of the affected object
      */
@@ -67277,10 +67298,10 @@ var BABYLON;
          * @param {Vector3} origin the origin of the explosion
          * @param {number} radius the explosion radius
          * @param {number} strength the explosion strength
-         * @param {PhysicsRadialImpulseFallof} falloff possible options: Constant & Linear. Defaults to Constant
+         * @param {PhysicsRadialImpulseFalloff} falloff possible options: Constant & Linear. Defaults to Constant
          */
         PhysicsHelper.prototype.applyRadialExplosionImpulse = function (origin, radius, strength, falloff) {
-            if (falloff === void 0) { falloff = PhysicsRadialImpulseFallof.Constant; }
+            if (falloff === void 0) { falloff = PhysicsRadialImpulseFalloff.Constant; }
             if (!this._physicsEngine) {
                 BABYLON.Tools.Warn('Physics engine not enabled. Please enable the physics before you call this method.');
                 return null;
@@ -67304,10 +67325,10 @@ var BABYLON;
          * @param {Vector3} origin the origin of the explosion
          * @param {number} radius the explosion radius
          * @param {number} strength the explosion strength
-         * @param {PhysicsRadialImpulseFallof} falloff possible options: Constant & Linear. Defaults to Constant
+         * @param {PhysicsRadialImpulseFalloff} falloff possible options: Constant & Linear. Defaults to Constant
          */
         PhysicsHelper.prototype.applyRadialExplosionForce = function (origin, radius, strength, falloff) {
-            if (falloff === void 0) { falloff = PhysicsRadialImpulseFallof.Constant; }
+            if (falloff === void 0) { falloff = PhysicsRadialImpulseFalloff.Constant; }
             if (!this._physicsEngine) {
                 BABYLON.Tools.Warn('Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.');
                 return null;
@@ -67331,10 +67352,10 @@ var BABYLON;
          * @param {Vector3} origin the origin of the explosion
          * @param {number} radius the explosion radius
          * @param {number} strength the explosion strength
-         * @param {PhysicsRadialImpulseFallof} falloff possible options: Constant & Linear. Defaults to Constant
+         * @param {PhysicsRadialImpulseFalloff} falloff possible options: Constant & Linear. Defaults to Constant
          */
         PhysicsHelper.prototype.gravitationalField = function (origin, radius, strength, falloff) {
-            if (falloff === void 0) { falloff = PhysicsRadialImpulseFallof.Constant; }
+            if (falloff === void 0) { falloff = PhysicsRadialImpulseFalloff.Constant; }
             if (!this._physicsEngine) {
                 BABYLON.Tools.Warn('Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.');
                 return null;
@@ -67393,7 +67414,7 @@ var BABYLON;
          * @param {Vector3} origin the origin of the explosion
          * @param {number} radius the explosion radius
          * @param {number} strength the explosion strength
-         * @param {PhysicsRadialImpulseFallof} falloff possible options: Constant & Linear
+         * @param {PhysicsRadialImpulseFalloff} falloff possible options: Constant & Linear
          * @returns {Nullable<PhysicsForceAndContactPoint>}
          */
         PhysicsRadialExplosionEvent.prototype.getImpostorForceAndContactPoint = function (impostor, origin, radius, strength, falloff) {
@@ -67417,7 +67438,7 @@ var BABYLON;
             if (distanceFromOrigin > radius) {
                 return null;
             }
-            var multiplier = falloff === PhysicsRadialImpulseFallof.Constant
+            var multiplier = falloff === PhysicsRadialImpulseFalloff.Constant
                 ? strength
                 : strength * (1 - (distanceFromOrigin / radius));
             var force = direction.multiplyByFloats(multiplier, multiplier, multiplier);
@@ -67463,7 +67484,7 @@ var BABYLON;
     /***** Gravitational Field *****/
     var PhysicsGravitationalFieldEvent = /** @class */ (function () {
         function PhysicsGravitationalFieldEvent(physicsHelper, scene, origin, radius, strength, falloff) {
-            if (falloff === void 0) { falloff = PhysicsRadialImpulseFallof.Constant; }
+            if (falloff === void 0) { falloff = PhysicsRadialImpulseFalloff.Constant; }
             this._dataFetched = false; // check if the has been fetched the data. If not, do cleanup
             this._physicsHelper = physicsHelper;
             this._scene = scene;

+ 1 - 1
dist/preview release/gui/babylon.gui.js

@@ -2987,7 +2987,7 @@ var BABYLON;
     })(GUI = BABYLON.GUI || (BABYLON.GUI = {}));
 })(BABYLON || (BABYLON = {}));
 
-//# sourceMappingURL=checkBox.js.map
+//# sourceMappingURL=checkbox.js.map
 
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 

Plik diff jest za duży
+ 6 - 6
dist/preview release/inspector/babylon.inspector.bundle.js


+ 7 - 1
dist/preview release/inspector/babylon.inspector.js

@@ -1699,7 +1699,13 @@ var INSPECTOR;
                     var objToDetail = this.value;
                     // Display all properties that are not functions
                     var propToDisplay = INSPECTOR.Helpers.GetAllLinesPropertiesAsString(objToDetail);
-                    propToDisplay.sort().reverse();
+                    // special case for color3
+                    if ((propToDisplay.indexOf('r') && propToDisplay.indexOf('g') && propToDisplay.indexOf('b')) == 0) {
+                        propToDisplay.sort();
+                    }
+                    else {
+                        propToDisplay.sort().reverse();
+                    }
                     for (var _b = 0, propToDisplay_1 = propToDisplay; _b < propToDisplay_1.length; _b++) {
                         var prop = propToDisplay_1[_b];
                         var infos = new INSPECTOR.Property(prop, this._property.value);

Plik diff jest za duży
+ 4 - 4
dist/preview release/inspector/babylon.inspector.min.js


+ 24 - 0
src/Materials/PBR/babylon.pbrBaseSimpleMaterial.ts

@@ -103,6 +103,14 @@
             this._markAllSubMeshesAsTexturesDirty();
         }
 
+        @serializeAsTexture()
+        @expandToProperty("_markAllSubMeshesAsTexturesDirty", null)
+        public lightmapTexture: BaseTexture;
+
+        @serialize()
+        @expandToProperty("_markAllSubMeshesAsTexturesDirty")
+        public useLightmapAsShadowmap = false;
+
         /**
          * Return the active textures of the material.
          */
@@ -125,9 +133,25 @@
                 activeTextures.push(this.occlusionTexture);
             }
 
+            if (this.lightmapTexture) {
+                activeTextures.push(this.lightmapTexture);
+            }
+
             return activeTextures;
         }
 
+        public hasTexture(texture: BaseTexture): boolean {
+            if (super.hasTexture(texture)) {
+                return true;
+            }
+
+            if (this.lightmapTexture === texture) {
+                return true;
+            }
+
+            return false;
+        }
+
         /**
          * Instantiates a new PBRMaterial instance.
          *