Browse Source

Fix Build

sebastien 6 years ago
parent
commit
826503163e

File diff suppressed because it is too large
+ 1923 - 1961
Playground/babylon.d.txt


+ 25 - 0
Tools/Gulp/config.json

@@ -1740,6 +1740,31 @@
             {
                 "output": "babylonjs.loaders.min.js",
                 "entry": "./legacy/legacy.ts"
+            },
+            {
+                "output": "babylon.objFileLoader.min.js",
+                "entry": "./legacy/legacy-objFileLoader.ts",
+                "preventLoadLibrary": true
+            },
+            {
+                "output": "babylon.stlFileLoader.min.js",
+                "entry": "./legacy/legacy-stlFileLoader.ts",
+                "preventLoadLibrary": true
+            },
+            {
+                "output": "babylon.glTF1FileLoader.min.js",
+                "entry": "./legacy/legacy-glTF1FileLoader.ts",
+                "preventLoadLibrary": true
+            },
+            {
+                "output": "babylon.glTF2FileLoader.min.js",
+                "entry": "./legacy/legacy-glTF2FileLoader.ts",
+                "preventLoadLibrary": true
+            },
+            {
+                "output": "babylon.glTFFileLoader.min.js",
+                "entry": "./legacy/legacy-glTFFileLoader.ts",
+                "preventLoadLibrary": true
             }
         ],
         "build": {

File diff suppressed because it is too large
+ 1932 - 1970
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/babylon.js


+ 54 - 174
dist/preview release/babylon.max.js

@@ -5477,7 +5477,7 @@ var BABYLON;
         };
         /**
          * Returns a new Vector3 set from the index "offset" of the given Float32Array
-         * This function is deprecated.  Use FromArray instead
+         * This function is deprecated. Use FromArray instead
          * @param array defines the source array
          * @param offset defines the offset in the source array
          * @returns the new Vector3
@@ -13236,24 +13236,6 @@ var BABYLON;
         Engine.prototype.getCaps = function () {
             return this._caps;
         };
-        Object.defineProperty(Engine.prototype, "drawCalls", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("drawCalls is deprecated. Please use SceneInstrumentation class");
-                return 0;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine.prototype, "drawCallsPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("drawCallsPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
         /**
          * Gets the current depth function
          * @returns a number defining the depth function
@@ -26553,48 +26535,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        /** @hidden */
-        Scene.prototype.getInterFramePerfCounter = function () {
-            BABYLON.Tools.Warn("getInterFramePerfCounter is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "interFramePerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("interFramePerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /** @hidden */
-        Scene.prototype.getLastFrameDuration = function () {
-            BABYLON.Tools.Warn("getLastFrameDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "lastFramePerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("lastFramePerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /** @hidden */
-        Scene.prototype.getEvaluateActiveMeshesDuration = function () {
-            BABYLON.Tools.Warn("getEvaluateActiveMeshesDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "evaluateActiveMeshesDurationPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("evaluateActiveMeshesDurationPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
         /**
          * Gets the array of active meshes
          * @returns an array of AbstractMesh
@@ -26602,53 +26542,6 @@ var BABYLON;
         Scene.prototype.getActiveMeshes = function () {
             return this._activeMeshes;
         };
-        /** @hidden */
-        Scene.prototype.getRenderTargetsDuration = function () {
-            BABYLON.Tools.Warn("getRenderTargetsDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        /** @hidden */
-        Scene.prototype.getRenderDuration = function () {
-            BABYLON.Tools.Warn("getRenderDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "renderDurationPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("renderDurationPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /** @hidden */
-        Scene.prototype.getParticlesDuration = function () {
-            BABYLON.Tools.Warn("getParticlesDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "particlesDurationPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("particlesDurationPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /** @hidden */
-        Scene.prototype.getSpritesDuration = function () {
-            BABYLON.Tools.Warn("getSpritesDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "spriteDuractionPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("spriteDuractionPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
         /**
          * Gets the animation ratio (which is 1.0 is the scene renders at 60fps and 2 if the scene renders at 30fps, etc.)
          * @returns a number
@@ -37295,20 +37188,27 @@ var BABYLON;
          * @param flag defines a flag used to determine which parts of the material have to be marked as dirty
          */
         Material.prototype.markAsDirty = function (flag) {
+            if (this.getScene().blockMaterialDirtyMechanism) {
+                return;
+            }
+            Material._DirtyCallbackArray.length = 0;
             if (flag & Material.TextureDirtyFlag) {
-                this._markAllSubMeshesAsTexturesDirty();
+                Material._DirtyCallbackArray.push(Material._TextureDirtyCallBack);
             }
             if (flag & Material.LightDirtyFlag) {
-                this._markAllSubMeshesAsLightsDirty();
+                Material._DirtyCallbackArray.push(Material._LightsDirtyCallBack);
             }
             if (flag & Material.FresnelDirtyFlag) {
-                this._markAllSubMeshesAsFresnelDirty();
+                Material._DirtyCallbackArray.push(Material._FresnelDirtyCallBack);
             }
             if (flag & Material.AttributesDirtyFlag) {
-                this._markAllSubMeshesAsAttributesDirty();
+                Material._DirtyCallbackArray.push(Material._AttributeDirtyCallBack);
             }
             if (flag & Material.MiscDirtyFlag) {
-                this._markAllSubMeshesAsMiscDirty();
+                Material._DirtyCallbackArray.push(Material._MiscDirtyCallBack);
+            }
+            if (Material._DirtyCallbackArray.length) {
+                this._markAllSubMeshesAsDirty(Material._RunDirtyCallBacks);
             }
             this.getScene().resetCachedMaterial();
         };
@@ -37317,13 +37217,17 @@ var BABYLON;
          * @param func defines a function which checks material defines against the submeshes
          */
         Material.prototype._markAllSubMeshesAsDirty = function (func) {
-            for (var _i = 0, _a = this.getScene().meshes; _i < _a.length; _i++) {
-                var mesh = _a[_i];
+            if (this.getScene().blockMaterialDirtyMechanism) {
+                return;
+            }
+            var meshes = this.getScene().meshes;
+            for (var _i = 0, meshes_1 = meshes; _i < meshes_1.length; _i++) {
+                var mesh = meshes_1[_i];
                 if (!mesh.subMeshes) {
                     continue;
                 }
-                for (var _b = 0, _c = mesh.subMeshes; _b < _c.length; _b++) {
-                    var subMesh = _c[_b];
+                for (var _a = 0, _b = mesh.subMeshes; _a < _b.length; _a++) {
+                    var subMesh = _b[_a];
                     if (subMesh.getMaterial() !== this) {
                         continue;
                     }
@@ -37338,55 +37242,49 @@ var BABYLON;
          * Indicates that image processing needs to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsImageProcessingDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsImageProcessingDirty(); });
+            this._markAllSubMeshesAsDirty(Material._ImageProcessingDirtyCallBack);
         };
         /**
          * Indicates that textures need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsTexturesDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsTexturesDirty(); });
+            this._markAllSubMeshesAsDirty(Material._TextureDirtyCallBack);
         };
         /**
          * Indicates that fresnel needs to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsFresnelDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsFresnelDirty(); });
+            this._markAllSubMeshesAsDirty(Material._FresnelDirtyCallBack);
         };
         /**
          * Indicates that fresnel and misc need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsFresnelAndMiscDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) {
-                defines.markAsFresnelDirty();
-                defines.markAsMiscDirty();
-            });
+            this._markAllSubMeshesAsDirty(Material._FresnelAndMiscDirtyCallBack);
         };
         /**
          * Indicates that lights need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsLightsDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsLightDirty(); });
+            this._markAllSubMeshesAsDirty(Material._LightsDirtyCallBack);
         };
         /**
          * Indicates that attributes need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsAttributesDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsAttributesDirty(); });
+            this._markAllSubMeshesAsDirty(Material._AttributeDirtyCallBack);
         };
         /**
          * Indicates that misc needs to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsMiscDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsMiscDirty(); });
+            this._markAllSubMeshesAsDirty(Material._MiscDirtyCallBack);
         };
         /**
          * Indicates that textures and misc need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsTexturesAndMiscDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) {
-                defines.markAsTexturesDirty();
-                defines.markAsMiscDirty();
-            });
+            this._markAllSubMeshesAsDirty(Material._TextureAndMiscDirtyCallBack);
         };
         /**
          * Disposes the material
@@ -37414,8 +37312,8 @@ var BABYLON;
                 }
                 else {
                     var meshes = scene.meshes;
-                    for (var _i = 0, meshes_1 = meshes; _i < meshes_1.length; _i++) {
-                        var mesh = meshes_1[_i];
+                    for (var _i = 0, meshes_2 = meshes; _i < meshes_2.length; _i++) {
+                        var mesh = meshes_2[_i];
                         if (mesh.material === this) {
                             mesh.material = null;
                             this.releaseVertexArrayObject(mesh, forceDisposeEffect);
@@ -37554,6 +37452,27 @@ var BABYLON;
          * The all dirty flag value
          */
         Material.AllDirtyFlag = 31;
+        Material._ImageProcessingDirtyCallBack = function (defines) { return defines.markAsImageProcessingDirty(); };
+        Material._TextureDirtyCallBack = function (defines) { return defines.markAsTexturesDirty(); };
+        Material._FresnelDirtyCallBack = function (defines) { return defines.markAsFresnelDirty(); };
+        Material._MiscDirtyCallBack = function (defines) { return defines.markAsMiscDirty(); };
+        Material._LightsDirtyCallBack = function (defines) { return defines.markAsLightDirty(); };
+        Material._AttributeDirtyCallBack = function (defines) { return defines.markAsAttributesDirty(); };
+        Material._FresnelAndMiscDirtyCallBack = function (defines) {
+            Material._FresnelDirtyCallBack(defines);
+            Material._MiscDirtyCallBack(defines);
+        };
+        Material._TextureAndMiscDirtyCallBack = function (defines) {
+            Material._TextureDirtyCallBack(defines);
+            Material._MiscDirtyCallBack(defines);
+        };
+        Material._DirtyCallbackArray = [];
+        Material._RunDirtyCallBacks = function (defines) {
+            for (var _i = 0, _a = Material._DirtyCallbackArray; _i < _a.length; _i++) {
+                var cb = _a[_i];
+                cb(defines);
+            }
+        };
         __decorate([
             BABYLON.serialize()
         ], Material.prototype, "id", void 0);
@@ -66902,7 +66821,6 @@ var BABYLON;
             _this._started = false;
             _this._stopped = false;
             _this._timeDelta = 0;
-            _this._attributesStrideSize = 21;
             _this._actualFrame = 0;
             _this._rawTextureWidth = 256;
             /**
@@ -67518,6 +67436,8 @@ var BABYLON;
             }
             var engine = this._scene.getEngine();
             var data = new Array();
+            this._attributesStrideSize = 21;
+            this._targetIndex = 0;
             if (!this.isBillboardBased) {
                 this._attributesStrideSize += 3;
             }
@@ -76609,46 +76529,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(ShadowGenerator.prototype, "useVarianceShadowMap", {
-            /**
-             * Gets if the current filter is set to VSM.
-             * DEPRECATED. Should use useExponentialShadowMap instead.
-             */
-            get: function () {
-                BABYLON.Tools.Warn("VSM are now replaced by ESM. Please use useExponentialShadowMap instead.");
-                return this.useExponentialShadowMap;
-            },
-            /**
-             * Sets the current filter is to VSM.
-             * DEPRECATED. Should use useExponentialShadowMap instead.
-             */
-            set: function (value) {
-                BABYLON.Tools.Warn("VSM are now replaced by ESM. Please use useExponentialShadowMap instead.");
-                this.useExponentialShadowMap = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(ShadowGenerator.prototype, "useBlurVarianceShadowMap", {
-            /**
-             * Gets if the current filter is set to blurred VSM.
-             * DEPRECATED. Should use useBlurExponentialShadowMap instead.
-             */
-            get: function () {
-                BABYLON.Tools.Warn("VSM are now replaced by ESM. Please use useBlurExponentialShadowMap instead.");
-                return this.useBlurExponentialShadowMap;
-            },
-            /**
-             * Sets the current filter is to blurred VSM.
-             * DEPRECATED. Should use useBlurExponentialShadowMap instead.
-             */
-            set: function (value) {
-                BABYLON.Tools.Warn("VSM are now replaced by ESM. Please use useBlurExponentialShadowMap instead.");
-                this.useBlurExponentialShadowMap = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(ShadowGenerator.prototype, "useExponentialShadowMap", {
             /**
              * Gets if the current filter is set to ESM.

+ 54 - 174
dist/preview release/babylon.no-module.max.js

@@ -5444,7 +5444,7 @@ var BABYLON;
         };
         /**
          * Returns a new Vector3 set from the index "offset" of the given Float32Array
-         * This function is deprecated.  Use FromArray instead
+         * This function is deprecated. Use FromArray instead
          * @param array defines the source array
          * @param offset defines the offset in the source array
          * @returns the new Vector3
@@ -13203,24 +13203,6 @@ var BABYLON;
         Engine.prototype.getCaps = function () {
             return this._caps;
         };
-        Object.defineProperty(Engine.prototype, "drawCalls", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("drawCalls is deprecated. Please use SceneInstrumentation class");
-                return 0;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine.prototype, "drawCallsPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("drawCallsPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
         /**
          * Gets the current depth function
          * @returns a number defining the depth function
@@ -26520,48 +26502,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        /** @hidden */
-        Scene.prototype.getInterFramePerfCounter = function () {
-            BABYLON.Tools.Warn("getInterFramePerfCounter is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "interFramePerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("interFramePerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /** @hidden */
-        Scene.prototype.getLastFrameDuration = function () {
-            BABYLON.Tools.Warn("getLastFrameDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "lastFramePerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("lastFramePerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /** @hidden */
-        Scene.prototype.getEvaluateActiveMeshesDuration = function () {
-            BABYLON.Tools.Warn("getEvaluateActiveMeshesDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "evaluateActiveMeshesDurationPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("evaluateActiveMeshesDurationPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
         /**
          * Gets the array of active meshes
          * @returns an array of AbstractMesh
@@ -26569,53 +26509,6 @@ var BABYLON;
         Scene.prototype.getActiveMeshes = function () {
             return this._activeMeshes;
         };
-        /** @hidden */
-        Scene.prototype.getRenderTargetsDuration = function () {
-            BABYLON.Tools.Warn("getRenderTargetsDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        /** @hidden */
-        Scene.prototype.getRenderDuration = function () {
-            BABYLON.Tools.Warn("getRenderDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "renderDurationPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("renderDurationPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /** @hidden */
-        Scene.prototype.getParticlesDuration = function () {
-            BABYLON.Tools.Warn("getParticlesDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "particlesDurationPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("particlesDurationPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /** @hidden */
-        Scene.prototype.getSpritesDuration = function () {
-            BABYLON.Tools.Warn("getSpritesDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "spriteDuractionPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("spriteDuractionPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
         /**
          * Gets the animation ratio (which is 1.0 is the scene renders at 60fps and 2 if the scene renders at 30fps, etc.)
          * @returns a number
@@ -37262,20 +37155,27 @@ var BABYLON;
          * @param flag defines a flag used to determine which parts of the material have to be marked as dirty
          */
         Material.prototype.markAsDirty = function (flag) {
+            if (this.getScene().blockMaterialDirtyMechanism) {
+                return;
+            }
+            Material._DirtyCallbackArray.length = 0;
             if (flag & Material.TextureDirtyFlag) {
-                this._markAllSubMeshesAsTexturesDirty();
+                Material._DirtyCallbackArray.push(Material._TextureDirtyCallBack);
             }
             if (flag & Material.LightDirtyFlag) {
-                this._markAllSubMeshesAsLightsDirty();
+                Material._DirtyCallbackArray.push(Material._LightsDirtyCallBack);
             }
             if (flag & Material.FresnelDirtyFlag) {
-                this._markAllSubMeshesAsFresnelDirty();
+                Material._DirtyCallbackArray.push(Material._FresnelDirtyCallBack);
             }
             if (flag & Material.AttributesDirtyFlag) {
-                this._markAllSubMeshesAsAttributesDirty();
+                Material._DirtyCallbackArray.push(Material._AttributeDirtyCallBack);
             }
             if (flag & Material.MiscDirtyFlag) {
-                this._markAllSubMeshesAsMiscDirty();
+                Material._DirtyCallbackArray.push(Material._MiscDirtyCallBack);
+            }
+            if (Material._DirtyCallbackArray.length) {
+                this._markAllSubMeshesAsDirty(Material._RunDirtyCallBacks);
             }
             this.getScene().resetCachedMaterial();
         };
@@ -37284,13 +37184,17 @@ var BABYLON;
          * @param func defines a function which checks material defines against the submeshes
          */
         Material.prototype._markAllSubMeshesAsDirty = function (func) {
-            for (var _i = 0, _a = this.getScene().meshes; _i < _a.length; _i++) {
-                var mesh = _a[_i];
+            if (this.getScene().blockMaterialDirtyMechanism) {
+                return;
+            }
+            var meshes = this.getScene().meshes;
+            for (var _i = 0, meshes_1 = meshes; _i < meshes_1.length; _i++) {
+                var mesh = meshes_1[_i];
                 if (!mesh.subMeshes) {
                     continue;
                 }
-                for (var _b = 0, _c = mesh.subMeshes; _b < _c.length; _b++) {
-                    var subMesh = _c[_b];
+                for (var _a = 0, _b = mesh.subMeshes; _a < _b.length; _a++) {
+                    var subMesh = _b[_a];
                     if (subMesh.getMaterial() !== this) {
                         continue;
                     }
@@ -37305,55 +37209,49 @@ var BABYLON;
          * Indicates that image processing needs to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsImageProcessingDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsImageProcessingDirty(); });
+            this._markAllSubMeshesAsDirty(Material._ImageProcessingDirtyCallBack);
         };
         /**
          * Indicates that textures need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsTexturesDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsTexturesDirty(); });
+            this._markAllSubMeshesAsDirty(Material._TextureDirtyCallBack);
         };
         /**
          * Indicates that fresnel needs to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsFresnelDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsFresnelDirty(); });
+            this._markAllSubMeshesAsDirty(Material._FresnelDirtyCallBack);
         };
         /**
          * Indicates that fresnel and misc need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsFresnelAndMiscDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) {
-                defines.markAsFresnelDirty();
-                defines.markAsMiscDirty();
-            });
+            this._markAllSubMeshesAsDirty(Material._FresnelAndMiscDirtyCallBack);
         };
         /**
          * Indicates that lights need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsLightsDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsLightDirty(); });
+            this._markAllSubMeshesAsDirty(Material._LightsDirtyCallBack);
         };
         /**
          * Indicates that attributes need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsAttributesDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsAttributesDirty(); });
+            this._markAllSubMeshesAsDirty(Material._AttributeDirtyCallBack);
         };
         /**
          * Indicates that misc needs to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsMiscDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsMiscDirty(); });
+            this._markAllSubMeshesAsDirty(Material._MiscDirtyCallBack);
         };
         /**
          * Indicates that textures and misc need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsTexturesAndMiscDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) {
-                defines.markAsTexturesDirty();
-                defines.markAsMiscDirty();
-            });
+            this._markAllSubMeshesAsDirty(Material._TextureAndMiscDirtyCallBack);
         };
         /**
          * Disposes the material
@@ -37381,8 +37279,8 @@ var BABYLON;
                 }
                 else {
                     var meshes = scene.meshes;
-                    for (var _i = 0, meshes_1 = meshes; _i < meshes_1.length; _i++) {
-                        var mesh = meshes_1[_i];
+                    for (var _i = 0, meshes_2 = meshes; _i < meshes_2.length; _i++) {
+                        var mesh = meshes_2[_i];
                         if (mesh.material === this) {
                             mesh.material = null;
                             this.releaseVertexArrayObject(mesh, forceDisposeEffect);
@@ -37521,6 +37419,27 @@ var BABYLON;
          * The all dirty flag value
          */
         Material.AllDirtyFlag = 31;
+        Material._ImageProcessingDirtyCallBack = function (defines) { return defines.markAsImageProcessingDirty(); };
+        Material._TextureDirtyCallBack = function (defines) { return defines.markAsTexturesDirty(); };
+        Material._FresnelDirtyCallBack = function (defines) { return defines.markAsFresnelDirty(); };
+        Material._MiscDirtyCallBack = function (defines) { return defines.markAsMiscDirty(); };
+        Material._LightsDirtyCallBack = function (defines) { return defines.markAsLightDirty(); };
+        Material._AttributeDirtyCallBack = function (defines) { return defines.markAsAttributesDirty(); };
+        Material._FresnelAndMiscDirtyCallBack = function (defines) {
+            Material._FresnelDirtyCallBack(defines);
+            Material._MiscDirtyCallBack(defines);
+        };
+        Material._TextureAndMiscDirtyCallBack = function (defines) {
+            Material._TextureDirtyCallBack(defines);
+            Material._MiscDirtyCallBack(defines);
+        };
+        Material._DirtyCallbackArray = [];
+        Material._RunDirtyCallBacks = function (defines) {
+            for (var _i = 0, _a = Material._DirtyCallbackArray; _i < _a.length; _i++) {
+                var cb = _a[_i];
+                cb(defines);
+            }
+        };
         __decorate([
             BABYLON.serialize()
         ], Material.prototype, "id", void 0);
@@ -66869,7 +66788,6 @@ var BABYLON;
             _this._started = false;
             _this._stopped = false;
             _this._timeDelta = 0;
-            _this._attributesStrideSize = 21;
             _this._actualFrame = 0;
             _this._rawTextureWidth = 256;
             /**
@@ -67485,6 +67403,8 @@ var BABYLON;
             }
             var engine = this._scene.getEngine();
             var data = new Array();
+            this._attributesStrideSize = 21;
+            this._targetIndex = 0;
             if (!this.isBillboardBased) {
                 this._attributesStrideSize += 3;
             }
@@ -76576,46 +76496,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(ShadowGenerator.prototype, "useVarianceShadowMap", {
-            /**
-             * Gets if the current filter is set to VSM.
-             * DEPRECATED. Should use useExponentialShadowMap instead.
-             */
-            get: function () {
-                BABYLON.Tools.Warn("VSM are now replaced by ESM. Please use useExponentialShadowMap instead.");
-                return this.useExponentialShadowMap;
-            },
-            /**
-             * Sets the current filter is to VSM.
-             * DEPRECATED. Should use useExponentialShadowMap instead.
-             */
-            set: function (value) {
-                BABYLON.Tools.Warn("VSM are now replaced by ESM. Please use useExponentialShadowMap instead.");
-                this.useExponentialShadowMap = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(ShadowGenerator.prototype, "useBlurVarianceShadowMap", {
-            /**
-             * Gets if the current filter is set to blurred VSM.
-             * DEPRECATED. Should use useBlurExponentialShadowMap instead.
-             */
-            get: function () {
-                BABYLON.Tools.Warn("VSM are now replaced by ESM. Please use useBlurExponentialShadowMap instead.");
-                return this.useBlurExponentialShadowMap;
-            },
-            /**
-             * Sets the current filter is to blurred VSM.
-             * DEPRECATED. Should use useBlurExponentialShadowMap instead.
-             */
-            set: function (value) {
-                BABYLON.Tools.Warn("VSM are now replaced by ESM. Please use useBlurExponentialShadowMap instead.");
-                this.useBlurExponentialShadowMap = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(ShadowGenerator.prototype, "useExponentialShadowMap", {
             /**
              * Gets if the current filter is set to ESM.

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/babylon.worker.js


+ 54 - 174
dist/preview release/es6.js

@@ -5444,7 +5444,7 @@ var BABYLON;
         };
         /**
          * Returns a new Vector3 set from the index "offset" of the given Float32Array
-         * This function is deprecated.  Use FromArray instead
+         * This function is deprecated. Use FromArray instead
          * @param array defines the source array
          * @param offset defines the offset in the source array
          * @returns the new Vector3
@@ -13203,24 +13203,6 @@ var BABYLON;
         Engine.prototype.getCaps = function () {
             return this._caps;
         };
-        Object.defineProperty(Engine.prototype, "drawCalls", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("drawCalls is deprecated. Please use SceneInstrumentation class");
-                return 0;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine.prototype, "drawCallsPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("drawCallsPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
         /**
          * Gets the current depth function
          * @returns a number defining the depth function
@@ -26520,48 +26502,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        /** @hidden */
-        Scene.prototype.getInterFramePerfCounter = function () {
-            BABYLON.Tools.Warn("getInterFramePerfCounter is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "interFramePerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("interFramePerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /** @hidden */
-        Scene.prototype.getLastFrameDuration = function () {
-            BABYLON.Tools.Warn("getLastFrameDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "lastFramePerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("lastFramePerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /** @hidden */
-        Scene.prototype.getEvaluateActiveMeshesDuration = function () {
-            BABYLON.Tools.Warn("getEvaluateActiveMeshesDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "evaluateActiveMeshesDurationPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("evaluateActiveMeshesDurationPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
         /**
          * Gets the array of active meshes
          * @returns an array of AbstractMesh
@@ -26569,53 +26509,6 @@ var BABYLON;
         Scene.prototype.getActiveMeshes = function () {
             return this._activeMeshes;
         };
-        /** @hidden */
-        Scene.prototype.getRenderTargetsDuration = function () {
-            BABYLON.Tools.Warn("getRenderTargetsDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        /** @hidden */
-        Scene.prototype.getRenderDuration = function () {
-            BABYLON.Tools.Warn("getRenderDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "renderDurationPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("renderDurationPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /** @hidden */
-        Scene.prototype.getParticlesDuration = function () {
-            BABYLON.Tools.Warn("getParticlesDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "particlesDurationPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("particlesDurationPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /** @hidden */
-        Scene.prototype.getSpritesDuration = function () {
-            BABYLON.Tools.Warn("getSpritesDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        };
-        Object.defineProperty(Scene.prototype, "spriteDuractionPerfCounter", {
-            /** @hidden */
-            get: function () {
-                BABYLON.Tools.Warn("spriteDuractionPerfCounter is deprecated. Please use SceneInstrumentation class");
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
         /**
          * Gets the animation ratio (which is 1.0 is the scene renders at 60fps and 2 if the scene renders at 30fps, etc.)
          * @returns a number
@@ -37262,20 +37155,27 @@ var BABYLON;
          * @param flag defines a flag used to determine which parts of the material have to be marked as dirty
          */
         Material.prototype.markAsDirty = function (flag) {
+            if (this.getScene().blockMaterialDirtyMechanism) {
+                return;
+            }
+            Material._DirtyCallbackArray.length = 0;
             if (flag & Material.TextureDirtyFlag) {
-                this._markAllSubMeshesAsTexturesDirty();
+                Material._DirtyCallbackArray.push(Material._TextureDirtyCallBack);
             }
             if (flag & Material.LightDirtyFlag) {
-                this._markAllSubMeshesAsLightsDirty();
+                Material._DirtyCallbackArray.push(Material._LightsDirtyCallBack);
             }
             if (flag & Material.FresnelDirtyFlag) {
-                this._markAllSubMeshesAsFresnelDirty();
+                Material._DirtyCallbackArray.push(Material._FresnelDirtyCallBack);
             }
             if (flag & Material.AttributesDirtyFlag) {
-                this._markAllSubMeshesAsAttributesDirty();
+                Material._DirtyCallbackArray.push(Material._AttributeDirtyCallBack);
             }
             if (flag & Material.MiscDirtyFlag) {
-                this._markAllSubMeshesAsMiscDirty();
+                Material._DirtyCallbackArray.push(Material._MiscDirtyCallBack);
+            }
+            if (Material._DirtyCallbackArray.length) {
+                this._markAllSubMeshesAsDirty(Material._RunDirtyCallBacks);
             }
             this.getScene().resetCachedMaterial();
         };
@@ -37284,13 +37184,17 @@ var BABYLON;
          * @param func defines a function which checks material defines against the submeshes
          */
         Material.prototype._markAllSubMeshesAsDirty = function (func) {
-            for (var _i = 0, _a = this.getScene().meshes; _i < _a.length; _i++) {
-                var mesh = _a[_i];
+            if (this.getScene().blockMaterialDirtyMechanism) {
+                return;
+            }
+            var meshes = this.getScene().meshes;
+            for (var _i = 0, meshes_1 = meshes; _i < meshes_1.length; _i++) {
+                var mesh = meshes_1[_i];
                 if (!mesh.subMeshes) {
                     continue;
                 }
-                for (var _b = 0, _c = mesh.subMeshes; _b < _c.length; _b++) {
-                    var subMesh = _c[_b];
+                for (var _a = 0, _b = mesh.subMeshes; _a < _b.length; _a++) {
+                    var subMesh = _b[_a];
                     if (subMesh.getMaterial() !== this) {
                         continue;
                     }
@@ -37305,55 +37209,49 @@ var BABYLON;
          * Indicates that image processing needs to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsImageProcessingDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsImageProcessingDirty(); });
+            this._markAllSubMeshesAsDirty(Material._ImageProcessingDirtyCallBack);
         };
         /**
          * Indicates that textures need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsTexturesDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsTexturesDirty(); });
+            this._markAllSubMeshesAsDirty(Material._TextureDirtyCallBack);
         };
         /**
          * Indicates that fresnel needs to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsFresnelDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsFresnelDirty(); });
+            this._markAllSubMeshesAsDirty(Material._FresnelDirtyCallBack);
         };
         /**
          * Indicates that fresnel and misc need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsFresnelAndMiscDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) {
-                defines.markAsFresnelDirty();
-                defines.markAsMiscDirty();
-            });
+            this._markAllSubMeshesAsDirty(Material._FresnelAndMiscDirtyCallBack);
         };
         /**
          * Indicates that lights need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsLightsDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsLightDirty(); });
+            this._markAllSubMeshesAsDirty(Material._LightsDirtyCallBack);
         };
         /**
          * Indicates that attributes need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsAttributesDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsAttributesDirty(); });
+            this._markAllSubMeshesAsDirty(Material._AttributeDirtyCallBack);
         };
         /**
          * Indicates that misc needs to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsMiscDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) { return defines.markAsMiscDirty(); });
+            this._markAllSubMeshesAsDirty(Material._MiscDirtyCallBack);
         };
         /**
          * Indicates that textures and misc need to be re-calculated for all submeshes
          */
         Material.prototype._markAllSubMeshesAsTexturesAndMiscDirty = function () {
-            this._markAllSubMeshesAsDirty(function (defines) {
-                defines.markAsTexturesDirty();
-                defines.markAsMiscDirty();
-            });
+            this._markAllSubMeshesAsDirty(Material._TextureAndMiscDirtyCallBack);
         };
         /**
          * Disposes the material
@@ -37381,8 +37279,8 @@ var BABYLON;
                 }
                 else {
                     var meshes = scene.meshes;
-                    for (var _i = 0, meshes_1 = meshes; _i < meshes_1.length; _i++) {
-                        var mesh = meshes_1[_i];
+                    for (var _i = 0, meshes_2 = meshes; _i < meshes_2.length; _i++) {
+                        var mesh = meshes_2[_i];
                         if (mesh.material === this) {
                             mesh.material = null;
                             this.releaseVertexArrayObject(mesh, forceDisposeEffect);
@@ -37521,6 +37419,27 @@ var BABYLON;
          * The all dirty flag value
          */
         Material.AllDirtyFlag = 31;
+        Material._ImageProcessingDirtyCallBack = function (defines) { return defines.markAsImageProcessingDirty(); };
+        Material._TextureDirtyCallBack = function (defines) { return defines.markAsTexturesDirty(); };
+        Material._FresnelDirtyCallBack = function (defines) { return defines.markAsFresnelDirty(); };
+        Material._MiscDirtyCallBack = function (defines) { return defines.markAsMiscDirty(); };
+        Material._LightsDirtyCallBack = function (defines) { return defines.markAsLightDirty(); };
+        Material._AttributeDirtyCallBack = function (defines) { return defines.markAsAttributesDirty(); };
+        Material._FresnelAndMiscDirtyCallBack = function (defines) {
+            Material._FresnelDirtyCallBack(defines);
+            Material._MiscDirtyCallBack(defines);
+        };
+        Material._TextureAndMiscDirtyCallBack = function (defines) {
+            Material._TextureDirtyCallBack(defines);
+            Material._MiscDirtyCallBack(defines);
+        };
+        Material._DirtyCallbackArray = [];
+        Material._RunDirtyCallBacks = function (defines) {
+            for (var _i = 0, _a = Material._DirtyCallbackArray; _i < _a.length; _i++) {
+                var cb = _a[_i];
+                cb(defines);
+            }
+        };
         __decorate([
             BABYLON.serialize()
         ], Material.prototype, "id", void 0);
@@ -66869,7 +66788,6 @@ var BABYLON;
             _this._started = false;
             _this._stopped = false;
             _this._timeDelta = 0;
-            _this._attributesStrideSize = 21;
             _this._actualFrame = 0;
             _this._rawTextureWidth = 256;
             /**
@@ -67485,6 +67403,8 @@ var BABYLON;
             }
             var engine = this._scene.getEngine();
             var data = new Array();
+            this._attributesStrideSize = 21;
+            this._targetIndex = 0;
             if (!this.isBillboardBased) {
                 this._attributesStrideSize += 3;
             }
@@ -76576,46 +76496,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(ShadowGenerator.prototype, "useVarianceShadowMap", {
-            /**
-             * Gets if the current filter is set to VSM.
-             * DEPRECATED. Should use useExponentialShadowMap instead.
-             */
-            get: function () {
-                BABYLON.Tools.Warn("VSM are now replaced by ESM. Please use useExponentialShadowMap instead.");
-                return this.useExponentialShadowMap;
-            },
-            /**
-             * Sets the current filter is to VSM.
-             * DEPRECATED. Should use useExponentialShadowMap instead.
-             */
-            set: function (value) {
-                BABYLON.Tools.Warn("VSM are now replaced by ESM. Please use useExponentialShadowMap instead.");
-                this.useExponentialShadowMap = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(ShadowGenerator.prototype, "useBlurVarianceShadowMap", {
-            /**
-             * Gets if the current filter is set to blurred VSM.
-             * DEPRECATED. Should use useBlurExponentialShadowMap instead.
-             */
-            get: function () {
-                BABYLON.Tools.Warn("VSM are now replaced by ESM. Please use useBlurExponentialShadowMap instead.");
-                return this.useBlurExponentialShadowMap;
-            },
-            /**
-             * Sets the current filter is to blurred VSM.
-             * DEPRECATED. Should use useBlurExponentialShadowMap instead.
-             */
-            set: function (value) {
-                BABYLON.Tools.Warn("VSM are now replaced by ESM. Please use useBlurExponentialShadowMap instead.");
-                this.useBlurExponentialShadowMap = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(ShadowGenerator.prototype, "useExponentialShadowMap", {
             /**
              * Gets if the current filter is set to ESM.

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

@@ -5481,7 +5481,7 @@ var InputText = /** @class */ (function (_super) {
                 }
                 return;
             case 46: // DELETE
-                if (this._text && this._text.length > 0) {
+                if (this._text && this._text.length > 0 && this._cursorOffset > 0) {
                     var deletePosition = this._text.length - this._cursorOffset;
                     this.text = this._text.slice(0, deletePosition) + this._text.slice(deletePosition + 1);
                     this._cursorOffset--;
@@ -5524,7 +5524,7 @@ var InputText = /** @class */ (function (_super) {
         if (key &&
             ((keyCode === -1) || // Direct access
                 (keyCode === 32) || // Space
-                (keyCode > 47 && keyCode < 58) || // Numbers
+                (keyCode > 47 && keyCode < 64) || // Numbers
                 (keyCode > 64 && keyCode < 91) || // Letters
                 (keyCode > 185 && keyCode < 193) || // Special characters
                 (keyCode > 218 && keyCode < 223) || // Special characters

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/gui/babylon.gui.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.min.js.map


+ 19 - 5
dist/preview release/viewer/babylon.viewer.d.ts

@@ -169,11 +169,11 @@ declare module BabylonViewer {
                 * Mainly used for help and errors
                 * @param subScreen the name of the subScreen. Those can be defined in the configuration object
                 */
-            showOverlayScreen(subScreen: string): Promise<string> | Promise<Template>;
+            showOverlayScreen(subScreen: string): Promise<Template> | Promise<string>;
             /**
                 * Hide the overlay screen.
                 */
-            hideOverlayScreen(): Promise<string> | Promise<Template>;
+            hideOverlayScreen(): Promise<Template> | Promise<string>;
             /**
                 * show the viewer (in case it was hidden)
                 *
@@ -190,11 +190,11 @@ declare module BabylonViewer {
                 * Show the loading screen.
                 * The loading screen can be configured using the configuration object
                 */
-            showLoadingScreen(): Promise<string> | Promise<Template>;
+            showLoadingScreen(): Promise<Template> | Promise<string>;
             /**
                 * Hide the loading screen
                 */
-            hideLoadingScreen(): Promise<string> | Promise<Template>;
+            hideLoadingScreen(): Promise<Template> | Promise<string>;
             dispose(): void;
             protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
     }
@@ -925,7 +925,7 @@ declare module BabylonViewer {
       * @param name the name of the custom optimizer configuration
       * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 declare module BabylonViewer {
@@ -1557,6 +1557,20 @@ declare module BabylonViewer {
     export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
 }
 declare module BabylonViewer {
+    /**
+        * A custom upgrade-oriented function configuration for the scene optimizer.
+        *
+        * @param viewer the viewer to optimize
+        */
+    export function extendedUpgrade(sceneManager: SceneManager): boolean;
+    /**
+        * A custom degrade-oriented function configuration for the scene optimizer.
+        *
+        * @param viewer the viewer to optimize
+        */
+    export function extendedDegrade(sceneManager: SceneManager): boolean;
+}
+declare module BabylonViewer {
     export interface IEnvironmentMapConfiguration {
             /**
                 * Environment map texture path in relative to the asset folder.

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 22 - 5
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -201,11 +201,11 @@ declare module 'babylonjs-viewer/viewer/defaultViewer' {
                 * Mainly used for help and errors
                 * @param subScreen the name of the subScreen. Those can be defined in the configuration object
                 */
-            showOverlayScreen(subScreen: string): Promise<string> | Promise<Template>;
+            showOverlayScreen(subScreen: string): Promise<Template> | Promise<string>;
             /**
                 * Hide the overlay screen.
                 */
-            hideOverlayScreen(): Promise<string> | Promise<Template>;
+            hideOverlayScreen(): Promise<Template> | Promise<string>;
             /**
                 * show the viewer (in case it was hidden)
                 *
@@ -222,11 +222,11 @@ declare module 'babylonjs-viewer/viewer/defaultViewer' {
                 * Show the loading screen.
                 * The loading screen can be configured using the configuration object
                 */
-            showLoadingScreen(): Promise<string> | Promise<Template>;
+            showLoadingScreen(): Promise<Template> | Promise<string>;
             /**
                 * Hide the loading screen
                 */
-            hideLoadingScreen(): Promise<string> | Promise<Template>;
+            hideLoadingScreen(): Promise<Template> | Promise<string>;
             dispose(): void;
             protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
     }
@@ -986,13 +986,14 @@ declare module 'babylonjs-viewer/templating/viewerTemplatePlugin' {
 }
 
 declare module 'babylonjs-viewer/optimizer/custom' {
+    import { extendedUpgrade } from "babylonjs-viewer/optimizer/custom/extended";
     import { SceneManager } from "babylonjs-viewer/managers/sceneManager";
     /**
       *
       * @param name the name of the custom optimizer configuration
       * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 
@@ -1663,6 +1664,22 @@ declare module 'babylonjs-viewer/loader/plugins' {
     export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
 }
 
+declare module 'babylonjs-viewer/optimizer/custom/extended' {
+    import { SceneManager } from 'babylonjs-viewer/managers/sceneManager';
+    /**
+        * A custom upgrade-oriented function configuration for the scene optimizer.
+        *
+        * @param viewer the viewer to optimize
+        */
+    export function extendedUpgrade(sceneManager: SceneManager): boolean;
+    /**
+        * A custom degrade-oriented function configuration for the scene optimizer.
+        *
+        * @param viewer the viewer to optimize
+        */
+    export function extendedDegrade(sceneManager: SceneManager): boolean;
+}
+
 declare module 'babylonjs-viewer/configuration/interfaces' {
     export * from 'babylonjs-viewer/configuration/interfaces/cameraConfiguration';
     export * from 'babylonjs-viewer/configuration/interfaces/colorGradingConfiguration';

+ 20 - 0
dist/preview release/what's new.md

@@ -42,7 +42,9 @@
   - Added `blockfreeActiveMeshesAndRenderingGroups` property in the `Scene`, following the same model as `blockMaterialDirtyMechanism`. This is to avoid calling `Scene.freeActiveMeshes` and `Scene.freeRenderingGroups` for each disposed mesh when we dispose several meshes in a row. One have to set `blockfreeActiveMeshesAndRenderingGroups` to `true` just before disposing the meshes, and set it back to `false` just after
   - Prevented code from doing useless and possible time consuming computation when disposing the `ShaderMaterial` of a `LinesMesh`
   - Make a better use of the `isIdentity` cached value wihtin a `Matrix`
+  - Make sure we browse all the submeshes only once in `Material.markAsDirty` function
 - Align `BoundingBox` and `BoundingSphere` API and behavior for clarity and simplicity. As a consequence, the `BoundingBox`'s method `setWorldMatrix` has been removed and the underlying world matrix cannot be modified but by calling `reConstruct` or `update`. ([barroij](https://github.com/barroij))
+- Make sure that `Material.markAsDirty` and all the `markXXXDirty` methods early out when `scene.blockMaterialDirtyMechanism` is true. ([barroij](https://github.com/barroij))
 
 ### glTF Loader
 
@@ -75,3 +77,21 @@
 - `scene.database` was renamed to `scene.offlineProvider` ([Deltakosh](https://github.com/deltakosh))
 - `BoundingBox.setWorldMatrix` was removed. `BoundingBox.getWorldMatrix` now returns a `Readonly<Matrix>` ([barroij](https://github.com/barroij))
 - `Matrix`'s accessor `m` and method `toArray` and `asArray` now returns a `Readonly<Float32Array>` as the matrix underlying array is not supposed to be modified manually from the outside of the class ([barroij](https://github.com/barroij))
+- Removed some deprecated (flagged since 3.0) properties and functions ([Deltakosh](https://github.com/deltakosh))
+  - `scene.getInterFramePerfCounter()`: use SceneInstrumentation class instead
+  - `scene.interFramePerfCounter`: use SceneInstrumentation class instead
+  - `scene.getLastFrameDuration()`: use SceneInstrumentation class instead
+  - `scene.lastFramePerfCounter`: use SceneInstrumentation class instead
+  - `scene.getEvaluateActiveMeshesDuration()`: use SceneInstrumentation class instead
+  - `scene.evaluateActiveMeshesDurationPerfCounter`: use SceneInstrumentation class instead
+  - `scene.getRenderTargetsDuration()`: use SceneInstrumentation class instead
+  - `scene.getRenderDuration()`: use SceneInstrumentation class instead
+  - `scene.renderDurationPerfCounter`: use SceneInstrumentation class instead
+  - `scene.getParticlesDuration()`: use SceneInstrumentation class instead
+  - `scene.particlesDurationPerfCounter`: use SceneInstrumentation class instead
+  - `scene.getSpritesDuration()`: use SceneInstrumentation class instead
+  - `scene.spriteDuractionPerfCounter`: use SceneInstrumentation class instead
+  - `engine.drawCalls`: use SceneInstrumentation class instead
+  - `engine.drawCallsPerfCounter`: use SceneInstrumentation class instead
+  - `shadowGenerator.useVarianceShadowMap`: use useExponentialShadowMap instead
+  - `shadowGenerator.useBlurVarianceShadowMap`: use useBlurExponentialShadowMap instead

+ 2 - 2
gui/src/2D/controls/inputText.ts

@@ -307,7 +307,7 @@ export class InputText extends Control implements IFocusableControl {
                 }
                 return;
             case 46: // DELETE
-                if (this._text && this._text.length > 0) {
+                if (this._text && this._text.length > 0  && this._cursorOffset > 0) {
                     let deletePosition = this._text.length - this._cursorOffset;
                     this.text = this._text.slice(0, deletePosition) + this._text.slice(deletePosition + 1);
                     this._cursorOffset--;
@@ -351,7 +351,7 @@ export class InputText extends Control implements IFocusableControl {
         if (key &&
             ((keyCode === -1) ||                     // Direct access
                 (keyCode === 32) ||                     // Space
-                (keyCode > 47 && keyCode < 58) ||       // Numbers
+                (keyCode > 47 && keyCode < 64) ||       // Numbers
                 (keyCode > 64 && keyCode < 91) ||       // Letters
                 (keyCode > 185 && keyCode < 193) ||     // Special characters
                 (keyCode > 218 && keyCode < 223) ||     // Special characters

+ 0 - 12
src/Engine/babylon.engine.ts

@@ -1664,18 +1664,6 @@ module BABYLON {
             return this._caps;
         }
 
-        /** @hidden */
-        public get drawCalls(): number {
-            Tools.Warn("drawCalls is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        }
-
-        /** @hidden */
-        public get drawCallsPerfCounter(): Nullable<PerfCounter> {
-            Tools.Warn("drawCallsPerfCounter is deprecated. Please use SceneInstrumentation class");
-            return null;
-        }
-
         /**
          * Gets the current depth function
          * @returns a number defining the depth function

+ 0 - 34
src/Lights/Shadows/babylon.shadowGenerator.ts

@@ -346,40 +346,6 @@ module BABYLON {
         }
 
         /**
-         * Gets if the current filter is set to VSM.
-         * DEPRECATED. Should use useExponentialShadowMap instead.
-         */
-        public get useVarianceShadowMap(): boolean {
-            Tools.Warn("VSM are now replaced by ESM. Please use useExponentialShadowMap instead.");
-            return this.useExponentialShadowMap;
-        }
-        /**
-         * Sets the current filter is to VSM.
-         * DEPRECATED. Should use useExponentialShadowMap instead.
-         */
-        public set useVarianceShadowMap(value: boolean) {
-            Tools.Warn("VSM are now replaced by ESM. Please use useExponentialShadowMap instead.");
-            this.useExponentialShadowMap = value;
-        }
-
-        /**
-         * Gets if the current filter is set to blurred VSM.
-         * DEPRECATED. Should use useBlurExponentialShadowMap instead.
-         */
-        public get useBlurVarianceShadowMap(): boolean {
-            Tools.Warn("VSM are now replaced by ESM. Please use useBlurExponentialShadowMap instead.");
-            return this.useBlurExponentialShadowMap;
-        }
-        /**
-         * Sets the current filter is to blurred VSM.
-         * DEPRECATED. Should use useBlurExponentialShadowMap instead.
-         */
-        public set useBlurVarianceShadowMap(value: boolean) {
-            Tools.Warn("VSM are now replaced by ESM. Please use useBlurExponentialShadowMap instead.");
-            this.useBlurExponentialShadowMap = value;
-        }
-
-        /**
          * Gets if the current filter is set to ESM.
          */
         public get useExponentialShadowMap(): boolean {

+ 53 - 20
src/Materials/babylon.material.ts

@@ -1154,29 +1154,63 @@ module BABYLON {
             });
         }
 
+        private static readonly _ImageProcessingDirtyCallBack = (defines: MaterialDefines) => defines.markAsImageProcessingDirty();
+        private static readonly _TextureDirtyCallBack = (defines: MaterialDefines) => defines.markAsTexturesDirty();
+        private static readonly _FresnelDirtyCallBack = (defines: MaterialDefines) => defines.markAsFresnelDirty();
+        private static readonly _MiscDirtyCallBack = (defines: MaterialDefines) => defines.markAsMiscDirty();
+        private static readonly _LightsDirtyCallBack = (defines: MaterialDefines) => defines.markAsLightDirty();
+        private static readonly _AttributeDirtyCallBack = (defines: MaterialDefines) => defines.markAsAttributesDirty();
+
+        private static _FresnelAndMiscDirtyCallBack = (defines: MaterialDefines) => {
+            Material._FresnelDirtyCallBack(defines);
+            Material._MiscDirtyCallBack(defines);
+        }
+
+        private static _TextureAndMiscDirtyCallBack = (defines: MaterialDefines) => {
+            Material._TextureDirtyCallBack(defines);
+            Material._MiscDirtyCallBack(defines);
+        }
+
+        private static readonly _DirtyCallbackArray: Array<(defines: MaterialDefines) => void> = [];
+        private static readonly _RunDirtyCallBacks = (defines: MaterialDefines) => {
+            for (const cb of Material._DirtyCallbackArray) {
+                cb(defines);
+            }
+        }
+
         /**
          * Marks a define in the material to indicate that it needs to be re-computed
          * @param flag defines a flag used to determine which parts of the material have to be marked as dirty
          */
         public markAsDirty(flag: number): void {
+            if (this.getScene().blockMaterialDirtyMechanism) {
+                return;
+            }
+
+            Material._DirtyCallbackArray.length = 0;
+
             if (flag & Material.TextureDirtyFlag) {
-                this._markAllSubMeshesAsTexturesDirty();
+                Material._DirtyCallbackArray.push(Material._TextureDirtyCallBack);
             }
 
             if (flag & Material.LightDirtyFlag) {
-                this._markAllSubMeshesAsLightsDirty();
+                Material._DirtyCallbackArray.push(Material._LightsDirtyCallBack);
             }
 
             if (flag & Material.FresnelDirtyFlag) {
-                this._markAllSubMeshesAsFresnelDirty();
+                Material._DirtyCallbackArray.push(Material._FresnelDirtyCallBack);
             }
 
             if (flag & Material.AttributesDirtyFlag) {
-                this._markAllSubMeshesAsAttributesDirty();
+                Material._DirtyCallbackArray.push(Material._AttributeDirtyCallBack);
             }
 
             if (flag & Material.MiscDirtyFlag) {
-                this._markAllSubMeshesAsMiscDirty();
+                Material._DirtyCallbackArray.push(Material._MiscDirtyCallBack);
+            }
+
+            if (Material._DirtyCallbackArray.length) {
+                this._markAllSubMeshesAsDirty(Material._RunDirtyCallBacks);
             }
 
             this.getScene().resetCachedMaterial();
@@ -1187,7 +1221,12 @@ module BABYLON {
          * @param func defines a function which checks material defines against the submeshes
          */
         protected _markAllSubMeshesAsDirty(func: (defines: MaterialDefines) => void) {
-            for (var mesh of this.getScene().meshes) {
+            if (this.getScene().blockMaterialDirtyMechanism) {
+                return;
+            }
+
+            const meshes = this.getScene().meshes;
+            for (var mesh of meshes) {
                 if (!mesh.subMeshes) {
                     continue;
                 }
@@ -1209,62 +1248,56 @@ module BABYLON {
          * Indicates that image processing needs to be re-calculated for all submeshes
          */
         protected _markAllSubMeshesAsImageProcessingDirty() {
-            this._markAllSubMeshesAsDirty((defines) => defines.markAsImageProcessingDirty());
+            this._markAllSubMeshesAsDirty(Material._ImageProcessingDirtyCallBack);
         }
 
         /**
          * Indicates that textures need to be re-calculated for all submeshes
          */
         protected _markAllSubMeshesAsTexturesDirty() {
-            this._markAllSubMeshesAsDirty((defines) => defines.markAsTexturesDirty());
+            this._markAllSubMeshesAsDirty(Material._TextureDirtyCallBack);
         }
 
         /**
          * Indicates that fresnel needs to be re-calculated for all submeshes
          */
         protected _markAllSubMeshesAsFresnelDirty() {
-            this._markAllSubMeshesAsDirty((defines) => defines.markAsFresnelDirty());
+            this._markAllSubMeshesAsDirty(Material._FresnelDirtyCallBack);
         }
 
         /**
          * Indicates that fresnel and misc need to be re-calculated for all submeshes
          */
         protected _markAllSubMeshesAsFresnelAndMiscDirty() {
-            this._markAllSubMeshesAsDirty((defines) => {
-                defines.markAsFresnelDirty();
-                defines.markAsMiscDirty();
-            });
+            this._markAllSubMeshesAsDirty(Material._FresnelAndMiscDirtyCallBack);
         }
 
         /**
          * Indicates that lights need to be re-calculated for all submeshes
          */
         protected _markAllSubMeshesAsLightsDirty() {
-            this._markAllSubMeshesAsDirty((defines) => defines.markAsLightDirty());
+            this._markAllSubMeshesAsDirty(Material._LightsDirtyCallBack);
         }
 
         /**
          * Indicates that attributes need to be re-calculated for all submeshes
          */
         protected _markAllSubMeshesAsAttributesDirty() {
-            this._markAllSubMeshesAsDirty((defines) => defines.markAsAttributesDirty());
+            this._markAllSubMeshesAsDirty(Material._AttributeDirtyCallBack);
         }
 
         /**
          * Indicates that misc needs to be re-calculated for all submeshes
          */
         protected _markAllSubMeshesAsMiscDirty() {
-            this._markAllSubMeshesAsDirty((defines) => defines.markAsMiscDirty());
+            this._markAllSubMeshesAsDirty(Material._MiscDirtyCallBack);
         }
 
         /**
          * Indicates that textures and misc need to be re-calculated for all submeshes
          */
         protected _markAllSubMeshesAsTexturesAndMiscDirty() {
-            this._markAllSubMeshesAsDirty((defines) => {
-                defines.markAsTexturesDirty();
-                defines.markAsMiscDirty();
-            });
+            this._markAllSubMeshesAsDirty(Material._TextureAndMiscDirtyCallBack);
         }
 
         /**

+ 1 - 1
src/Math/babylon.math.ts

@@ -2108,7 +2108,7 @@ module BABYLON {
 
         /**
          * Returns a new Vector3 set from the index "offset" of the given Float32Array
-         * This function is deprecated.  Use FromArray instead
+         * This function is deprecated. Use FromArray instead
          * @param array defines the source array
          * @param offset defines the offset in the source array
          * @returns the new Vector3

+ 4 - 1
src/Particles/babylon.gpuParticleSystem.ts

@@ -38,7 +38,7 @@ module BABYLON {
         private _randomTexture: RawTexture;
         private _randomTexture2: RawTexture;
 
-        private _attributesStrideSize = 21;
+        private _attributesStrideSize: number;
         private _updateEffectOptions: EffectCreationOptions;
 
         private _randomTextureSize: number;
@@ -788,6 +788,9 @@ module BABYLON {
             let engine = this._scene.getEngine();
             var data = new Array<float>();
 
+            this._attributesStrideSize = 21;
+            this._targetIndex = 0;
+
             if (!this.isBillboardBased) {
                 this._attributesStrideSize += 3;
             }

+ 4 - 82
src/babylon.scene.ts

@@ -545,13 +545,13 @@ module BABYLON {
         private _onPointerDown: (evt: PointerEvent) => void;
         private _onPointerUp: (evt: PointerEvent) => void;
 
-        /** Deprecated. Use onPointerObservable instead */
+        /** Callback called when a pointer move is detected */
         public onPointerMove: (evt: PointerEvent, pickInfo: PickingInfo, type: PointerEventTypes) => void;
-        /** Deprecated. Use onPointerObservable instead */
+        /** Callback called when a pointer down is detected  */
         public onPointerDown: (evt: PointerEvent, pickInfo: PickingInfo, type: PointerEventTypes) => void;
-        /** Deprecated. Use onPointerObservable instead */
+        /** Callback called when a pointer up is detected  */
         public onPointerUp: (evt: PointerEvent, pickInfo: Nullable<PickingInfo>, type: PointerEventTypes) => void;
-        /** Deprecated. Use onPointerObservable instead */
+        /** Callback called when a pointer pick is detected */
         public onPointerPick: (evt: PointerEvent, pickInfo: PickingInfo) => void;
 
         /**
@@ -1439,42 +1439,6 @@ module BABYLON {
             return this._activeBones;
         }
 
-        /** @hidden */
-        public getInterFramePerfCounter(): number {
-            Tools.Warn("getInterFramePerfCounter is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        }
-
-        /** @hidden */
-        public get interFramePerfCounter(): Nullable<PerfCounter> {
-            Tools.Warn("interFramePerfCounter is deprecated. Please use SceneInstrumentation class");
-            return null;
-        }
-
-        /** @hidden */
-        public getLastFrameDuration(): number {
-            Tools.Warn("getLastFrameDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        }
-
-        /** @hidden */
-        public get lastFramePerfCounter(): Nullable<PerfCounter> {
-            Tools.Warn("lastFramePerfCounter is deprecated. Please use SceneInstrumentation class");
-            return null;
-        }
-
-        /** @hidden */
-        public getEvaluateActiveMeshesDuration(): number {
-            Tools.Warn("getEvaluateActiveMeshesDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        }
-
-        /** @hidden */
-        public get evaluateActiveMeshesDurationPerfCounter(): Nullable<PerfCounter> {
-            Tools.Warn("evaluateActiveMeshesDurationPerfCounter is deprecated. Please use SceneInstrumentation class");
-            return null;
-        }
-
         /**
          * Gets the array of active meshes
          * @returns an array of AbstractMesh
@@ -1483,48 +1447,6 @@ module BABYLON {
             return this._activeMeshes;
         }
 
-        /** @hidden */
-        public getRenderTargetsDuration(): number {
-            Tools.Warn("getRenderTargetsDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        }
-
-        /** @hidden */
-        public getRenderDuration(): number {
-            Tools.Warn("getRenderDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        }
-
-        /** @hidden */
-        public get renderDurationPerfCounter(): Nullable<PerfCounter> {
-            Tools.Warn("renderDurationPerfCounter is deprecated. Please use SceneInstrumentation class");
-            return null;
-        }
-
-        /** @hidden */
-        public getParticlesDuration(): number {
-            Tools.Warn("getParticlesDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        }
-
-        /** @hidden */
-        public get particlesDurationPerfCounter(): Nullable<PerfCounter> {
-            Tools.Warn("particlesDurationPerfCounter is deprecated. Please use SceneInstrumentation class");
-            return null;
-        }
-
-        /** @hidden */
-        public getSpritesDuration(): number {
-            Tools.Warn("getSpritesDuration is deprecated. Please use SceneInstrumentation class");
-            return 0;
-        }
-
-        /** @hidden */
-        public get spriteDuractionPerfCounter(): Nullable<PerfCounter> {
-            Tools.Warn("spriteDuractionPerfCounter is deprecated. Please use SceneInstrumentation class");
-            return null;
-        }
-
         /**
          * Gets the animation ratio (which is 1.0 is the scene renders at 60fps and 2 if the scene renders at 30fps, etc.)
          * @returns a number