David Catuhe 7 سال پیش
والد
کامیت
a5f2c7f46a

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1404 - 1417
Playground/babylon.d.txt


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2179 - 2192
dist/preview release/babylon.d.ts


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
dist/preview release/babylon.js


+ 44 - 64
dist/preview release/babylon.max.js

@@ -11940,7 +11940,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "3.3.0-beta.5";
+                return "3.3.0-beta.6";
             },
             enumerable: true,
             configurable: true
@@ -24731,8 +24731,7 @@ var BABYLON;
                 return 1000.0 / 60.0; // frame time in ms
             };
             _this._tempPickingRay = BABYLON.Ray ? BABYLON.Ray.Zero() : null;
-            /** Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync) */
-            _this.blockMaterialDirtyMechanism = false;
+            _this._blockMaterialDirtyMechanism = false;
             _this._engine = engine || BABYLON.Engine.LastCreatedEngine;
             _this._engine.scenes.push(_this);
             _this._uid = null;
@@ -28664,13 +28663,30 @@ var BABYLON;
         Scene.prototype.getAutoClearDepthStencilSetup = function (index) {
             return this._renderingManager.getAutoClearDepthStencilSetup(index);
         };
+        Object.defineProperty(Scene.prototype, "blockMaterialDirtyMechanism", {
+            /** Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync) */
+            get: function () {
+                return this._blockMaterialDirtyMechanism;
+            },
+            set: function (value) {
+                if (this._blockMaterialDirtyMechanism === value) {
+                    return;
+                }
+                this._blockMaterialDirtyMechanism = value;
+                if (!value) { // Do a complete update
+                    this.markAllMaterialsAsDirty(BABYLON.Material.AllDirtyFlag);
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Will flag all materials as dirty to trigger new shader compilation
          * @param flag defines the flag used to specify which material part must be marked as dirty
          * @param predicate If not null, it will be used to specifiy if a material has to be marked as dirty
          */
         Scene.prototype.markAllMaterialsAsDirty = function (flag, predicate) {
-            if (this.blockMaterialDirtyMechanism) {
+            if (this._blockMaterialDirtyMechanism) {
                 return;
             }
             for (var _i = 0, _a = this.materials; _i < _a.length; _i++) {
@@ -34834,56 +34850,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Material, "TextureDirtyFlag", {
-            /**
-             * Returns the dirty texture flag value
-             */
-            get: function () {
-                return Material._TextureDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Material, "LightDirtyFlag", {
-            /**
-             * Returns the dirty light flag value
-             */
-            get: function () {
-                return Material._LightDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Material, "FresnelDirtyFlag", {
-            /**
-             * Returns the dirty fresnel flag value
-             */
-            get: function () {
-                return Material._FresnelDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Material, "AttributesDirtyFlag", {
-            /**
-             * Returns the dirty attributes flag value
-             */
-            get: function () {
-                return Material._AttributesDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Material, "MiscDirtyFlag", {
-            /**
-             * Returns the dirty misc flag value
-             */
-            get: function () {
-                return Material._MiscDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(Material.prototype, "alpha", {
             /**
              * Gets the alpha value of the material
@@ -35652,23 +35618,27 @@ var BABYLON;
         /**
          * The dirty texture flag value
          */
-        Material._TextureDirtyFlag = 1;
+        Material.TextureDirtyFlag = 1;
         /**
          * The dirty light flag value
          */
-        Material._LightDirtyFlag = 2;
+        Material.LightDirtyFlag = 2;
         /**
          * The dirty fresnel flag value
          */
-        Material._FresnelDirtyFlag = 4;
+        Material.FresnelDirtyFlag = 4;
         /**
          * The dirty attribute flag value
          */
-        Material._AttributesDirtyFlag = 8;
+        Material.AttributesDirtyFlag = 8;
         /**
          * The dirty misc flag value
          */
-        Material._MiscDirtyFlag = 16;
+        Material.MiscDirtyFlag = 16;
+        /**
+         * The all dirty flag value
+         */
+        Material.AllDirtyFlag = 31;
         __decorate([
             BABYLON.serialize()
         ], Material.prototype, "id", void 0);
@@ -41403,11 +41373,20 @@ var BABYLON;
          * @param scene The scene the lights belongs to
          * @param mesh The mesh we are binding the information to render
          * @param effect The effect we are binding the data to
+         * @param linearSpace Defines if the fog effect is applied in linear space
          */
-        MaterialHelper.BindFogParameters = function (scene, mesh, effect) {
+        MaterialHelper.BindFogParameters = function (scene, mesh, effect, linearSpace) {
+            if (linearSpace === void 0) { linearSpace = false; }
             if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== BABYLON.Scene.FOGMODE_NONE) {
                 effect.setFloat4("vFogInfos", scene.fogMode, scene.fogStart, scene.fogEnd, scene.fogDensity);
-                effect.setColor3("vFogColor", scene.fogColor);
+                // Convert fog color to linear space if used in a linear space computed shader.
+                if (linearSpace) {
+                    scene.fogColor.toLinearSpaceToRef(this._tempFogColor);
+                    effect.setColor3("vFogColor", this._tempFogColor);
+                }
+                else {
+                    effect.setColor3("vFogColor", scene.fogColor);
+                }
             }
         };
         /**
@@ -41475,6 +41454,7 @@ var BABYLON;
                 effect.setFloat4("vClipPlane4", clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d);
             }
         };
+        MaterialHelper._tempFogColor = BABYLON.Color3.Black();
         return MaterialHelper;
     }());
     BABYLON.MaterialHelper = MaterialHelper;
@@ -44833,7 +44813,7 @@ var BABYLON;
                     this.bindView(effect);
                 }
                 // Fog
-                BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect);
+                BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect, true);
                 // Morph targets
                 if (defines.NUM_MORPH_INFLUENCERS) {
                     BABYLON.MaterialHelper.BindMorphTargetParameters(mesh, this._activeEffect);
@@ -73685,7 +73665,7 @@ var BABYLON;
                 request = BABYLON.Tools.LoadFile(fileInfo.url, dataCallback, onProgress ? function (event) {
                     onProgress(SceneLoaderProgressEvent.FromProgressEvent(event));
                 } : undefined, database, useArrayBuffer, function (request, exception) {
-                    onError("Failed to load scene." + (exception ? "" : " " + exception.message), exception);
+                    onError("Failed to load scene." + (exception ? " " + exception.message : ""), exception);
                 });
             };
             if (directLoad) {
@@ -110984,7 +110964,7 @@ var BABYLON;
                 // View
                 this.bindView(effect);
                 // Fog
-                BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect);
+                BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect, true);
                 // image processing
                 if (this._imageProcessingConfiguration) {
                     this._imageProcessingConfiguration.bind(this._activeEffect);

+ 44 - 64
dist/preview release/babylon.no-module.max.js

@@ -11907,7 +11907,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "3.3.0-beta.5";
+                return "3.3.0-beta.6";
             },
             enumerable: true,
             configurable: true
@@ -24698,8 +24698,7 @@ var BABYLON;
                 return 1000.0 / 60.0; // frame time in ms
             };
             _this._tempPickingRay = BABYLON.Ray ? BABYLON.Ray.Zero() : null;
-            /** Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync) */
-            _this.blockMaterialDirtyMechanism = false;
+            _this._blockMaterialDirtyMechanism = false;
             _this._engine = engine || BABYLON.Engine.LastCreatedEngine;
             _this._engine.scenes.push(_this);
             _this._uid = null;
@@ -28631,13 +28630,30 @@ var BABYLON;
         Scene.prototype.getAutoClearDepthStencilSetup = function (index) {
             return this._renderingManager.getAutoClearDepthStencilSetup(index);
         };
+        Object.defineProperty(Scene.prototype, "blockMaterialDirtyMechanism", {
+            /** Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync) */
+            get: function () {
+                return this._blockMaterialDirtyMechanism;
+            },
+            set: function (value) {
+                if (this._blockMaterialDirtyMechanism === value) {
+                    return;
+                }
+                this._blockMaterialDirtyMechanism = value;
+                if (!value) { // Do a complete update
+                    this.markAllMaterialsAsDirty(BABYLON.Material.AllDirtyFlag);
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Will flag all materials as dirty to trigger new shader compilation
          * @param flag defines the flag used to specify which material part must be marked as dirty
          * @param predicate If not null, it will be used to specifiy if a material has to be marked as dirty
          */
         Scene.prototype.markAllMaterialsAsDirty = function (flag, predicate) {
-            if (this.blockMaterialDirtyMechanism) {
+            if (this._blockMaterialDirtyMechanism) {
                 return;
             }
             for (var _i = 0, _a = this.materials; _i < _a.length; _i++) {
@@ -34801,56 +34817,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Material, "TextureDirtyFlag", {
-            /**
-             * Returns the dirty texture flag value
-             */
-            get: function () {
-                return Material._TextureDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Material, "LightDirtyFlag", {
-            /**
-             * Returns the dirty light flag value
-             */
-            get: function () {
-                return Material._LightDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Material, "FresnelDirtyFlag", {
-            /**
-             * Returns the dirty fresnel flag value
-             */
-            get: function () {
-                return Material._FresnelDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Material, "AttributesDirtyFlag", {
-            /**
-             * Returns the dirty attributes flag value
-             */
-            get: function () {
-                return Material._AttributesDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Material, "MiscDirtyFlag", {
-            /**
-             * Returns the dirty misc flag value
-             */
-            get: function () {
-                return Material._MiscDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(Material.prototype, "alpha", {
             /**
              * Gets the alpha value of the material
@@ -35619,23 +35585,27 @@ var BABYLON;
         /**
          * The dirty texture flag value
          */
-        Material._TextureDirtyFlag = 1;
+        Material.TextureDirtyFlag = 1;
         /**
          * The dirty light flag value
          */
-        Material._LightDirtyFlag = 2;
+        Material.LightDirtyFlag = 2;
         /**
          * The dirty fresnel flag value
          */
-        Material._FresnelDirtyFlag = 4;
+        Material.FresnelDirtyFlag = 4;
         /**
          * The dirty attribute flag value
          */
-        Material._AttributesDirtyFlag = 8;
+        Material.AttributesDirtyFlag = 8;
         /**
          * The dirty misc flag value
          */
-        Material._MiscDirtyFlag = 16;
+        Material.MiscDirtyFlag = 16;
+        /**
+         * The all dirty flag value
+         */
+        Material.AllDirtyFlag = 31;
         __decorate([
             BABYLON.serialize()
         ], Material.prototype, "id", void 0);
@@ -41370,11 +41340,20 @@ var BABYLON;
          * @param scene The scene the lights belongs to
          * @param mesh The mesh we are binding the information to render
          * @param effect The effect we are binding the data to
+         * @param linearSpace Defines if the fog effect is applied in linear space
          */
-        MaterialHelper.BindFogParameters = function (scene, mesh, effect) {
+        MaterialHelper.BindFogParameters = function (scene, mesh, effect, linearSpace) {
+            if (linearSpace === void 0) { linearSpace = false; }
             if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== BABYLON.Scene.FOGMODE_NONE) {
                 effect.setFloat4("vFogInfos", scene.fogMode, scene.fogStart, scene.fogEnd, scene.fogDensity);
-                effect.setColor3("vFogColor", scene.fogColor);
+                // Convert fog color to linear space if used in a linear space computed shader.
+                if (linearSpace) {
+                    scene.fogColor.toLinearSpaceToRef(this._tempFogColor);
+                    effect.setColor3("vFogColor", this._tempFogColor);
+                }
+                else {
+                    effect.setColor3("vFogColor", scene.fogColor);
+                }
             }
         };
         /**
@@ -41442,6 +41421,7 @@ var BABYLON;
                 effect.setFloat4("vClipPlane4", clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d);
             }
         };
+        MaterialHelper._tempFogColor = BABYLON.Color3.Black();
         return MaterialHelper;
     }());
     BABYLON.MaterialHelper = MaterialHelper;
@@ -44800,7 +44780,7 @@ var BABYLON;
                     this.bindView(effect);
                 }
                 // Fog
-                BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect);
+                BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect, true);
                 // Morph targets
                 if (defines.NUM_MORPH_INFLUENCERS) {
                     BABYLON.MaterialHelper.BindMorphTargetParameters(mesh, this._activeEffect);
@@ -73652,7 +73632,7 @@ var BABYLON;
                 request = BABYLON.Tools.LoadFile(fileInfo.url, dataCallback, onProgress ? function (event) {
                     onProgress(SceneLoaderProgressEvent.FromProgressEvent(event));
                 } : undefined, database, useArrayBuffer, function (request, exception) {
-                    onError("Failed to load scene." + (exception ? "" : " " + exception.message), exception);
+                    onError("Failed to load scene." + (exception ? " " + exception.message : ""), exception);
                 });
             };
             if (directLoad) {
@@ -110951,7 +110931,7 @@ var BABYLON;
                 // View
                 this.bindView(effect);
                 // Fog
-                BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect);
+                BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect, true);
                 // image processing
                 if (this._imageProcessingConfiguration) {
                     this._imageProcessingConfiguration.bind(this._activeEffect);

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
dist/preview release/babylon.worker.js


+ 44 - 64
dist/preview release/es6.js

@@ -11907,7 +11907,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "3.3.0-beta.5";
+                return "3.3.0-beta.6";
             },
             enumerable: true,
             configurable: true
@@ -24698,8 +24698,7 @@ var BABYLON;
                 return 1000.0 / 60.0; // frame time in ms
             };
             _this._tempPickingRay = BABYLON.Ray ? BABYLON.Ray.Zero() : null;
-            /** Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync) */
-            _this.blockMaterialDirtyMechanism = false;
+            _this._blockMaterialDirtyMechanism = false;
             _this._engine = engine || BABYLON.Engine.LastCreatedEngine;
             _this._engine.scenes.push(_this);
             _this._uid = null;
@@ -28631,13 +28630,30 @@ var BABYLON;
         Scene.prototype.getAutoClearDepthStencilSetup = function (index) {
             return this._renderingManager.getAutoClearDepthStencilSetup(index);
         };
+        Object.defineProperty(Scene.prototype, "blockMaterialDirtyMechanism", {
+            /** Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync) */
+            get: function () {
+                return this._blockMaterialDirtyMechanism;
+            },
+            set: function (value) {
+                if (this._blockMaterialDirtyMechanism === value) {
+                    return;
+                }
+                this._blockMaterialDirtyMechanism = value;
+                if (!value) { // Do a complete update
+                    this.markAllMaterialsAsDirty(BABYLON.Material.AllDirtyFlag);
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Will flag all materials as dirty to trigger new shader compilation
          * @param flag defines the flag used to specify which material part must be marked as dirty
          * @param predicate If not null, it will be used to specifiy if a material has to be marked as dirty
          */
         Scene.prototype.markAllMaterialsAsDirty = function (flag, predicate) {
-            if (this.blockMaterialDirtyMechanism) {
+            if (this._blockMaterialDirtyMechanism) {
                 return;
             }
             for (var _i = 0, _a = this.materials; _i < _a.length; _i++) {
@@ -34801,56 +34817,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Material, "TextureDirtyFlag", {
-            /**
-             * Returns the dirty texture flag value
-             */
-            get: function () {
-                return Material._TextureDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Material, "LightDirtyFlag", {
-            /**
-             * Returns the dirty light flag value
-             */
-            get: function () {
-                return Material._LightDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Material, "FresnelDirtyFlag", {
-            /**
-             * Returns the dirty fresnel flag value
-             */
-            get: function () {
-                return Material._FresnelDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Material, "AttributesDirtyFlag", {
-            /**
-             * Returns the dirty attributes flag value
-             */
-            get: function () {
-                return Material._AttributesDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Material, "MiscDirtyFlag", {
-            /**
-             * Returns the dirty misc flag value
-             */
-            get: function () {
-                return Material._MiscDirtyFlag;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(Material.prototype, "alpha", {
             /**
              * Gets the alpha value of the material
@@ -35619,23 +35585,27 @@ var BABYLON;
         /**
          * The dirty texture flag value
          */
-        Material._TextureDirtyFlag = 1;
+        Material.TextureDirtyFlag = 1;
         /**
          * The dirty light flag value
          */
-        Material._LightDirtyFlag = 2;
+        Material.LightDirtyFlag = 2;
         /**
          * The dirty fresnel flag value
          */
-        Material._FresnelDirtyFlag = 4;
+        Material.FresnelDirtyFlag = 4;
         /**
          * The dirty attribute flag value
          */
-        Material._AttributesDirtyFlag = 8;
+        Material.AttributesDirtyFlag = 8;
         /**
          * The dirty misc flag value
          */
-        Material._MiscDirtyFlag = 16;
+        Material.MiscDirtyFlag = 16;
+        /**
+         * The all dirty flag value
+         */
+        Material.AllDirtyFlag = 31;
         __decorate([
             BABYLON.serialize()
         ], Material.prototype, "id", void 0);
@@ -41370,11 +41340,20 @@ var BABYLON;
          * @param scene The scene the lights belongs to
          * @param mesh The mesh we are binding the information to render
          * @param effect The effect we are binding the data to
+         * @param linearSpace Defines if the fog effect is applied in linear space
          */
-        MaterialHelper.BindFogParameters = function (scene, mesh, effect) {
+        MaterialHelper.BindFogParameters = function (scene, mesh, effect, linearSpace) {
+            if (linearSpace === void 0) { linearSpace = false; }
             if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== BABYLON.Scene.FOGMODE_NONE) {
                 effect.setFloat4("vFogInfos", scene.fogMode, scene.fogStart, scene.fogEnd, scene.fogDensity);
-                effect.setColor3("vFogColor", scene.fogColor);
+                // Convert fog color to linear space if used in a linear space computed shader.
+                if (linearSpace) {
+                    scene.fogColor.toLinearSpaceToRef(this._tempFogColor);
+                    effect.setColor3("vFogColor", this._tempFogColor);
+                }
+                else {
+                    effect.setColor3("vFogColor", scene.fogColor);
+                }
             }
         };
         /**
@@ -41442,6 +41421,7 @@ var BABYLON;
                 effect.setFloat4("vClipPlane4", clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d);
             }
         };
+        MaterialHelper._tempFogColor = BABYLON.Color3.Black();
         return MaterialHelper;
     }());
     BABYLON.MaterialHelper = MaterialHelper;
@@ -44800,7 +44780,7 @@ var BABYLON;
                     this.bindView(effect);
                 }
                 // Fog
-                BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect);
+                BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect, true);
                 // Morph targets
                 if (defines.NUM_MORPH_INFLUENCERS) {
                     BABYLON.MaterialHelper.BindMorphTargetParameters(mesh, this._activeEffect);
@@ -73652,7 +73632,7 @@ var BABYLON;
                 request = BABYLON.Tools.LoadFile(fileInfo.url, dataCallback, onProgress ? function (event) {
                     onProgress(SceneLoaderProgressEvent.FromProgressEvent(event));
                 } : undefined, database, useArrayBuffer, function (request, exception) {
-                    onError("Failed to load scene." + (exception ? "" : " " + exception.message), exception);
+                    onError("Failed to load scene." + (exception ? " " + exception.message : ""), exception);
                 });
             };
             if (directLoad) {
@@ -110951,7 +110931,7 @@ var BABYLON;
                 // View
                 this.bindView(effect);
                 // Fog
-                BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect);
+                BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect, true);
                 // image processing
                 if (this._imageProcessingConfiguration) {
                     this._imageProcessingConfiguration.bind(this._activeEffect);

+ 1 - 1
dist/preview release/glTF2Interface/package.json

@@ -1,7 +1,7 @@
 {
     "name": "babylonjs-gltf2interface",
     "description": "A typescript declaration of babylon's gltf2 inteface.",
-    "version": "3.3.0-beta.5",
+    "version": "3.3.0-beta.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 1
dist/preview release/gui/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-gui",
     "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
-    "version": "3.3.0-beta.5",
+    "version": "3.3.0-beta.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 1
dist/preview release/inspector/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "3.3.0-beta.5",
+    "version": "3.3.0-beta.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 2 - 2
dist/preview release/loaders/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-loaders",
     "description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
-    "version": "3.3.0-beta.5",
+    "version": "3.3.0-beta.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "3.3.0-beta.5"
+        "babylonjs-gltf2interface": "3.3.0-beta.6"
     },
     "peerDependencies": {
         "babylonjs": ">=3.2.0-alpha"

+ 1 - 1
dist/preview release/materialsLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-materials",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0-beta.5",
+    "version": "3.3.0-beta.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 1
dist/preview release/postProcessesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-post-process",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0-beta.5",
+    "version": "3.3.0-beta.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 1
dist/preview release/proceduralTexturesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-procedural-textures",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0-beta.5",
+    "version": "3.3.0-beta.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 2 - 2
dist/preview release/serializers/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-serializers",
     "description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.",
-    "version": "3.3.0-beta.5",
+    "version": "3.3.0-beta.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "3.3.0-beta.5"
+        "babylonjs-gltf2interface": "3.3.0-beta.6"
     },
     "peerDependencies": {
         "babylonjs": ">=3.2.0-alpha"

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

@@ -168,11 +168,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)
                 *
@@ -189,11 +189,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;
     }
@@ -924,7 +924,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 {
@@ -1558,6 +1558,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 {
 }
 declare module BabylonViewer {
     export interface IEnvironmentMapConfiguration {

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


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

@@ -200,11 +200,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)
                 *
@@ -221,11 +221,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;
     }
@@ -985,13 +985,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;
 }
 
@@ -1662,6 +1663,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';

+ 1 - 1
package.json

@@ -9,7 +9,7 @@
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "3.3.0-beta.5",
+    "version": "3.3.0-beta.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 1
src/Engine/babylon.engine.ts

@@ -475,7 +475,7 @@
          * Returns the current version of the framework
          */
         public static get Version(): string {
-            return "3.3.0-beta.5";
+            return "3.3.0-beta.6";
         }
 
         // Updatable statics so stick with vars here

+ 7 - 37
src/Materials/babylon.material.ts

@@ -331,62 +331,32 @@
         /**
          * The dirty texture flag value
          */
-        private static _TextureDirtyFlag = 1;
+        public static readonly TextureDirtyFlag = 1;
 
         /**
          * The dirty light flag value
          */
-        private static _LightDirtyFlag = 2;
+        public static readonly LightDirtyFlag = 2;
 
         /**
          * The dirty fresnel flag value
          */
-        private static _FresnelDirtyFlag = 4;
+        public static readonly FresnelDirtyFlag = 4;
 
         /**
          * The dirty attribute flag value
          */
-        private static _AttributesDirtyFlag = 8;
+        public static readonly AttributesDirtyFlag = 8;
 
         /**
          * The dirty misc flag value
          */
-        private static _MiscDirtyFlag = 16;
+        public static readonly MiscDirtyFlag = 16;
 
         /**
-         * Returns the dirty texture flag value
+         * The all dirty flag value
          */
-        public static get TextureDirtyFlag(): number {
-            return Material._TextureDirtyFlag;
-        }
-
-        /**
-         * Returns the dirty light flag value
-         */
-        public static get LightDirtyFlag(): number {
-            return Material._LightDirtyFlag;
-        }
-
-        /**
-         * Returns the dirty fresnel flag value
-         */
-        public static get FresnelDirtyFlag(): number {
-            return Material._FresnelDirtyFlag;
-        }
-
-        /**
-         * Returns the dirty attributes flag value
-         */
-        public static get AttributesDirtyFlag(): number {
-            return Material._AttributesDirtyFlag;
-        }
-
-        /**
-         * Returns the dirty misc flag value
-         */
-        public static get MiscDirtyFlag(): number {
-            return Material._MiscDirtyFlag;
-        }
+        public static readonly AllDirtyFlag = 31;
 
         /**
          * The ID of the material

+ 18 - 2
src/babylon.scene.ts

@@ -5232,8 +5232,24 @@
             return this._renderingManager.getAutoClearDepthStencilSetup(index);
         }
 
+        private _blockMaterialDirtyMechanism = false;
+
         /** Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync) */
-        public blockMaterialDirtyMechanism = false;
+        public get blockMaterialDirtyMechanism(): boolean {
+            return this._blockMaterialDirtyMechanism;
+        }
+
+        public set blockMaterialDirtyMechanism(value: boolean) {
+            if (this._blockMaterialDirtyMechanism === value) {
+                return;
+            }
+
+            this._blockMaterialDirtyMechanism = value;
+
+            if (!value) { // Do a complete update
+                this.markAllMaterialsAsDirty(Material.AllDirtyFlag);
+            }
+        }
 
         /**
          * Will flag all materials as dirty to trigger new shader compilation
@@ -5241,7 +5257,7 @@
          * @param predicate If not null, it will be used to specifiy if a material has to be marked as dirty
          */
         public markAllMaterialsAsDirty(flag: number, predicate?: (mat: Material) => boolean): void {
-            if (this.blockMaterialDirtyMechanism) {
+            if (this._blockMaterialDirtyMechanism) {
                 return;
             }