Prechádzať zdrojové kódy

Merge remote-tracking branch 'upstream/master' into LinesMeshIntersection

Julien Barrois 6 rokov pred
rodič
commit
4b69c3cf89

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 4494 - 4480
Playground/babylon.d.txt


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 4462 - 4456
dist/preview release/babylon.d.ts


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/babylon.js


+ 33 - 12
dist/preview release/babylon.max.js

@@ -7437,6 +7437,8 @@ var BABYLON;
         function Matrix() {
             this._isIdentity = false;
             this._isIdentityDirty = true;
+            this._isIdentity3x2 = true;
+            this._isIdentity3x2Dirty = true;
             /**
              * Gets or sets the internal data of the matrix
              */
@@ -7447,18 +7449,17 @@ var BABYLON;
         Matrix.prototype._markAsUpdated = function () {
             this.updateFlag = Matrix._updateFlagSeed++;
             this._isIdentityDirty = true;
+            this._isIdentity3x2Dirty = true;
         };
         // Properties
         /**
-         * Check if the current matrix is indentity
-         * @param considerAsTextureMatrix defines if the current matrix must be considered as a texture matrix (3x2)
+         * Check if the current matrix is identity
          * @returns true is the matrix is the identity matrix
          */
-        Matrix.prototype.isIdentity = function (considerAsTextureMatrix) {
-            if (considerAsTextureMatrix === void 0) { considerAsTextureMatrix = false; }
+        Matrix.prototype.isIdentity = function () {
             if (this._isIdentityDirty) {
                 this._isIdentityDirty = false;
-                if (this.m[0] !== 1.0 || this.m[5] !== 1.0 || this.m[15] !== 1.0) {
+                if (this.m[0] !== 1.0 || this.m[5] !== 1.0 || this.m[10] !== 1.0 || this.m[15] !== 1.0) {
                     this._isIdentity = false;
                 }
                 else if (this.m[1] !== 0.0 || this.m[2] !== 0.0 || this.m[3] !== 0.0 ||
@@ -7470,13 +7471,32 @@ var BABYLON;
                 else {
                     this._isIdentity = true;
                 }
-                if (!considerAsTextureMatrix && this.m[10] !== 1.0) {
-                    this._isIdentity = false;
-                }
             }
             return this._isIdentity;
         };
         /**
+         * Check if the current matrix is identity as a texture matrix (3x2 store in 4x4)
+         * @returns true is the matrix is the identity matrix
+         */
+        Matrix.prototype.isIdentityAs3x2 = function () {
+            if (this._isIdentity3x2Dirty) {
+                this._isIdentity3x2Dirty = false;
+                if (this.m[0] !== 1.0 || this.m[5] !== 1.0 || this.m[15] !== 1.0) {
+                    this._isIdentity3x2 = false;
+                }
+                else if (this.m[1] !== 0.0 || this.m[2] !== 0.0 || this.m[3] !== 0.0 ||
+                    this.m[4] !== 0.0 || this.m[6] !== 0.0 || this.m[7] !== 0.0 ||
+                    this.m[8] !== 0.0 || this.m[9] !== 0.0 || this.m[10] !== 0.0 || this.m[11] !== 0.0 ||
+                    this.m[12] !== 0.0 || this.m[13] !== 0.0 || this.m[14] !== 0.0) {
+                    this._isIdentity3x2 = false;
+                }
+                else {
+                    this._isIdentity3x2 = true;
+                }
+            }
+            return this._isIdentity3x2;
+        };
+        /**
          * Gets the determinant of the matrix
          * @returns the matrix determinant
          */
@@ -42835,7 +42855,7 @@ var BABYLON;
         MaterialHelper.PrepareDefinesForMergedUV = function (texture, defines, key) {
             defines._needUVs = true;
             defines[key] = true;
-            if (texture.getTextureMatrix().isIdentity(true)) {
+            if (texture.getTextureMatrix().isIdentityAs3x2()) {
                 defines[key + "DIRECTUV"] = texture.coordinatesIndex + 1;
                 if (texture.coordinatesIndex === 0) {
                     defines["MAINUV1"] = true;
@@ -42856,7 +42876,7 @@ var BABYLON;
          */
         MaterialHelper.BindTextureMatrix = function (texture, uniformBuffer, key) {
             var matrix = texture.getTextureMatrix();
-            if (!matrix.isIdentity(true)) {
+            if (!matrix.isIdentityAs3x2()) {
                 uniformBuffer.updateMatrix(key + "Matrix", matrix);
             }
         };
@@ -50761,8 +50781,9 @@ var BABYLON;
                         delta = event.wheelDelta / (_this.wheelPrecision * 40);
                     }
                 }
-                else if (event.detail || event.deltaY) {
-                    delta = -(event.detail || event.deltaY) / _this.wheelPrecision;
+                else {
+                    var deltaValue = event.deltaY || event.detail;
+                    delta = -deltaValue / _this.wheelPrecision;
                 }
                 if (delta) {
                     _this.camera.inertialRadiusOffset += delta;

+ 33 - 12
dist/preview release/babylon.no-module.max.js

@@ -7404,6 +7404,8 @@ var BABYLON;
         function Matrix() {
             this._isIdentity = false;
             this._isIdentityDirty = true;
+            this._isIdentity3x2 = true;
+            this._isIdentity3x2Dirty = true;
             /**
              * Gets or sets the internal data of the matrix
              */
@@ -7414,18 +7416,17 @@ var BABYLON;
         Matrix.prototype._markAsUpdated = function () {
             this.updateFlag = Matrix._updateFlagSeed++;
             this._isIdentityDirty = true;
+            this._isIdentity3x2Dirty = true;
         };
         // Properties
         /**
-         * Check if the current matrix is indentity
-         * @param considerAsTextureMatrix defines if the current matrix must be considered as a texture matrix (3x2)
+         * Check if the current matrix is identity
          * @returns true is the matrix is the identity matrix
          */
-        Matrix.prototype.isIdentity = function (considerAsTextureMatrix) {
-            if (considerAsTextureMatrix === void 0) { considerAsTextureMatrix = false; }
+        Matrix.prototype.isIdentity = function () {
             if (this._isIdentityDirty) {
                 this._isIdentityDirty = false;
-                if (this.m[0] !== 1.0 || this.m[5] !== 1.0 || this.m[15] !== 1.0) {
+                if (this.m[0] !== 1.0 || this.m[5] !== 1.0 || this.m[10] !== 1.0 || this.m[15] !== 1.0) {
                     this._isIdentity = false;
                 }
                 else if (this.m[1] !== 0.0 || this.m[2] !== 0.0 || this.m[3] !== 0.0 ||
@@ -7437,13 +7438,32 @@ var BABYLON;
                 else {
                     this._isIdentity = true;
                 }
-                if (!considerAsTextureMatrix && this.m[10] !== 1.0) {
-                    this._isIdentity = false;
-                }
             }
             return this._isIdentity;
         };
         /**
+         * Check if the current matrix is identity as a texture matrix (3x2 store in 4x4)
+         * @returns true is the matrix is the identity matrix
+         */
+        Matrix.prototype.isIdentityAs3x2 = function () {
+            if (this._isIdentity3x2Dirty) {
+                this._isIdentity3x2Dirty = false;
+                if (this.m[0] !== 1.0 || this.m[5] !== 1.0 || this.m[15] !== 1.0) {
+                    this._isIdentity3x2 = false;
+                }
+                else if (this.m[1] !== 0.0 || this.m[2] !== 0.0 || this.m[3] !== 0.0 ||
+                    this.m[4] !== 0.0 || this.m[6] !== 0.0 || this.m[7] !== 0.0 ||
+                    this.m[8] !== 0.0 || this.m[9] !== 0.0 || this.m[10] !== 0.0 || this.m[11] !== 0.0 ||
+                    this.m[12] !== 0.0 || this.m[13] !== 0.0 || this.m[14] !== 0.0) {
+                    this._isIdentity3x2 = false;
+                }
+                else {
+                    this._isIdentity3x2 = true;
+                }
+            }
+            return this._isIdentity3x2;
+        };
+        /**
          * Gets the determinant of the matrix
          * @returns the matrix determinant
          */
@@ -42802,7 +42822,7 @@ var BABYLON;
         MaterialHelper.PrepareDefinesForMergedUV = function (texture, defines, key) {
             defines._needUVs = true;
             defines[key] = true;
-            if (texture.getTextureMatrix().isIdentity(true)) {
+            if (texture.getTextureMatrix().isIdentityAs3x2()) {
                 defines[key + "DIRECTUV"] = texture.coordinatesIndex + 1;
                 if (texture.coordinatesIndex === 0) {
                     defines["MAINUV1"] = true;
@@ -42823,7 +42843,7 @@ var BABYLON;
          */
         MaterialHelper.BindTextureMatrix = function (texture, uniformBuffer, key) {
             var matrix = texture.getTextureMatrix();
-            if (!matrix.isIdentity(true)) {
+            if (!matrix.isIdentityAs3x2()) {
                 uniformBuffer.updateMatrix(key + "Matrix", matrix);
             }
         };
@@ -50728,8 +50748,9 @@ var BABYLON;
                         delta = event.wheelDelta / (_this.wheelPrecision * 40);
                     }
                 }
-                else if (event.detail || event.deltaY) {
-                    delta = -(event.detail || event.deltaY) / _this.wheelPrecision;
+                else {
+                    var deltaValue = event.deltaY || event.detail;
+                    delta = -deltaValue / _this.wheelPrecision;
                 }
                 if (delta) {
                     _this.camera.inertialRadiusOffset += delta;

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/babylon.worker.js


+ 33 - 12
dist/preview release/es6.js

@@ -7404,6 +7404,8 @@ var BABYLON;
         function Matrix() {
             this._isIdentity = false;
             this._isIdentityDirty = true;
+            this._isIdentity3x2 = true;
+            this._isIdentity3x2Dirty = true;
             /**
              * Gets or sets the internal data of the matrix
              */
@@ -7414,18 +7416,17 @@ var BABYLON;
         Matrix.prototype._markAsUpdated = function () {
             this.updateFlag = Matrix._updateFlagSeed++;
             this._isIdentityDirty = true;
+            this._isIdentity3x2Dirty = true;
         };
         // Properties
         /**
-         * Check if the current matrix is indentity
-         * @param considerAsTextureMatrix defines if the current matrix must be considered as a texture matrix (3x2)
+         * Check if the current matrix is identity
          * @returns true is the matrix is the identity matrix
          */
-        Matrix.prototype.isIdentity = function (considerAsTextureMatrix) {
-            if (considerAsTextureMatrix === void 0) { considerAsTextureMatrix = false; }
+        Matrix.prototype.isIdentity = function () {
             if (this._isIdentityDirty) {
                 this._isIdentityDirty = false;
-                if (this.m[0] !== 1.0 || this.m[5] !== 1.0 || this.m[15] !== 1.0) {
+                if (this.m[0] !== 1.0 || this.m[5] !== 1.0 || this.m[10] !== 1.0 || this.m[15] !== 1.0) {
                     this._isIdentity = false;
                 }
                 else if (this.m[1] !== 0.0 || this.m[2] !== 0.0 || this.m[3] !== 0.0 ||
@@ -7437,13 +7438,32 @@ var BABYLON;
                 else {
                     this._isIdentity = true;
                 }
-                if (!considerAsTextureMatrix && this.m[10] !== 1.0) {
-                    this._isIdentity = false;
-                }
             }
             return this._isIdentity;
         };
         /**
+         * Check if the current matrix is identity as a texture matrix (3x2 store in 4x4)
+         * @returns true is the matrix is the identity matrix
+         */
+        Matrix.prototype.isIdentityAs3x2 = function () {
+            if (this._isIdentity3x2Dirty) {
+                this._isIdentity3x2Dirty = false;
+                if (this.m[0] !== 1.0 || this.m[5] !== 1.0 || this.m[15] !== 1.0) {
+                    this._isIdentity3x2 = false;
+                }
+                else if (this.m[1] !== 0.0 || this.m[2] !== 0.0 || this.m[3] !== 0.0 ||
+                    this.m[4] !== 0.0 || this.m[6] !== 0.0 || this.m[7] !== 0.0 ||
+                    this.m[8] !== 0.0 || this.m[9] !== 0.0 || this.m[10] !== 0.0 || this.m[11] !== 0.0 ||
+                    this.m[12] !== 0.0 || this.m[13] !== 0.0 || this.m[14] !== 0.0) {
+                    this._isIdentity3x2 = false;
+                }
+                else {
+                    this._isIdentity3x2 = true;
+                }
+            }
+            return this._isIdentity3x2;
+        };
+        /**
          * Gets the determinant of the matrix
          * @returns the matrix determinant
          */
@@ -42802,7 +42822,7 @@ var BABYLON;
         MaterialHelper.PrepareDefinesForMergedUV = function (texture, defines, key) {
             defines._needUVs = true;
             defines[key] = true;
-            if (texture.getTextureMatrix().isIdentity(true)) {
+            if (texture.getTextureMatrix().isIdentityAs3x2()) {
                 defines[key + "DIRECTUV"] = texture.coordinatesIndex + 1;
                 if (texture.coordinatesIndex === 0) {
                     defines["MAINUV1"] = true;
@@ -42823,7 +42843,7 @@ var BABYLON;
          */
         MaterialHelper.BindTextureMatrix = function (texture, uniformBuffer, key) {
             var matrix = texture.getTextureMatrix();
-            if (!matrix.isIdentity(true)) {
+            if (!matrix.isIdentityAs3x2()) {
                 uniformBuffer.updateMatrix(key + "Matrix", matrix);
             }
         };
@@ -50728,8 +50748,9 @@ var BABYLON;
                         delta = event.wheelDelta / (_this.wheelPrecision * 40);
                     }
                 }
-                else if (event.detail || event.deltaY) {
-                    delta = -(event.detail || event.deltaY) / _this.wheelPrecision;
+                else {
+                    var deltaValue = event.deltaY || event.detail;
+                    delta = -deltaValue / _this.wheelPrecision;
                 }
                 if (delta) {
                     _this.camera.inertialRadiusOffset += delta;

+ 8 - 0
dist/preview release/gui/babylon.gui.d.ts

@@ -594,6 +594,14 @@ declare module BABYLON.GUI {
                 */
             pointerUpAnimation: () => void;
             /**
+                * Returns the image part of the button (if any)
+                */
+            readonly image: BABYLON.Nullable<Image>;
+            /**
+                * Returns the image part of the button (if any)
+                */
+            readonly textBlock: BABYLON.Nullable<TextBlock>;
+            /**
                 * Creates a new Button
                 * @param name defines the name of the button
                 */

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/gui/babylon.gui.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js.map


+ 19 - 1
dist/preview release/gui/babylon.gui.module.d.ts

@@ -652,7 +652,9 @@ declare module 'babylonjs-gui/3D/vector3WithInfo' {
 declare module 'babylonjs-gui/2D/controls/button' {
     import { Rectangle } from "babylonjs-gui/2D/controls/rectangle";
     import { Control } from "babylonjs-gui/2D/controls/control";
-    import { Vector2 } from "babylonjs";
+    import { TextBlock } from "babylonjs-gui/2D/controls/textBlock";
+    import { Image } from "babylonjs-gui/2D/controls/image";
+    import { Vector2, Nullable } from "babylonjs";
     /**
         * Class used to create 2D buttons
         */
@@ -675,6 +677,14 @@ declare module 'babylonjs-gui/2D/controls/button' {
                 */
             pointerUpAnimation: () => void;
             /**
+                * Returns the image part of the button (if any)
+                */
+            readonly image: Nullable<Image>;
+            /**
+                * Returns the image part of the button (if any)
+                */
+            readonly textBlock: Nullable<TextBlock>;
+            /**
                 * Creates a new Button
                 * @param name defines the name of the button
                 */
@@ -3429,6 +3439,14 @@ declare module BABYLON.GUI {
                 */
             pointerUpAnimation: () => void;
             /**
+                * Returns the image part of the button (if any)
+                */
+            readonly image: BABYLON.Nullable<Image>;
+            /**
+                * Returns the image part of the button (if any)
+                */
+            readonly textBlock: BABYLON.Nullable<TextBlock>;
+            /**
                 * Creates a new Button
                 * @param name defines the name of the button
                 */

+ 4 - 4
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<Template> | Promise<string>;
+            showOverlayScreen(subScreen: string): Promise<string> | Promise<Template>;
             /**
                 * Hide the overlay screen.
                 */
-            hideOverlayScreen(): Promise<Template> | Promise<string>;
+            hideOverlayScreen(): Promise<string> | Promise<Template>;
             /**
                 * 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<Template> | Promise<string>;
+            showLoadingScreen(): Promise<string> | Promise<Template>;
             /**
                 * Hide the loading screen
                 */
-            hideLoadingScreen(): Promise<Template> | Promise<string>;
+            hideLoadingScreen(): Promise<string> | Promise<Template>;
             dispose(): void;
             protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
     }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 4 - 4
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<Template> | Promise<string>;
+            showOverlayScreen(subScreen: string): Promise<string> | Promise<Template>;
             /**
                 * Hide the overlay screen.
                 */
-            hideOverlayScreen(): Promise<Template> | Promise<string>;
+            hideOverlayScreen(): Promise<string> | Promise<Template>;
             /**
                 * 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<Template> | Promise<string>;
+            showLoadingScreen(): Promise<string> | Promise<Template>;
             /**
                 * Hide the loading screen
                 */
-            hideLoadingScreen(): Promise<Template> | Promise<string>;
+            hideLoadingScreen(): Promise<string> | Promise<Template>;
             dispose(): void;
             protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
     }

+ 13 - 8
sandbox/index.js

@@ -16,6 +16,8 @@ var dropdownLabel = document.getElementById("dropdownLabel");
 var dropdownContent = document.getElementById("dropdownContent");
 var playBtn = document.getElementById("playBtn");
 var slider = document.getElementById("slider");
+var footer = document.getElementById("footer");
+var canvas = document.getElementById("renderCanvas");
 
 var indexOf = location.href.indexOf("?");
 if (indexOf !== -1) {
@@ -41,11 +43,14 @@ if (indexOf !== -1) {
     }
 }
 
+if (kiosk) {
+    footer.style.display = "none";
+    canvas.style.height = "100%";
+}
+
 if (BABYLON.Engine.isSupported()) {
-    var canvas = document.getElementById("renderCanvas");
     var engine = new BABYLON.Engine(canvas, true, { premultipliedAlpha: false, preserveDrawingBuffer: true });
     var htmlInput = document.getElementById("files");
-    var footer = document.getElementById("footer");
     var btnInspector = document.getElementById("btnInspector");
     var errorZone = document.getElementById("errorZone");
     var filesInput;
@@ -128,7 +133,7 @@ if (BABYLON.Engine.isSupported()) {
         btnInspector.classList.remove("hidden");
 
         currentScene = babylonScene;
-        document.title = "BabylonJS - " + sceneFile.name;
+        document.title = "Babylon.js - " + sceneFile.name;
         // Fix for IE, otherwise it will change the default filter for files selection after first use
         htmlInput.value = "";
 
@@ -210,7 +215,7 @@ if (BABYLON.Engine.isSupported()) {
     };
 
     var sceneError = function(sceneFile, babylonScene, message) {
-        document.title = "BabylonJS - " + sceneFile.name;
+        document.title = "Babylon.js - " + sceneFile.name;
         document.getElementById("logo").className = "";
         canvas.style.opacity = 0;
 
@@ -298,10 +303,6 @@ if (BABYLON.Engine.isSupported()) {
         }
     });
 
-    if (kiosk) {
-        footer.style.display = "none";
-    }
-
     btnInspector.addEventListener('click', function() {
         if (currentScene) {
             if (currentScene.debugLayer.isVisible()) {
@@ -321,10 +322,14 @@ if (BABYLON.Engine.isSupported()) {
         if (event.keyCode === 32 && event.target.nodeName !== "INPUT") {
             if (footer.style.display === "none") {
                 footer.style.display = "block";
+                canvas.style.height = "calc(100% - 56px)";                
+                engine.resize();
             }
             else {
                 footer.style.display = "none";
+                canvas.style.height = "100%";
                 errorZone.style.display = "none";
+                engine.resize();
                 if (debugLayerEnabled) {
                     currentScene.debugLayer.hide();
                     debugLayerEnabled = false;

+ 8 - 8
src/Materials/babylon.materialHelper.ts

@@ -32,7 +32,7 @@ module BABYLON {
         public static PrepareDefinesForMergedUV(texture: BaseTexture, defines: any, key: string): void {
             defines._needUVs = true;
             defines[key] = true;
-            if (texture.getTextureMatrix().isIdentity(true)) {
+            if (texture.getTextureMatrix().isIdentityAs3x2()) {
                 defines[key + "DIRECTUV"] = texture.coordinatesIndex + 1;
                 if (texture.coordinatesIndex === 0) {
                     defines["MAINUV1"] = true;
@@ -53,7 +53,7 @@ module BABYLON {
         public static BindTextureMatrix(texture: BaseTexture, uniformBuffer: UniformBuffer, key: string): void {
             var matrix = texture.getTextureMatrix();
 
-            if (!matrix.isIdentity(true)) {
+            if (!matrix.isIdentityAs3x2()) {
                 uniformBuffer.updateMatrix(key + "Matrix", matrix);
             }
         }
@@ -245,14 +245,14 @@ module BABYLON {
 
                     switch (light.falloffType) {
                         case Light.FALLOFF_GLTF:
-                        defines["LIGHT_FALLOFF_GLTF" + lightIndex] = true;
-                        break;
+                            defines["LIGHT_FALLOFF_GLTF" + lightIndex] = true;
+                            break;
                         case Light.FALLOFF_PHYSICAL:
-                        defines["LIGHT_FALLOFF_PHYSICAL" + lightIndex] = true;
-                        break;
+                            defines["LIGHT_FALLOFF_PHYSICAL" + lightIndex] = true;
+                            break;
                         case Light.FALLOFF_STANDARD:
-                        defines["LIGHT_FALLOFF_STANDARD" + lightIndex] = true;
-                        break;
+                            defines["LIGHT_FALLOFF_STANDARD" + lightIndex] = true;
+                            break;
                     }
 
                     // Specular

+ 28 - 7
src/Math/babylon.math.ts

@@ -4229,6 +4229,8 @@ module BABYLON {
 
         private _isIdentity = false;
         private _isIdentityDirty = true;
+        private _isIdentity3x2 = true;
+        private _isIdentity3x2Dirty = true;
         /**
          * Gets the update flag of the matrix which is an unique number for the matrix.
          * It will be incremented every time the matrix data change.
@@ -4245,6 +4247,7 @@ module BABYLON {
         public _markAsUpdated() {
             this.updateFlag = Matrix._updateFlagSeed++;
             this._isIdentityDirty = true;
+            this._isIdentity3x2Dirty = true;
         }
 
         /** @hidden */
@@ -4264,14 +4267,13 @@ module BABYLON {
         // Properties
 
         /**
-         * Check if the current matrix is indentity
-         * @param considerAsTextureMatrix defines if the current matrix must be considered as a texture matrix (3x2)
+         * Check if the current matrix is identity
          * @returns true is the matrix is the identity matrix
          */
-        public isIdentity(considerAsTextureMatrix = false): boolean {
+        public isIdentity(): boolean {
             if (this._isIdentityDirty) {
                 this._isIdentityDirty = false;
-                if (this.m[0] !== 1.0 || this.m[5] !== 1.0 || this.m[15] !== 1.0) {
+                if (this.m[0] !== 1.0 || this.m[5] !== 1.0 || this.m[10] !== 1.0 || this.m[15] !== 1.0) {
                     this._isIdentity = false;
                 } else if (this.m[1] !== 0.0 || this.m[2] !== 0.0 || this.m[3] !== 0.0 ||
                     this.m[4] !== 0.0 || this.m[6] !== 0.0 || this.m[7] !== 0.0 ||
@@ -4281,14 +4283,33 @@ module BABYLON {
                 } else {
                     this._isIdentity = true;
                 }
+            }
 
-                if (!considerAsTextureMatrix && this.m[10] !== 1.0) {
-                    this._isIdentity = false;
+            return this._isIdentity;
+        }
+
+        /**
+         * Check if the current matrix is identity as a texture matrix (3x2 store in 4x4)
+         * @returns true is the matrix is the identity matrix
+         */
+        public isIdentityAs3x2(): boolean {
+            if (this._isIdentity3x2Dirty) {
+                this._isIdentity3x2Dirty = false;
+                if (this.m[0] !== 1.0 || this.m[5] !== 1.0 || this.m[15] !== 1.0) {
+                    this._isIdentity3x2 = false;
+                } else if (this.m[1] !== 0.0 || this.m[2] !== 0.0 || this.m[3] !== 0.0 ||
+                    this.m[4] !== 0.0 || this.m[6] !== 0.0 || this.m[7] !== 0.0 ||
+                    this.m[8] !== 0.0 || this.m[9] !== 0.0 || this.m[10] !== 0.0 || this.m[11] !== 0.0 ||
+                    this.m[12] !== 0.0 || this.m[13] !== 0.0 || this.m[14] !== 0.0) {
+                    this._isIdentity3x2 = false;
+                } else {
+                    this._isIdentity3x2 = true;
                 }
             }
 
-            return this._isIdentity;
+            return this._isIdentity3x2;
         }
+
         /**
          * Gets the determinant of the matrix
          * @returns the matrix determinant