David Catuhe 7 lat temu
rodzic
commit
28a436bce9
27 zmienionych plików z 15913 dodań i 15535 usunięć
  1. 5369 5331
      dist/preview release/babylon.d.ts
  2. 39 39
      dist/preview release/babylon.js
  3. 142 23
      dist/preview release/babylon.max.js
  4. 5369 5331
      dist/preview release/babylon.module.d.ts
  5. 45 45
      dist/preview release/babylon.worker.js
  6. 2243 2209
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  7. 38 38
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  8. 109 5
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  9. 2243 2209
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts
  10. 1 1
      dist/preview release/gui/babylon.gui.js
  11. 3 3
      dist/preview release/gui/babylon.gui.min.js
  12. 264 264
      dist/preview release/inspector/babylon.inspector.bundle.js
  13. 1 0
      dist/preview release/inspector/babylon.inspector.d.ts
  14. 22 12
      dist/preview release/inspector/babylon.inspector.js
  15. 4 4
      dist/preview release/inspector/babylon.inspector.min.js
  16. 2 2
      dist/preview release/loaders/babylon.glTF1FileLoader.min.js
  17. 2 2
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  18. 3 3
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  19. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  20. 3 3
      dist/preview release/loaders/babylonjs.loaders.min.js
  21. 1 1
      dist/preview release/materialsLibrary/babylon.customMaterial.min.js
  22. 1 1
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js
  23. 1 1
      dist/preview release/materialsLibrary/babylon.waterMaterial.min.js
  24. 4 4
      dist/preview release/materialsLibrary/babylonjs.materials.min.js
  25. 1 1
      dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js
  26. 1 1
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js
  27. 1 1
      dist/preview release/postProcessesLibrary/babylonjs.postProcess.min.js

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


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


+ 142 - 23
dist/preview release/babylon.max.js

@@ -12987,6 +12987,7 @@ var BABYLON;
                 Y: 1,
                 Z: 1
             };
+            _this._facetDepthSort = false; // is the facet depth sort enabled
             // Normal matrix
             _this._nonUniformScaling = false;
             // Events
@@ -13194,6 +13195,35 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(AbstractMesh.prototype, "mustDepthSortFacets", {
+            /**
+             * Boolean : must the facet be depth sorted on next call to `updateFacetData()` ?
+             * Works only for updatable meshes.
+             */
+            get: function () {
+                return this._facetDepthSort;
+            },
+            set: function (sort) {
+                this._facetDepthSort = sort;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(AbstractMesh.prototype, "facetDepthSortFrom", {
+            /**
+             * The location (Vector3) where the facet depth sort must be computed from.
+             * By default, the active camera position.
+             * Used only when facet depth sort is enabled.
+             */
+            get: function () {
+                return this._facetDepthSortFrom;
+            },
+            set: function (location) {
+                this._facetDepthSortFrom = location;
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(AbstractMesh.prototype, "isFacetDataEnabled", {
             /**
              * Read-only boolean : is the feature facetData enabled ?
@@ -14712,8 +14742,9 @@ var BABYLON;
          * By default, all the mesh children are also disposed unless the parameter `doNotRecurse` is set to `true`.
          * Returns nothing.
          */
-        AbstractMesh.prototype.dispose = function (doNotRecurse) {
+        AbstractMesh.prototype.dispose = function (doNotRecurse, disposeMaterialAndTextures) {
             var _this = this;
+            if (disposeMaterialAndTextures === void 0) { disposeMaterialAndTextures = false; }
             var index;
             // Action manager
             if (this.actionManager) {
@@ -14786,6 +14817,12 @@ var BABYLON;
             engine.wipeCaches();
             // Remove from scene
             this.getScene().removeMesh(this);
+            this._cache = null;
+            if (disposeMaterialAndTextures) {
+                if (this.material) {
+                    this.material.dispose(false, true);
+                }
+            }
             if (!doNotRecurse) {
                 // Particles
                 for (index = 0; index < this.getScene().particleSystems.length; index++) {
@@ -14955,7 +14992,7 @@ var BABYLON;
             if (!this._facetPartitioning) {
                 this._facetPartitioning = new Array();
             }
-            this._facetNb = this.getIndices().length / 3;
+            this._facetNb = (this.getIndices().length / 3) | 0;
             this._partitioningSubdivisions = (this._partitioningSubdivisions) ? this._partitioningSubdivisions : 10; // default nb of partitioning subdivisions = 10
             this._partitioningBBoxRatio = (this._partitioningBBoxRatio) ? this._partitioningBBoxRatio : 1.01; // default ratio 1.01 = the partitioning is 1% bigger than the bounding box
             for (var f = 0; f < this._facetNb; f++) {
@@ -14977,11 +15014,30 @@ var BABYLON;
             }
             var positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind);
             var indices = this.getIndices();
+            var indicesForComputeNormals = indices;
             var normals = this.getVerticesData(BABYLON.VertexBuffer.NormalKind);
             var bInfo = this.getBoundingInfo();
             if (!bInfo) {
                 return this;
             }
+            if (this._facetDepthSort && !this._originalIndices) {
+                // init arrays, matrix and sort function on first call
+                this._originalIndices = new Uint32Array(indices);
+                this._facetDepthSortFunction = function (f1, f2) {
+                    return (f2.sqDistance - f1.sqDistance);
+                };
+                if (!this._facetDepthSortFrom) {
+                    var camera = this.getScene().activeCamera;
+                    this._facetDepthSortFrom = (camera) ? camera.position : BABYLON.Vector3.Zero();
+                }
+                this._depthSortedFacets = [];
+                for (var f = 0; f < this._facetNb; f++) {
+                    var depthSortedFacet = { ind: f * 3, sqDistance: 0.0 };
+                    this._depthSortedFacets.push(depthSortedFacet);
+                }
+                this._invertedMatrix = BABYLON.Matrix.Identity();
+                this._facetDepthSortOrigin = BABYLON.Vector3.Zero();
+            }
             this._bbSize.x = (bInfo.maximum.x - bInfo.minimum.x > BABYLON.Epsilon) ? bInfo.maximum.x - bInfo.minimum.x : BABYLON.Epsilon;
             this._bbSize.y = (bInfo.maximum.y - bInfo.minimum.y > BABYLON.Epsilon) ? bInfo.maximum.y - bInfo.minimum.y : BABYLON.Epsilon;
             this._bbSize.z = (bInfo.maximum.z - bInfo.minimum.z > BABYLON.Epsilon) ? bInfo.maximum.z - bInfo.minimum.z : BABYLON.Epsilon;
@@ -15002,7 +15058,26 @@ var BABYLON;
             this._facetParameters.bbSize = this._bbSize;
             this._facetParameters.subDiv = this._subDiv;
             this._facetParameters.ratio = this.partitioningBBoxRatio;
-            BABYLON.VertexData.ComputeNormals(positions, indices, normals, this._facetParameters);
+            this._facetParameters.depthSort = this._facetDepthSort;
+            if (this._facetDepthSort) {
+                this.computeWorldMatrix(true);
+                this._worldMatrix.invertToRef(this._invertedMatrix);
+                BABYLON.Vector3.TransformCoordinatesToRef(this._facetDepthSortFrom, this._invertedMatrix, this._facetDepthSortOrigin);
+                this._facetParameters.distanceTo = this._facetDepthSortOrigin;
+                indicesForComputeNormals = this._originalIndices;
+            }
+            this._facetParameters.depthSortedFacets = this._depthSortedFacets;
+            BABYLON.VertexData.ComputeNormals(positions, indicesForComputeNormals, normals, this._facetParameters);
+            if (this._facetDepthSort) {
+                this._depthSortedFacets.sort(this._facetDepthSortFunction);
+                for (var sorted = 0; sorted < this._facetNb; sorted++) {
+                    var sind = this._depthSortedFacets[sorted].ind;
+                    indices[sorted * 3] = this._originalIndices[sind];
+                    indices[sorted * 3 + 1] = this._originalIndices[sind + 1];
+                    indices[sorted * 3 + 2] = this._originalIndices[sind + 2];
+                }
+                this.updateIndices(indices);
+            }
             return this;
         };
         /**
@@ -15185,16 +15260,21 @@ var BABYLON;
             if (this._facetDataEnabled) {
                 this._facetDataEnabled = false;
                 this._facetPositions = new Array();
-                ;
                 this._facetNormals = new Array();
-                ;
                 this._facetPartitioning = new Array();
-                ;
                 this._facetParameters = null;
+                this._originalIndices = new Uint32Array(0);
             }
             return this;
         };
         /**
+         * Updates the AbstractMesh indices array. Actually, used by the Mesh object.
+         * Returns the mesh.
+         */
+        AbstractMesh.prototype.updateIndices = function (indices) {
+            return this;
+        };
+        /**
          * Creates new normals data for the mesh.
          * @param updatable.
          */
@@ -17285,7 +17365,7 @@ var BABYLON;
             if (!material) {
                 return;
             }
-            if (material.needAlphaBlending() || material.needAlphaBlendingForMesh(mesh)) {
+            if (material.needAlphaBlendingForMesh(mesh)) {
                 this._transparentSubMeshes.push(subMesh);
             }
             else if (material.needAlphaTesting()) {
@@ -19113,6 +19193,17 @@ var BABYLON;
                 animatable.stop(animationName);
             }
         };
+        /**
+         * Stops and removes all animations that have been applied to the scene
+         */
+        Scene.prototype.stopAllAnimations = function () {
+            if (this._activeAnimatables) {
+                for (var i = 0; i < this._activeAnimatables.length; i++) {
+                    this._activeAnimatables[i].stop();
+                }
+                this._activeAnimatables = [];
+            }
+        };
         Scene.prototype._animate = function () {
             if (!this.animationsEnabled || this._activeAnimatables.length === 0) {
                 return;
@@ -20480,6 +20571,7 @@ var BABYLON;
             this.skeletons = [];
             this.morphTargetManagers = [];
             this.importedMeshesFiles = new Array();
+            this.stopAllAnimations();
             this.resetCachedMaterial();
             if (this._depthRenderer) {
                 this._depthRenderer.dispose();
@@ -23952,8 +24044,9 @@ var BABYLON;
          * Disposes the mesh.
          * This also frees the memory allocated under the hood to all the buffers used by WebGL.
          */
-        Mesh.prototype.dispose = function (doNotRecurse) {
+        Mesh.prototype.dispose = function (doNotRecurse, disposeMaterialAndTextures) {
             var _this = this;
+            if (disposeMaterialAndTextures === void 0) { disposeMaterialAndTextures = false; }
             this.morphTargetManager = null;
             if (this._geometry) {
                 this._geometry.releaseForMesh(this, true);
@@ -23983,7 +24076,7 @@ var BABYLON;
                     highlightLayer.removeExcludedMesh(this);
                 }
             }
-            _super.prototype.dispose.call(this, doNotRecurse);
+            _super.prototype.dispose.call(this, doNotRecurse, disposeMaterialAndTextures);
         };
         /**
          * Modifies the mesh geometry according to a displacement map.
@@ -27402,7 +27495,7 @@ var BABYLON;
             return (this.alpha < 1.0);
         };
         Material.prototype.needAlphaBlendingForMesh = function (mesh) {
-            return (mesh.visibility < 1.0) || mesh.hasVertexAlpha;
+            return this.needAlphaBlending() || (mesh.visibility < 1.0) || mesh.hasVertexAlpha;
         };
         Material.prototype.needAlphaTesting = function () {
             return false;
@@ -30146,6 +30239,10 @@ var BABYLON;
          * ratio : optional partitioning ratio / bounding box, required for facetPartitioning computation
          * bbSize : optional bounding box size data, required for facetPartitioning computation
          * bInfo : optional bounding info, required for facetPartitioning computation
+         * useRightHandedSystem: optional boolean to for right handed system computation
+         * depthSort : optional boolean to enable the facet depth sort computation
+         * distanceTo : optional Vector3 to compute the facet depth from this location
+         * depthSortedFacets : optional array of depthSortedFacets to store the facet distances from the reference location
          */
         VertexData.ComputeNormals = function (positions, indices, normals, options) {
             // temporary scalar variables
@@ -30172,14 +30269,24 @@ var BABYLON;
             var computeFacetNormals = false;
             var computeFacetPositions = false;
             var computeFacetPartitioning = false;
+            var computeDepthSort = false;
             var faceNormalSign = 1;
             var ratio = 0;
+            var distanceTo = null;
             if (options) {
                 computeFacetNormals = (options.facetNormals) ? true : false;
                 computeFacetPositions = (options.facetPositions) ? true : false;
                 computeFacetPartitioning = (options.facetPartitioning) ? true : false;
                 faceNormalSign = (options.useRightHandedSystem === true) ? -1 : 1;
                 ratio = options.ratio || 0;
+                computeDepthSort = (options.depthSort) ? true : false;
+                distanceTo = (options.distanceTo);
+                if (computeDepthSort) {
+                    if (distanceTo === undefined) {
+                        distanceTo = BABYLON.Vector3.Zero();
+                    }
+                    var depthSortedFacets = options.depthSortedFacets;
+                }
             }
             // facetPartitioning reinit if needed
             var xSubRatio = 0;
@@ -30290,6 +30397,11 @@ var BABYLON;
                         options.facetPartitioning[block_idx_o].push(index);
                     }
                 }
+                if (computeDepthSort && options && options.facetPositions) {
+                    var dsf = depthSortedFacets[index];
+                    dsf.ind = index * 3;
+                    dsf.sqDistance = BABYLON.Vector3.DistanceSquared(options.facetPositions[index], distanceTo);
+                }
                 // compute the normals anyway
                 normals[v1x] += faceNormalx; // accumulate all the normals per face
                 normals[v1y] += faceNormaly;
@@ -35317,31 +35429,38 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(PBRBaseMaterial.prototype, "_disableAlphaBlending", {
+            /**
+             * Returns true if alpha blending should be disabled.
+             */
+            get: function () {
+                return (this._linkRefractionWithTransparency ||
+                    this._transparencyMode === BABYLON.PBRMaterial.PBRMATERIAL_OPAQUE ||
+                    this._transparencyMode === BABYLON.PBRMaterial.PBRMATERIAL_ALPHATEST);
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
-         * Specifies whether or not the meshes using this material should be rendered in alpha blend mode.
+         * Specifies whether or not this material should be rendered in alpha blend mode.
          */
         PBRBaseMaterial.prototype.needAlphaBlending = function () {
-            if (this._transparencyMode === BABYLON.PBRMaterial.PBRMATERIAL_OPAQUE ||
-                this._transparencyMode === BABYLON.PBRMaterial.PBRMATERIAL_ALPHATEST) {
+            if (this._disableAlphaBlending) {
                 return false;
             }
-            return _super.prototype.needAlphaBlending.call(this);
+            return (this.alpha < 1.0) || (this._opacityTexture != null) || this._shouldUseAlphaFromAlbedoTexture();
         };
         /**
-         * Specifies whether or not the meshes using this material should be rendered in alpha blend mode.
+         * Specifies whether or not this material should be rendered in alpha blend mode for the given mesh.
          */
         PBRBaseMaterial.prototype.needAlphaBlendingForMesh = function (mesh) {
-            if (this._linkRefractionWithTransparency) {
-                return false;
-            }
-            if (this._transparencyMode === BABYLON.PBRMaterial.PBRMATERIAL_OPAQUE ||
-                this._transparencyMode === BABYLON.PBRMaterial.PBRMATERIAL_ALPHATEST) {
+            if (this._disableAlphaBlending) {
                 return false;
             }
-            return _super.prototype.needAlphaBlendingForMesh.call(this, mesh) || (this._opacityTexture != null) || this._shouldUseAlphaFromAlbedoTexture();
+            return _super.prototype.needAlphaBlendingForMesh.call(this, mesh);
         };
         /**
-         * Specifies whether or not the meshes using this material should be rendered in alpha test mode.
+         * Specifies whether or not this material should be rendered in alpha test mode.
          */
         PBRBaseMaterial.prototype.needAlphaTesting = function () {
             if (this._forceAlphaTest) {
@@ -36094,7 +36213,7 @@ var BABYLON;
                 if (this._reflectionTexture) {
                     this._reflectionTexture.dispose();
                 }
-                if (this._environmentBRDFTexture) {
+                if (this._environmentBRDFTexture && this.getScene()._environmentBRDFTexture !== this._environmentBRDFTexture) {
                     this._environmentBRDFTexture.dispose();
                 }
                 if (this._emissiveTexture) {

Plik diff jest za duży
+ 5369 - 5331
dist/preview release/babylon.module.d.ts


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


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


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


+ 109 - 5
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -12987,6 +12987,7 @@ var BABYLON;
                 Y: 1,
                 Z: 1
             };
+            _this._facetDepthSort = false; // is the facet depth sort enabled
             // Normal matrix
             _this._nonUniformScaling = false;
             // Events
@@ -13194,6 +13195,35 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(AbstractMesh.prototype, "mustDepthSortFacets", {
+            /**
+             * Boolean : must the facet be depth sorted on next call to `updateFacetData()` ?
+             * Works only for updatable meshes.
+             */
+            get: function () {
+                return this._facetDepthSort;
+            },
+            set: function (sort) {
+                this._facetDepthSort = sort;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(AbstractMesh.prototype, "facetDepthSortFrom", {
+            /**
+             * The location (Vector3) where the facet depth sort must be computed from.
+             * By default, the active camera position.
+             * Used only when facet depth sort is enabled.
+             */
+            get: function () {
+                return this._facetDepthSortFrom;
+            },
+            set: function (location) {
+                this._facetDepthSortFrom = location;
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(AbstractMesh.prototype, "isFacetDataEnabled", {
             /**
              * Read-only boolean : is the feature facetData enabled ?
@@ -14962,7 +14992,7 @@ var BABYLON;
             if (!this._facetPartitioning) {
                 this._facetPartitioning = new Array();
             }
-            this._facetNb = this.getIndices().length / 3;
+            this._facetNb = (this.getIndices().length / 3) | 0;
             this._partitioningSubdivisions = (this._partitioningSubdivisions) ? this._partitioningSubdivisions : 10; // default nb of partitioning subdivisions = 10
             this._partitioningBBoxRatio = (this._partitioningBBoxRatio) ? this._partitioningBBoxRatio : 1.01; // default ratio 1.01 = the partitioning is 1% bigger than the bounding box
             for (var f = 0; f < this._facetNb; f++) {
@@ -14984,11 +15014,30 @@ var BABYLON;
             }
             var positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind);
             var indices = this.getIndices();
+            var indicesForComputeNormals = indices;
             var normals = this.getVerticesData(BABYLON.VertexBuffer.NormalKind);
             var bInfo = this.getBoundingInfo();
             if (!bInfo) {
                 return this;
             }
+            if (this._facetDepthSort && !this._originalIndices) {
+                // init arrays, matrix and sort function on first call
+                this._originalIndices = new Uint32Array(indices);
+                this._facetDepthSortFunction = function (f1, f2) {
+                    return (f2.sqDistance - f1.sqDistance);
+                };
+                if (!this._facetDepthSortFrom) {
+                    var camera = this.getScene().activeCamera;
+                    this._facetDepthSortFrom = (camera) ? camera.position : BABYLON.Vector3.Zero();
+                }
+                this._depthSortedFacets = [];
+                for (var f = 0; f < this._facetNb; f++) {
+                    var depthSortedFacet = { ind: f * 3, sqDistance: 0.0 };
+                    this._depthSortedFacets.push(depthSortedFacet);
+                }
+                this._invertedMatrix = BABYLON.Matrix.Identity();
+                this._facetDepthSortOrigin = BABYLON.Vector3.Zero();
+            }
             this._bbSize.x = (bInfo.maximum.x - bInfo.minimum.x > BABYLON.Epsilon) ? bInfo.maximum.x - bInfo.minimum.x : BABYLON.Epsilon;
             this._bbSize.y = (bInfo.maximum.y - bInfo.minimum.y > BABYLON.Epsilon) ? bInfo.maximum.y - bInfo.minimum.y : BABYLON.Epsilon;
             this._bbSize.z = (bInfo.maximum.z - bInfo.minimum.z > BABYLON.Epsilon) ? bInfo.maximum.z - bInfo.minimum.z : BABYLON.Epsilon;
@@ -15009,7 +15058,26 @@ var BABYLON;
             this._facetParameters.bbSize = this._bbSize;
             this._facetParameters.subDiv = this._subDiv;
             this._facetParameters.ratio = this.partitioningBBoxRatio;
-            BABYLON.VertexData.ComputeNormals(positions, indices, normals, this._facetParameters);
+            this._facetParameters.depthSort = this._facetDepthSort;
+            if (this._facetDepthSort) {
+                this.computeWorldMatrix(true);
+                this._worldMatrix.invertToRef(this._invertedMatrix);
+                BABYLON.Vector3.TransformCoordinatesToRef(this._facetDepthSortFrom, this._invertedMatrix, this._facetDepthSortOrigin);
+                this._facetParameters.distanceTo = this._facetDepthSortOrigin;
+                indicesForComputeNormals = this._originalIndices;
+            }
+            this._facetParameters.depthSortedFacets = this._depthSortedFacets;
+            BABYLON.VertexData.ComputeNormals(positions, indicesForComputeNormals, normals, this._facetParameters);
+            if (this._facetDepthSort) {
+                this._depthSortedFacets.sort(this._facetDepthSortFunction);
+                for (var sorted = 0; sorted < this._facetNb; sorted++) {
+                    var sind = this._depthSortedFacets[sorted].ind;
+                    indices[sorted * 3] = this._originalIndices[sind];
+                    indices[sorted * 3 + 1] = this._originalIndices[sind + 1];
+                    indices[sorted * 3 + 2] = this._originalIndices[sind + 2];
+                }
+                this.updateIndices(indices);
+            }
             return this;
         };
         /**
@@ -15192,16 +15260,21 @@ var BABYLON;
             if (this._facetDataEnabled) {
                 this._facetDataEnabled = false;
                 this._facetPositions = new Array();
-                ;
                 this._facetNormals = new Array();
-                ;
                 this._facetPartitioning = new Array();
-                ;
                 this._facetParameters = null;
+                this._originalIndices = new Uint32Array(0);
             }
             return this;
         };
         /**
+         * Updates the AbstractMesh indices array. Actually, used by the Mesh object.
+         * Returns the mesh.
+         */
+        AbstractMesh.prototype.updateIndices = function (indices) {
+            return this;
+        };
+        /**
          * Creates new normals data for the mesh.
          * @param updatable.
          */
@@ -19120,6 +19193,17 @@ var BABYLON;
                 animatable.stop(animationName);
             }
         };
+        /**
+         * Stops and removes all animations that have been applied to the scene
+         */
+        Scene.prototype.stopAllAnimations = function () {
+            if (this._activeAnimatables) {
+                for (var i = 0; i < this._activeAnimatables.length; i++) {
+                    this._activeAnimatables[i].stop();
+                }
+                this._activeAnimatables = [];
+            }
+        };
         Scene.prototype._animate = function () {
             if (!this.animationsEnabled || this._activeAnimatables.length === 0) {
                 return;
@@ -20487,6 +20571,7 @@ var BABYLON;
             this.skeletons = [];
             this.morphTargetManagers = [];
             this.importedMeshesFiles = new Array();
+            this.stopAllAnimations();
             this.resetCachedMaterial();
             if (this._depthRenderer) {
                 this._depthRenderer.dispose();
@@ -30154,6 +30239,10 @@ var BABYLON;
          * ratio : optional partitioning ratio / bounding box, required for facetPartitioning computation
          * bbSize : optional bounding box size data, required for facetPartitioning computation
          * bInfo : optional bounding info, required for facetPartitioning computation
+         * useRightHandedSystem: optional boolean to for right handed system computation
+         * depthSort : optional boolean to enable the facet depth sort computation
+         * distanceTo : optional Vector3 to compute the facet depth from this location
+         * depthSortedFacets : optional array of depthSortedFacets to store the facet distances from the reference location
          */
         VertexData.ComputeNormals = function (positions, indices, normals, options) {
             // temporary scalar variables
@@ -30180,14 +30269,24 @@ var BABYLON;
             var computeFacetNormals = false;
             var computeFacetPositions = false;
             var computeFacetPartitioning = false;
+            var computeDepthSort = false;
             var faceNormalSign = 1;
             var ratio = 0;
+            var distanceTo = null;
             if (options) {
                 computeFacetNormals = (options.facetNormals) ? true : false;
                 computeFacetPositions = (options.facetPositions) ? true : false;
                 computeFacetPartitioning = (options.facetPartitioning) ? true : false;
                 faceNormalSign = (options.useRightHandedSystem === true) ? -1 : 1;
                 ratio = options.ratio || 0;
+                computeDepthSort = (options.depthSort) ? true : false;
+                distanceTo = (options.distanceTo);
+                if (computeDepthSort) {
+                    if (distanceTo === undefined) {
+                        distanceTo = BABYLON.Vector3.Zero();
+                    }
+                    var depthSortedFacets = options.depthSortedFacets;
+                }
             }
             // facetPartitioning reinit if needed
             var xSubRatio = 0;
@@ -30298,6 +30397,11 @@ var BABYLON;
                         options.facetPartitioning[block_idx_o].push(index);
                     }
                 }
+                if (computeDepthSort && options && options.facetPositions) {
+                    var dsf = depthSortedFacets[index];
+                    dsf.ind = index * 3;
+                    dsf.sqDistance = BABYLON.Vector3.DistanceSquared(options.facetPositions[index], distanceTo);
+                }
                 // compute the normals anyway
                 normals[v1x] += faceNormalx; // accumulate all the normals per face
                 normals[v1y] += faceNormaly;

Plik diff jest za duży
+ 2243 - 2209
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


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

@@ -3438,7 +3438,7 @@ var BABYLON;
                                 if (this._autoScale) {
                                     this.synchronizeSizeWithContent();
                                 }
-                                if (this._root) {
+                                if (this._root && this._root.parent) {
                                     this._root.width = this.width;
                                     this._root.height = this.height;
                                 }

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


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


+ 1 - 0
dist/preview release/inspector/babylon.inspector.d.ts

@@ -986,6 +986,7 @@ declare module INSPECTOR {
         private _updateLoopHandler;
         private _sceneInstrumentation;
         private _engineInstrumentation;
+        private _connectToInstrumentation();
         constructor(tabbar: TabBar, insp: Inspector);
         private _createStatLabel(content, parent);
         /** Update each properties of the stats panel */

+ 22 - 12
dist/preview release/inspector/babylon.inspector.js

@@ -3671,18 +3671,7 @@ var INSPECTOR;
             _this._scene = _this._inspector.scene;
             _this._engine = _this._scene.getEngine();
             _this._glInfo = _this._engine.getGlInfo();
-            _this._sceneInstrumentation = new BABYLON.SceneInstrumentation(_this._scene);
-            _this._sceneInstrumentation.captureActiveMeshesEvaluationTime = true;
-            _this._sceneInstrumentation.captureRenderTargetsRenderTime = true;
-            _this._sceneInstrumentation.captureFrameTime = true;
-            _this._sceneInstrumentation.captureRenderTime = true;
-            _this._sceneInstrumentation.captureInterFrameTime = true;
-            _this._sceneInstrumentation.captureParticlesRenderTime = true;
-            _this._sceneInstrumentation.captureSpritesRenderTime = true;
-            _this._sceneInstrumentation.capturePhysicsTime = true;
-            _this._sceneInstrumentation.captureAnimationsTime = true;
-            _this._engineInstrumentation = new BABYLON.EngineInstrumentation(_this._engine);
-            _this._engineInstrumentation.captureGPUFrameTime = true;
+            _this._connectToInstrumentation();
             // Build the stats panel: a div that will contains all stats
             _this._panel = INSPECTOR.Helpers.CreateDiv('tab-panel');
             _this._panel.classList.add("stats-panel");
@@ -3947,6 +3936,23 @@ var INSPECTOR;
             }
             return _this;
         }
+        StatsTab.prototype._connectToInstrumentation = function () {
+            if (this._sceneInstrumentation) {
+                return;
+            }
+            this._sceneInstrumentation = new BABYLON.SceneInstrumentation(this._scene);
+            this._sceneInstrumentation.captureActiveMeshesEvaluationTime = true;
+            this._sceneInstrumentation.captureRenderTargetsRenderTime = true;
+            this._sceneInstrumentation.captureFrameTime = true;
+            this._sceneInstrumentation.captureRenderTime = true;
+            this._sceneInstrumentation.captureInterFrameTime = true;
+            this._sceneInstrumentation.captureParticlesRenderTime = true;
+            this._sceneInstrumentation.captureSpritesRenderTime = true;
+            this._sceneInstrumentation.capturePhysicsTime = true;
+            this._sceneInstrumentation.captureAnimationsTime = true;
+            this._engineInstrumentation = new BABYLON.EngineInstrumentation(this._engine);
+            this._engineInstrumentation.captureGPUFrameTime = true;
+        };
         StatsTab.prototype._createStatLabel = function (content, parent) {
             var elem = INSPECTOR.Helpers.CreateDiv('stat-label', parent);
             elem.textContent = content;
@@ -3962,10 +3968,14 @@ var INSPECTOR;
         StatsTab.prototype.dispose = function () {
             this._scene.unregisterAfterRender(this._updateLoopHandler);
             this._sceneInstrumentation.dispose();
+            this._sceneInstrumentation = null;
+            this._engineInstrumentation.dispose();
+            this._engineInstrumentation = null;
         };
         StatsTab.prototype.active = function (b) {
             _super.prototype.active.call(this, b);
             if (b) {
+                this._connectToInstrumentation();
                 this._scene.registerAfterRender(this._updateLoopHandler);
             }
         };

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


Plik diff jest za duży
+ 2 - 2
dist/preview release/loaders/babylon.glTF1FileLoader.min.js


Plik diff jest za duży
+ 2 - 2
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


Plik diff jest za duży
+ 3 - 3
dist/preview release/loaders/babylon.glTFFileLoader.min.js


Plik diff jest za duży
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


Plik diff jest za duży
+ 3 - 3
dist/preview release/loaders/babylonjs.loaders.min.js


Plik diff jest za duży
+ 1 - 1
dist/preview release/materialsLibrary/babylon.customMaterial.min.js


Plik diff jest za duży
+ 1 - 1
dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js


Plik diff jest za duży
+ 1 - 1
dist/preview release/materialsLibrary/babylon.waterMaterial.min.js


Plik diff jest za duży
+ 4 - 4
dist/preview release/materialsLibrary/babylonjs.materials.min.js


Plik diff jest za duży
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js


Plik diff jest za duży
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js


Plik diff jest za duży
+ 1 - 1
dist/preview release/postProcessesLibrary/babylonjs.postProcess.min.js