sebavan 6 лет назад
Родитель
Сommit
139a26c43c

Разница между файлами не показана из-за своего большого размера
+ 8571 - 60207
Playground/babylon.d.txt


+ 7 - 3
Viewer/src/model/viewerModel.ts

@@ -197,7 +197,11 @@ export class ViewerModel implements IDisposable {
         if (!mesh.parent) {
             mesh.parent = this._pivotMesh;
         }
-        mesh.receiveShadows = !!this.configuration.receiveShadows;
+
+        if (mesh.getClassName() !== "InstancedMesh") {
+            mesh.receiveShadows = !!this.configuration.receiveShadows;
+        }
+
         this._meshes.push(mesh);
         if (triggerLoaded) {
             return this.onLoadedObservable.notifyObserversWithPromise(this);
@@ -558,7 +562,7 @@ export class ViewerModel implements IDisposable {
                 material.disableLighting = !this._modelConfiguration.material.directEnabled;
             }
             if (this._configurationContainer && this._configurationContainer.reflectionColor) {
-                material.reflectionColor = this._configurationContainer.reflectionColor;
+                material.reflectionColor = this._configurationContainer.reflectionColor.clone();
             }
         }
         else if (material instanceof MultiMaterial) {
@@ -763,4 +767,4 @@ export class ViewerModel implements IDisposable {
         this._animations.length = 0;
         this.rootMesh.dispose(false, true);
     }
-}
+}

Разница между файлами не показана из-за своего большого размера
+ 10474 - 10469
dist/preview release/babylon.d.ts


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/babylon.js


+ 71 - 56
dist/preview release/babylon.max.js

@@ -3943,7 +3943,6 @@ var BABYLON;
             convertedColor.b = Math.pow(this.b, BABYLON.ToGammaSpace);
             return this;
         };
-        // Statics
         /**
          * Creates a new Color3 from the string containing valid hexadecimal values
          * @param hex defines a string containing valid hexadecimal values
@@ -4022,6 +4021,16 @@ var BABYLON;
          * @returns a new Color3 object
          */
         Color3.Black = function () { return new Color3(0, 0, 0); };
+        Object.defineProperty(Color3, "BlackReadOnly", {
+            /**
+              * Gets a Color3 value containing a black color that must not be updated
+              */
+            get: function () {
+                return Color3._BlackReadOnly;
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Returns a Color3 value containing a white color
          * @returns a new Color3 object
@@ -4057,6 +4066,8 @@ var BABYLON;
          * @returns a new Color3 object
          */
         Color3.Random = function () { return new Color3(Math.random(), Math.random(), Math.random()); };
+        // Statics
+        Color3._BlackReadOnly = Color3.Black();
         return Color3;
     }());
     BABYLON.Color3 = Color3;
@@ -12974,7 +12985,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "4.0.0-alpha.12";
+                return "4.0.0-alpha.14";
             },
             enumerable: true,
             configurable: true
@@ -45132,7 +45143,7 @@ var BABYLON;
                     if (defines.SPECULARTERM) {
                         this._uniformBuffer.updateColor4("vSpecularColor", this.specularColor, this.specularPower);
                     }
-                    this._uniformBuffer.updateColor3("vEmissiveColor", this.emissiveColor);
+                    this._uniformBuffer.updateColor3("vEmissiveColor", StandardMaterial.EmissiveTextureEnabled ? this.emissiveColor : BABYLON.Color3.BlackReadOnly);
                     // Diffuse
                     this._uniformBuffer.updateColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);
                 }
@@ -47505,7 +47516,7 @@ var BABYLON;
                     else {
                         this._uniformBuffer.updateColor4("vReflectivityColor", this._reflectivityColor, this._microSurface);
                     }
-                    this._uniformBuffer.updateColor3("vEmissiveColor", this._emissiveColor);
+                    this._uniformBuffer.updateColor3("vEmissiveColor", BABYLON.StandardMaterial.EmissiveTextureEnabled ? this._emissiveColor : BABYLON.Color3.BlackReadOnly);
                     this._uniformBuffer.updateColor3("vReflectionColor", this._reflectionColor);
                     this._uniformBuffer.updateColor4("vAlbedoColor", this._albedoColor, this.alpha * mesh.visibility);
                     // Misc
@@ -49834,31 +49845,33 @@ var BABYLON;
             });
             this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function (info) {
                 var evt = info.event;
-                if (info.type === BABYLON.KeyboardEventTypes.KEYDOWN) {
-                    if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
-                        _this.keysDown.indexOf(evt.keyCode) !== -1 ||
-                        _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
-                        _this.keysRight.indexOf(evt.keyCode) !== -1) {
-                        var index = _this._keys.indexOf(evt.keyCode);
-                        if (index === -1) {
-                            _this._keys.push(evt.keyCode);
-                        }
-                        if (!noPreventDefault) {
-                            evt.preventDefault();
+                if (!evt.metaKey) {
+                    if (info.type === BABYLON.KeyboardEventTypes.KEYDOWN) {
+                        if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
+                            _this.keysDown.indexOf(evt.keyCode) !== -1 ||
+                            _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
+                            _this.keysRight.indexOf(evt.keyCode) !== -1) {
+                            var index = _this._keys.indexOf(evt.keyCode);
+                            if (index === -1) {
+                                _this._keys.push(evt.keyCode);
+                            }
+                            if (!noPreventDefault) {
+                                evt.preventDefault();
+                            }
                         }
                     }
-                }
-                else {
-                    if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
-                        _this.keysDown.indexOf(evt.keyCode) !== -1 ||
-                        _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
-                        _this.keysRight.indexOf(evt.keyCode) !== -1) {
-                        var index = _this._keys.indexOf(evt.keyCode);
-                        if (index >= 0) {
-                            _this._keys.splice(index, 1);
-                        }
-                        if (!noPreventDefault) {
-                            evt.preventDefault();
+                    else {
+                        if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
+                            _this.keysDown.indexOf(evt.keyCode) !== -1 ||
+                            _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
+                            _this.keysRight.indexOf(evt.keyCode) !== -1) {
+                            var index = _this._keys.indexOf(evt.keyCode);
+                            if (index >= 0) {
+                                _this._keys.splice(index, 1);
+                            }
+                            if (!noPreventDefault) {
+                                evt.preventDefault();
+                            }
                         }
                     }
                 }
@@ -51252,38 +51265,40 @@ var BABYLON;
             });
             this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function (info) {
                 var evt = info.event;
-                if (info.type === BABYLON.KeyboardEventTypes.KEYDOWN) {
-                    _this._ctrlPressed = evt.ctrlKey;
-                    _this._altPressed = evt.altKey;
-                    if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
-                        _this.keysDown.indexOf(evt.keyCode) !== -1 ||
-                        _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
-                        _this.keysRight.indexOf(evt.keyCode) !== -1 ||
-                        _this.keysReset.indexOf(evt.keyCode) !== -1) {
-                        var index = _this._keys.indexOf(evt.keyCode);
-                        if (index === -1) {
-                            _this._keys.push(evt.keyCode);
-                        }
-                        if (evt.preventDefault) {
-                            if (!noPreventDefault) {
-                                evt.preventDefault();
+                if (!evt.metaKey) {
+                    if (info.type === BABYLON.KeyboardEventTypes.KEYDOWN) {
+                        _this._ctrlPressed = evt.ctrlKey;
+                        _this._altPressed = evt.altKey;
+                        if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
+                            _this.keysDown.indexOf(evt.keyCode) !== -1 ||
+                            _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
+                            _this.keysRight.indexOf(evt.keyCode) !== -1 ||
+                            _this.keysReset.indexOf(evt.keyCode) !== -1) {
+                            var index = _this._keys.indexOf(evt.keyCode);
+                            if (index === -1) {
+                                _this._keys.push(evt.keyCode);
+                            }
+                            if (evt.preventDefault) {
+                                if (!noPreventDefault) {
+                                    evt.preventDefault();
+                                }
                             }
                         }
                     }
-                }
-                else {
-                    if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
-                        _this.keysDown.indexOf(evt.keyCode) !== -1 ||
-                        _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
-                        _this.keysRight.indexOf(evt.keyCode) !== -1 ||
-                        _this.keysReset.indexOf(evt.keyCode) !== -1) {
-                        var index = _this._keys.indexOf(evt.keyCode);
-                        if (index >= 0) {
-                            _this._keys.splice(index, 1);
-                        }
-                        if (evt.preventDefault) {
-                            if (!noPreventDefault) {
-                                evt.preventDefault();
+                    else {
+                        if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
+                            _this.keysDown.indexOf(evt.keyCode) !== -1 ||
+                            _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
+                            _this.keysRight.indexOf(evt.keyCode) !== -1 ||
+                            _this.keysReset.indexOf(evt.keyCode) !== -1) {
+                            var index = _this._keys.indexOf(evt.keyCode);
+                            if (index >= 0) {
+                                _this._keys.splice(index, 1);
+                            }
+                            if (evt.preventDefault) {
+                                if (!noPreventDefault) {
+                                    evt.preventDefault();
+                                }
                             }
                         }
                     }

+ 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": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/gui/babylon.gui.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


+ 2 - 2
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": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.12"
+        "babylonjs": "4.0.0-alpha.14"
     },
     "engines": {
         "node": "*"

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

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -29,10 +29,10 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.12",
-        "babylonjs-gui": "4.0.0-alpha.12",
-        "babylonjs-loaders": "4.0.0-alpha.12",
-        "babylonjs-serializers": "4.0.0-alpha.12"
+        "babylonjs": "4.0.0-alpha.14",
+        "babylonjs-gui": "4.0.0-alpha.14",
+        "babylonjs-loaders": "4.0.0-alpha.14",
+        "babylonjs-serializers": "4.0.0-alpha.14"
     },
     "engines": {
         "node": "*"

+ 3 - 3
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": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,8 +28,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "4.0.0-alpha.12",
-        "babylonjs": "4.0.0-alpha.12"
+        "babylonjs-gltf2interface": "4.0.0-alpha.14",
+        "babylonjs": "4.0.0-alpha.14"
     },
     "engines": {
         "node": "*"

+ 2 - 2
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": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.12"
+        "babylonjs": "4.0.0-alpha.14"
     },
     "engines": {
         "node": "*"

+ 2 - 2
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": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.12"
+        "babylonjs": "4.0.0-alpha.14"
     },
     "engines": {
         "node": "*"

+ 2 - 2
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": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.12"
+        "babylonjs": "4.0.0-alpha.14"
     },
     "engines": {
         "node": "*"

+ 3 - 3
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": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,8 +28,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.12",
-        "babylonjs-gltf2interface": "4.0.0-alpha.12"
+        "babylonjs": "4.0.0-alpha.14",
+        "babylonjs-gltf2interface": "4.0.0-alpha.14"
     },
     "engines": {
         "node": "*"

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


Разница между файлами не показана из-за своего большого размера
+ 2 - 2
dist/preview release/viewer/babylon.viewer.max.js


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

@@ -127,6 +127,8 @@
 - SixDofDragBehavior will support when the camera is parented ([TrevorDev](https://github.com/TrevorDev))
 - Deactivate webvr lasers when not in vr ([TrevorDev](https://github.com/TrevorDev))
 - Update physics position using absolutePosition instead of pivotPosition ([TrevorDev](https://github.com/TrevorDev))
+- Disable camera arrow key controls when the Command key is selected on Mac OS ([kcoley](https://github.com/kcoley))
+- Viewer should not set receiveShadows on an instanced mesh ([TrevorDev](https://github.com/TrevorDev))
 
 ### Core Engine
 - Fixed a bug with `mesh.alwaysSelectAsActiveMesh` preventing layerMask to be taken in account ([Deltakosh](https://github.com/deltakosh))

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

@@ -414,8 +414,8 @@ export class Container extends Control {
     public dispose() {
         super.dispose();
 
-        for (var control of this._children) {
-            control.dispose();
+        for (var index = this.children.length - 1; index >= 0; index--) {
+            this.children[index].dispose();
         }
     }
 }

+ 3 - 0
gui/src/2D/controls/grid.ts

@@ -291,6 +291,7 @@ export class Grid extends Container {
         goodContainer.addControl(control);
         this._childControls.push(control);
         control._tag = key;
+        control.parent = this;
 
         this._markAsDirty();
 
@@ -467,5 +468,7 @@ export class Grid extends Container {
         for (var control of this._childControls) {
             control.dispose();
         }
+
+        this._childControls = [];
     }
 }

+ 1 - 1
package.json

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

+ 34 - 33
src/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.ts

@@ -102,44 +102,45 @@ import { KeyboardInfo, KeyboardEventTypes } from "../../Events/keyboardEvents";
 
             this._onKeyboardObserver = this._scene.onKeyboardObservable.add((info) => {
                 let evt = info.event;
+                if (!evt.metaKey) {
+                    if (info.type === KeyboardEventTypes.KEYDOWN) {
+                        this._ctrlPressed = evt.ctrlKey;
+                        this._altPressed = evt.altKey;
+
+                        if (this.keysUp.indexOf(evt.keyCode) !== -1 ||
+                            this.keysDown.indexOf(evt.keyCode) !== -1 ||
+                            this.keysLeft.indexOf(evt.keyCode) !== -1 ||
+                            this.keysRight.indexOf(evt.keyCode) !== -1 ||
+                            this.keysReset.indexOf(evt.keyCode) !== -1) {
+                            var index = this._keys.indexOf(evt.keyCode);
+
+                            if (index === -1) {
+                                this._keys.push(evt.keyCode);
+                            }
 
-                if (info.type === KeyboardEventTypes.KEYDOWN) {
-                    this._ctrlPressed = evt.ctrlKey;
-                    this._altPressed = evt.altKey;
-
-                    if (this.keysUp.indexOf(evt.keyCode) !== -1 ||
-                        this.keysDown.indexOf(evt.keyCode) !== -1 ||
-                        this.keysLeft.indexOf(evt.keyCode) !== -1 ||
-                        this.keysRight.indexOf(evt.keyCode) !== -1 ||
-                        this.keysReset.indexOf(evt.keyCode) !== -1) {
-                        var index = this._keys.indexOf(evt.keyCode);
-
-                        if (index === -1) {
-                            this._keys.push(evt.keyCode);
-                        }
-
-                        if (evt.preventDefault) {
-                            if (!noPreventDefault) {
-                                evt.preventDefault();
+                            if (evt.preventDefault) {
+                                if (!noPreventDefault) {
+                                    evt.preventDefault();
+                                }
                             }
                         }
                     }
-                }
-                else {
-                    if (this.keysUp.indexOf(evt.keyCode) !== -1 ||
-                        this.keysDown.indexOf(evt.keyCode) !== -1 ||
-                        this.keysLeft.indexOf(evt.keyCode) !== -1 ||
-                        this.keysRight.indexOf(evt.keyCode) !== -1 ||
-                        this.keysReset.indexOf(evt.keyCode) !== -1) {
-                        var index = this._keys.indexOf(evt.keyCode);
-
-                        if (index >= 0) {
-                            this._keys.splice(index, 1);
-                        }
+                    else {
+                        if (this.keysUp.indexOf(evt.keyCode) !== -1 ||
+                            this.keysDown.indexOf(evt.keyCode) !== -1 ||
+                            this.keysLeft.indexOf(evt.keyCode) !== -1 ||
+                            this.keysRight.indexOf(evt.keyCode) !== -1 ||
+                            this.keysReset.indexOf(evt.keyCode) !== -1) {
+                            var index = this._keys.indexOf(evt.keyCode);
+
+                            if (index >= 0) {
+                                this._keys.splice(index, 1);
+                            }
 
-                        if (evt.preventDefault) {
-                            if (!noPreventDefault) {
-                                evt.preventDefault();
+                            if (evt.preventDefault) {
+                                if (!noPreventDefault) {
+                                    evt.preventDefault();
+                                }
                             }
                         }
                     }

+ 27 - 26
src/Cameras/Inputs/freeCameraKeyboardMoveInput.ts

@@ -66,33 +66,34 @@ import { Engine } from "../../Engines/engine";
 
             this._onKeyboardObserver = this._scene.onKeyboardObservable.add((info) => {
                 let evt = info.event;
-
-                if (info.type === KeyboardEventTypes.KEYDOWN) {
-                    if (this.keysUp.indexOf(evt.keyCode) !== -1 ||
-                        this.keysDown.indexOf(evt.keyCode) !== -1 ||
-                        this.keysLeft.indexOf(evt.keyCode) !== -1 ||
-                        this.keysRight.indexOf(evt.keyCode) !== -1) {
-                        var index = this._keys.indexOf(evt.keyCode);
-
-                        if (index === -1) {
-                            this._keys.push(evt.keyCode);
-                        }
-                        if (!noPreventDefault) {
-                            evt.preventDefault();
-                        }
-                    }
-                } else {
-                    if (this.keysUp.indexOf(evt.keyCode) !== -1 ||
-                        this.keysDown.indexOf(evt.keyCode) !== -1 ||
-                        this.keysLeft.indexOf(evt.keyCode) !== -1 ||
-                        this.keysRight.indexOf(evt.keyCode) !== -1) {
-                        var index = this._keys.indexOf(evt.keyCode);
-
-                        if (index >= 0) {
-                            this._keys.splice(index, 1);
+                if (!evt.metaKey) {
+                    if (info.type === KeyboardEventTypes.KEYDOWN) {
+                        if (this.keysUp.indexOf(evt.keyCode) !== -1 ||
+                            this.keysDown.indexOf(evt.keyCode) !== -1 ||
+                            this.keysLeft.indexOf(evt.keyCode) !== -1 ||
+                            this.keysRight.indexOf(evt.keyCode) !== -1) {
+                            var index = this._keys.indexOf(evt.keyCode);
+
+                            if (index === -1) {
+                                this._keys.push(evt.keyCode);
+                            }
+                            if (!noPreventDefault) {
+                                evt.preventDefault();
+                            }
                         }
-                        if (!noPreventDefault) {
-                            evt.preventDefault();
+                    } else {
+                        if (this.keysUp.indexOf(evt.keyCode) !== -1 ||
+                            this.keysDown.indexOf(evt.keyCode) !== -1 ||
+                            this.keysLeft.indexOf(evt.keyCode) !== -1 ||
+                            this.keysRight.indexOf(evt.keyCode) !== -1) {
+                            var index = this._keys.indexOf(evt.keyCode);
+
+                            if (index >= 0) {
+                                this._keys.splice(index, 1);
+                            }
+                            if (!noPreventDefault) {
+                                evt.preventDefault();
+                            }
                         }
                     }
                 }

+ 1 - 1
src/Engines/engine.ts

@@ -516,7 +516,7 @@ declare type RenderTargetTexture = import("Materials/Textures/renderTargetTextur
          * Returns the current version of the framework
          */
         public static get Version(): string {
-            return "4.0.0-alpha.12";
+            return "4.0.0-alpha.14";
         }
 
         /**

+ 1 - 1
src/Materials/PBR/pbrBaseMaterial.ts

@@ -1640,7 +1640,7 @@ import "../../Shaders/pbr.vertex";
                         this._uniformBuffer.updateColor4("vReflectivityColor", this._reflectivityColor, this._microSurface);
                     }
 
-                    this._uniformBuffer.updateColor3("vEmissiveColor", this._emissiveColor);
+                    this._uniformBuffer.updateColor3("vEmissiveColor", StandardMaterial.EmissiveTextureEnabled ? this._emissiveColor : Color3.BlackReadOnly);
                     this._uniformBuffer.updateColor3("vReflectionColor", this._reflectionColor);
                     this._uniformBuffer.updateColor4("vAlbedoColor", this._albedoColor, this.alpha * mesh.visibility);
 

+ 1 - 1
src/Materials/standardMaterial.ts

@@ -1392,7 +1392,7 @@ import { Constants } from "../Engines/constants";
                     if (defines.SPECULARTERM) {
                         this._uniformBuffer.updateColor4("vSpecularColor", this.specularColor, this.specularPower);
                     }
-                    this._uniformBuffer.updateColor3("vEmissiveColor", this.emissiveColor);
+                    this._uniformBuffer.updateColor3("vEmissiveColor", StandardMaterial.EmissiveTextureEnabled ? this.emissiveColor : Color3.BlackReadOnly);
 
                     // Diffuse
                     this._uniformBuffer.updateColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);

+ 10 - 0
src/Maths/math.ts

@@ -350,6 +350,8 @@ import { Scalar } from "./math.scalar";
 
         // Statics
 
+        private static _BlackReadOnly = Color3.Black() as DeepImmutable<Color3>;
+
         /**
          * Creates a new Color3 from the string containing valid hexadecimal values
          * @param hex defines a string containing valid hexadecimal values
@@ -434,6 +436,14 @@ import { Scalar } from "./math.scalar";
          * @returns a new Color3 object
          */
         public static Black(): Color3 { return new Color3(0, 0, 0); }
+
+        /**
+          * Gets a Color3 value containing a black color that must not be updated
+          */
+        public static get BlackReadOnly(): DeepImmutable<Color3> {
+            return Color3._BlackReadOnly;
+        }
+
         /**
          * Returns a Color3 value containing a white color
          * @returns a new Color3 object