David Catuhe 7 lat temu
rodzic
commit
6425d61fd7
37 zmienionych plików z 50364 dodań i 50223 usunięć
  1. 16586 16582
      Playground/babylon.d.txt
  2. 16161 16157
      dist/preview release/babylon.d.ts
  3. 49 49
      dist/preview release/babylon.js
  4. 25 21
      dist/preview release/babylon.max.js
  5. 50 50
      dist/preview release/babylon.worker.js
  6. 16980 16976
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  7. 52 52
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  8. 25 21
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  9. 25 21
      dist/preview release/customConfigurations/minimalGLTFViewer/es6.js
  10. 25 21
      dist/preview release/es6.js
  11. 3 3
      dist/preview release/gui/babylon.gui.min.js
  12. 4 4
      dist/preview release/inspector/babylon.inspector.bundle.js
  13. 3 3
      dist/preview release/inspector/babylon.inspector.min.js
  14. 2 2
      dist/preview release/loaders/babylon.glTF1FileLoader.min.js
  15. 2 2
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  16. 3 3
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  17. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  18. 3 3
      dist/preview release/loaders/babylonjs.loaders.min.js
  19. 22 13
      dist/preview release/materialsLibrary/babylon.customMaterial.js
  20. 1 1
      dist/preview release/materialsLibrary/babylon.customMaterial.min.js
  21. 1 1
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js
  22. 1 1
      dist/preview release/materialsLibrary/babylon.waterMaterial.min.js
  23. 22 13
      dist/preview release/materialsLibrary/babylonjs.materials.js
  24. 3 3
      dist/preview release/materialsLibrary/babylonjs.materials.min.js
  25. 1 1
      dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js
  26. 1 1
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js
  27. 1 1
      dist/preview release/postProcessesLibrary/babylonjs.postProcess.min.js
  28. 24 0
      dist/preview release/serializers/babylon.glTF2Serializer.d.ts
  29. 88 52
      dist/preview release/serializers/babylon.glTF2Serializer.js
  30. 1 1
      dist/preview release/serializers/babylon.glTF2Serializer.min.js
  31. 88 52
      dist/preview release/serializers/babylonjs.serializers.js
  32. 1 1
      dist/preview release/serializers/babylonjs.serializers.min.js
  33. 24 0
      dist/preview release/serializers/babylonjs.serializers.module.d.ts
  34. 2 31
      dist/preview release/typedocValidationBaseline.json
  35. 58 58
      dist/preview release/viewer/babylon.viewer.js
  36. 25 21
      dist/preview release/viewer/babylon.viewer.max.js
  37. 1 1
      src/Math/babylon.math.ts

Plik diff jest za duży
+ 16586 - 16582
Playground/babylon.d.txt


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


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


+ 25 - 21
dist/preview release/babylon.max.js

@@ -4383,7 +4383,9 @@ var BABYLON;
             return this;
         };
         /**
-         * Returns a new Vector3 set with the Euler angles translated from the current Quaternion.
+         * Returns a new Vector3 set with the Euler angles translated from the current Quaternion
+         * @param order is a reserved parameter and is ignore for now
+         * @returns the new Vector3
          */
         Quaternion.prototype.toEulerAngles = function (order) {
             if (order === void 0) { order = "YZX"; }
@@ -4392,8 +4394,10 @@ var BABYLON;
             return result;
         };
         /**
-         * Sets the passed vector3 "result" with the Euler angles translated from the current Quaternion.
-         * Returns the current Quaternion.
+         * Sets the passed vector3 "result" with the Euler angles translated from the current Quaternion
+         * @param result defines the vector which will be filled with the Euler angles
+         * @param order is a reserved parameter and is ignore for now
+         * @returns the current Quaternion
          */
         Quaternion.prototype.toEulerAnglesToRef = function (result, order) {
             if (order === void 0) { order = "YZX"; }
@@ -22420,11 +22424,11 @@ var BABYLON;
                 }
             }
             if (pickResult) {
+                var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE;
                 if (this.onPointerMove) {
-                    this.onPointerMove(evt, pickResult);
+                    this.onPointerMove(evt, pickResult, type);
                 }
                 if (this.onPointerObservable.hasObservers()) {
-                    var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
@@ -22478,11 +22482,11 @@ var BABYLON;
                 }
             }
             if (pickResult) {
+                var type = BABYLON.PointerEventTypes.POINTERDOWN;
                 if (this.onPointerDown) {
-                    this.onPointerDown(evt, pickResult);
+                    this.onPointerDown(evt, pickResult, type);
                 }
                 if (this.onPointerObservable.hasObservers()) {
-                    var type = BABYLON.PointerEventTypes.POINTERDOWN;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
@@ -22510,9 +22514,9 @@ var BABYLON;
                         this.onPointerPick(evt, pickResult);
                     }
                     if (clickInfo.singleClick && !clickInfo.ignore && this.onPointerObservable.hasObservers()) {
-                        var type = BABYLON.PointerEventTypes.POINTERPICK;
-                        var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                        this.onPointerObservable.notifyObservers(pi, type);
+                        var type_1 = BABYLON.PointerEventTypes.POINTERPICK;
+                        var pi = new BABYLON.PointerInfo(type_1, evt, pickResult);
+                        this.onPointerObservable.notifyObservers(pi, type_1);
                     }
                 }
                 if (pickResult.pickedMesh.actionManager) {
@@ -22533,30 +22537,30 @@ var BABYLON;
                 this._pickedDownMesh !== this._pickedUpMesh) {
                 this._pickedDownMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickOutTrigger, BABYLON.ActionEvent.CreateNew(this._pickedDownMesh, evt));
             }
-            if (this.onPointerUp) {
-                this.onPointerUp(evt, pickResult);
-            }
+            var type = BABYLON.PointerEventTypes.POINTERUP;
             if (this.onPointerObservable.hasObservers()) {
                 if (!clickInfo.ignore) {
                     if (!clickInfo.hasSwiped) {
                         if (clickInfo.singleClick && this.onPointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERTAP)) {
-                            var type = BABYLON.PointerEventTypes.POINTERTAP;
-                            var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                            this.onPointerObservable.notifyObservers(pi, type);
+                            var type_2 = BABYLON.PointerEventTypes.POINTERTAP;
+                            var pi = new BABYLON.PointerInfo(type_2, evt, pickResult);
+                            this.onPointerObservable.notifyObservers(pi, type_2);
                         }
                         if (clickInfo.doubleClick && this.onPointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP)) {
-                            var type = BABYLON.PointerEventTypes.POINTERDOUBLETAP;
-                            var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                            this.onPointerObservable.notifyObservers(pi, type);
+                            var type_3 = BABYLON.PointerEventTypes.POINTERDOUBLETAP;
+                            var pi = new BABYLON.PointerInfo(type_3, evt, pickResult);
+                            this.onPointerObservable.notifyObservers(pi, type_3);
                         }
                     }
                 }
                 else {
-                    var type = BABYLON.PointerEventTypes.POINTERUP;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
             }
+            if (this.onPointerUp) {
+                this.onPointerUp(evt, pickResult, type);
+            }
             return this;
         };
         /**
@@ -31984,7 +31988,7 @@ var BABYLON;
          * @returns - Parsed material.
          */
         Material.Parse = function (parsedMaterial, scene, rootUrl) {
-            if (!parsedMaterial.customType) {
+            if (!parsedMaterial.customType || parsedMaterial.customType === "BABYLON.StandardMaterial") {
                 return BABYLON.StandardMaterial.Parse(parsedMaterial, scene, rootUrl);
             }
             if (parsedMaterial.customType === "BABYLON.PBRMaterial" && parsedMaterial.overloadedAlbedo) {

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


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


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


+ 25 - 21
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -4383,7 +4383,9 @@ var BABYLON;
             return this;
         };
         /**
-         * Returns a new Vector3 set with the Euler angles translated from the current Quaternion.
+         * Returns a new Vector3 set with the Euler angles translated from the current Quaternion
+         * @param order is a reserved parameter and is ignore for now
+         * @returns the new Vector3
          */
         Quaternion.prototype.toEulerAngles = function (order) {
             if (order === void 0) { order = "YZX"; }
@@ -4392,8 +4394,10 @@ var BABYLON;
             return result;
         };
         /**
-         * Sets the passed vector3 "result" with the Euler angles translated from the current Quaternion.
-         * Returns the current Quaternion.
+         * Sets the passed vector3 "result" with the Euler angles translated from the current Quaternion
+         * @param result defines the vector which will be filled with the Euler angles
+         * @param order is a reserved parameter and is ignore for now
+         * @returns the current Quaternion
          */
         Quaternion.prototype.toEulerAnglesToRef = function (result, order) {
             if (order === void 0) { order = "YZX"; }
@@ -22420,11 +22424,11 @@ var BABYLON;
                 }
             }
             if (pickResult) {
+                var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE;
                 if (this.onPointerMove) {
-                    this.onPointerMove(evt, pickResult);
+                    this.onPointerMove(evt, pickResult, type);
                 }
                 if (this.onPointerObservable.hasObservers()) {
-                    var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
@@ -22478,11 +22482,11 @@ var BABYLON;
                 }
             }
             if (pickResult) {
+                var type = BABYLON.PointerEventTypes.POINTERDOWN;
                 if (this.onPointerDown) {
-                    this.onPointerDown(evt, pickResult);
+                    this.onPointerDown(evt, pickResult, type);
                 }
                 if (this.onPointerObservable.hasObservers()) {
-                    var type = BABYLON.PointerEventTypes.POINTERDOWN;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
@@ -22510,9 +22514,9 @@ var BABYLON;
                         this.onPointerPick(evt, pickResult);
                     }
                     if (clickInfo.singleClick && !clickInfo.ignore && this.onPointerObservable.hasObservers()) {
-                        var type = BABYLON.PointerEventTypes.POINTERPICK;
-                        var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                        this.onPointerObservable.notifyObservers(pi, type);
+                        var type_1 = BABYLON.PointerEventTypes.POINTERPICK;
+                        var pi = new BABYLON.PointerInfo(type_1, evt, pickResult);
+                        this.onPointerObservable.notifyObservers(pi, type_1);
                     }
                 }
                 if (pickResult.pickedMesh.actionManager) {
@@ -22533,30 +22537,30 @@ var BABYLON;
                 this._pickedDownMesh !== this._pickedUpMesh) {
                 this._pickedDownMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickOutTrigger, BABYLON.ActionEvent.CreateNew(this._pickedDownMesh, evt));
             }
-            if (this.onPointerUp) {
-                this.onPointerUp(evt, pickResult);
-            }
+            var type = BABYLON.PointerEventTypes.POINTERUP;
             if (this.onPointerObservable.hasObservers()) {
                 if (!clickInfo.ignore) {
                     if (!clickInfo.hasSwiped) {
                         if (clickInfo.singleClick && this.onPointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERTAP)) {
-                            var type = BABYLON.PointerEventTypes.POINTERTAP;
-                            var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                            this.onPointerObservable.notifyObservers(pi, type);
+                            var type_2 = BABYLON.PointerEventTypes.POINTERTAP;
+                            var pi = new BABYLON.PointerInfo(type_2, evt, pickResult);
+                            this.onPointerObservable.notifyObservers(pi, type_2);
                         }
                         if (clickInfo.doubleClick && this.onPointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP)) {
-                            var type = BABYLON.PointerEventTypes.POINTERDOUBLETAP;
-                            var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                            this.onPointerObservable.notifyObservers(pi, type);
+                            var type_3 = BABYLON.PointerEventTypes.POINTERDOUBLETAP;
+                            var pi = new BABYLON.PointerInfo(type_3, evt, pickResult);
+                            this.onPointerObservable.notifyObservers(pi, type_3);
                         }
                     }
                 }
                 else {
-                    var type = BABYLON.PointerEventTypes.POINTERUP;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
             }
+            if (this.onPointerUp) {
+                this.onPointerUp(evt, pickResult, type);
+            }
             return this;
         };
         /**
@@ -31984,7 +31988,7 @@ var BABYLON;
          * @returns - Parsed material.
          */
         Material.Parse = function (parsedMaterial, scene, rootUrl) {
-            if (!parsedMaterial.customType) {
+            if (!parsedMaterial.customType || parsedMaterial.customType === "BABYLON.StandardMaterial") {
                 return BABYLON.StandardMaterial.Parse(parsedMaterial, scene, rootUrl);
             }
             if (parsedMaterial.customType === "BABYLON.PBRMaterial" && parsedMaterial.overloadedAlbedo) {

+ 25 - 21
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js

@@ -4356,7 +4356,9 @@ var BABYLON;
             return this;
         };
         /**
-         * Returns a new Vector3 set with the Euler angles translated from the current Quaternion.
+         * Returns a new Vector3 set with the Euler angles translated from the current Quaternion
+         * @param order is a reserved parameter and is ignore for now
+         * @returns the new Vector3
          */
         Quaternion.prototype.toEulerAngles = function (order) {
             if (order === void 0) { order = "YZX"; }
@@ -4365,8 +4367,10 @@ var BABYLON;
             return result;
         };
         /**
-         * Sets the passed vector3 "result" with the Euler angles translated from the current Quaternion.
-         * Returns the current Quaternion.
+         * Sets the passed vector3 "result" with the Euler angles translated from the current Quaternion
+         * @param result defines the vector which will be filled with the Euler angles
+         * @param order is a reserved parameter and is ignore for now
+         * @returns the current Quaternion
          */
         Quaternion.prototype.toEulerAnglesToRef = function (result, order) {
             if (order === void 0) { order = "YZX"; }
@@ -22393,11 +22397,11 @@ var BABYLON;
                 }
             }
             if (pickResult) {
+                var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE;
                 if (this.onPointerMove) {
-                    this.onPointerMove(evt, pickResult);
+                    this.onPointerMove(evt, pickResult, type);
                 }
                 if (this.onPointerObservable.hasObservers()) {
-                    var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
@@ -22451,11 +22455,11 @@ var BABYLON;
                 }
             }
             if (pickResult) {
+                var type = BABYLON.PointerEventTypes.POINTERDOWN;
                 if (this.onPointerDown) {
-                    this.onPointerDown(evt, pickResult);
+                    this.onPointerDown(evt, pickResult, type);
                 }
                 if (this.onPointerObservable.hasObservers()) {
-                    var type = BABYLON.PointerEventTypes.POINTERDOWN;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
@@ -22483,9 +22487,9 @@ var BABYLON;
                         this.onPointerPick(evt, pickResult);
                     }
                     if (clickInfo.singleClick && !clickInfo.ignore && this.onPointerObservable.hasObservers()) {
-                        var type = BABYLON.PointerEventTypes.POINTERPICK;
-                        var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                        this.onPointerObservable.notifyObservers(pi, type);
+                        var type_1 = BABYLON.PointerEventTypes.POINTERPICK;
+                        var pi = new BABYLON.PointerInfo(type_1, evt, pickResult);
+                        this.onPointerObservable.notifyObservers(pi, type_1);
                     }
                 }
                 if (pickResult.pickedMesh.actionManager) {
@@ -22506,30 +22510,30 @@ var BABYLON;
                 this._pickedDownMesh !== this._pickedUpMesh) {
                 this._pickedDownMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickOutTrigger, BABYLON.ActionEvent.CreateNew(this._pickedDownMesh, evt));
             }
-            if (this.onPointerUp) {
-                this.onPointerUp(evt, pickResult);
-            }
+            var type = BABYLON.PointerEventTypes.POINTERUP;
             if (this.onPointerObservable.hasObservers()) {
                 if (!clickInfo.ignore) {
                     if (!clickInfo.hasSwiped) {
                         if (clickInfo.singleClick && this.onPointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERTAP)) {
-                            var type = BABYLON.PointerEventTypes.POINTERTAP;
-                            var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                            this.onPointerObservable.notifyObservers(pi, type);
+                            var type_2 = BABYLON.PointerEventTypes.POINTERTAP;
+                            var pi = new BABYLON.PointerInfo(type_2, evt, pickResult);
+                            this.onPointerObservable.notifyObservers(pi, type_2);
                         }
                         if (clickInfo.doubleClick && this.onPointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP)) {
-                            var type = BABYLON.PointerEventTypes.POINTERDOUBLETAP;
-                            var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                            this.onPointerObservable.notifyObservers(pi, type);
+                            var type_3 = BABYLON.PointerEventTypes.POINTERDOUBLETAP;
+                            var pi = new BABYLON.PointerInfo(type_3, evt, pickResult);
+                            this.onPointerObservable.notifyObservers(pi, type_3);
                         }
                     }
                 }
                 else {
-                    var type = BABYLON.PointerEventTypes.POINTERUP;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
             }
+            if (this.onPointerUp) {
+                this.onPointerUp(evt, pickResult, type);
+            }
             return this;
         };
         /**
@@ -31957,7 +31961,7 @@ var BABYLON;
          * @returns - Parsed material.
          */
         Material.Parse = function (parsedMaterial, scene, rootUrl) {
-            if (!parsedMaterial.customType) {
+            if (!parsedMaterial.customType || parsedMaterial.customType === "BABYLON.StandardMaterial") {
                 return BABYLON.StandardMaterial.Parse(parsedMaterial, scene, rootUrl);
             }
             if (parsedMaterial.customType === "BABYLON.PBRMaterial" && parsedMaterial.overloadedAlbedo) {

+ 25 - 21
dist/preview release/es6.js

@@ -4356,7 +4356,9 @@ var BABYLON;
             return this;
         };
         /**
-         * Returns a new Vector3 set with the Euler angles translated from the current Quaternion.
+         * Returns a new Vector3 set with the Euler angles translated from the current Quaternion
+         * @param order is a reserved parameter and is ignore for now
+         * @returns the new Vector3
          */
         Quaternion.prototype.toEulerAngles = function (order) {
             if (order === void 0) { order = "YZX"; }
@@ -4365,8 +4367,10 @@ var BABYLON;
             return result;
         };
         /**
-         * Sets the passed vector3 "result" with the Euler angles translated from the current Quaternion.
-         * Returns the current Quaternion.
+         * Sets the passed vector3 "result" with the Euler angles translated from the current Quaternion
+         * @param result defines the vector which will be filled with the Euler angles
+         * @param order is a reserved parameter and is ignore for now
+         * @returns the current Quaternion
          */
         Quaternion.prototype.toEulerAnglesToRef = function (result, order) {
             if (order === void 0) { order = "YZX"; }
@@ -22393,11 +22397,11 @@ var BABYLON;
                 }
             }
             if (pickResult) {
+                var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE;
                 if (this.onPointerMove) {
-                    this.onPointerMove(evt, pickResult);
+                    this.onPointerMove(evt, pickResult, type);
                 }
                 if (this.onPointerObservable.hasObservers()) {
-                    var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
@@ -22451,11 +22455,11 @@ var BABYLON;
                 }
             }
             if (pickResult) {
+                var type = BABYLON.PointerEventTypes.POINTERDOWN;
                 if (this.onPointerDown) {
-                    this.onPointerDown(evt, pickResult);
+                    this.onPointerDown(evt, pickResult, type);
                 }
                 if (this.onPointerObservable.hasObservers()) {
-                    var type = BABYLON.PointerEventTypes.POINTERDOWN;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
@@ -22483,9 +22487,9 @@ var BABYLON;
                         this.onPointerPick(evt, pickResult);
                     }
                     if (clickInfo.singleClick && !clickInfo.ignore && this.onPointerObservable.hasObservers()) {
-                        var type = BABYLON.PointerEventTypes.POINTERPICK;
-                        var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                        this.onPointerObservable.notifyObservers(pi, type);
+                        var type_1 = BABYLON.PointerEventTypes.POINTERPICK;
+                        var pi = new BABYLON.PointerInfo(type_1, evt, pickResult);
+                        this.onPointerObservable.notifyObservers(pi, type_1);
                     }
                 }
                 if (pickResult.pickedMesh.actionManager) {
@@ -22506,30 +22510,30 @@ var BABYLON;
                 this._pickedDownMesh !== this._pickedUpMesh) {
                 this._pickedDownMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickOutTrigger, BABYLON.ActionEvent.CreateNew(this._pickedDownMesh, evt));
             }
-            if (this.onPointerUp) {
-                this.onPointerUp(evt, pickResult);
-            }
+            var type = BABYLON.PointerEventTypes.POINTERUP;
             if (this.onPointerObservable.hasObservers()) {
                 if (!clickInfo.ignore) {
                     if (!clickInfo.hasSwiped) {
                         if (clickInfo.singleClick && this.onPointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERTAP)) {
-                            var type = BABYLON.PointerEventTypes.POINTERTAP;
-                            var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                            this.onPointerObservable.notifyObservers(pi, type);
+                            var type_2 = BABYLON.PointerEventTypes.POINTERTAP;
+                            var pi = new BABYLON.PointerInfo(type_2, evt, pickResult);
+                            this.onPointerObservable.notifyObservers(pi, type_2);
                         }
                         if (clickInfo.doubleClick && this.onPointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP)) {
-                            var type = BABYLON.PointerEventTypes.POINTERDOUBLETAP;
-                            var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                            this.onPointerObservable.notifyObservers(pi, type);
+                            var type_3 = BABYLON.PointerEventTypes.POINTERDOUBLETAP;
+                            var pi = new BABYLON.PointerInfo(type_3, evt, pickResult);
+                            this.onPointerObservable.notifyObservers(pi, type_3);
                         }
                     }
                 }
                 else {
-                    var type = BABYLON.PointerEventTypes.POINTERUP;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
             }
+            if (this.onPointerUp) {
+                this.onPointerUp(evt, pickResult, type);
+            }
             return this;
         };
         /**
@@ -31957,7 +31961,7 @@ var BABYLON;
          * @returns - Parsed material.
          */
         Material.Parse = function (parsedMaterial, scene, rootUrl) {
-            if (!parsedMaterial.customType) {
+            if (!parsedMaterial.customType || parsedMaterial.customType === "BABYLON.StandardMaterial") {
                 return BABYLON.StandardMaterial.Parse(parsedMaterial, scene, rootUrl);
             }
             if (parsedMaterial.customType === "BABYLON.PBRMaterial" && parsedMaterial.overloadedAlbedo) {

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


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


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


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


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


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


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


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


+ 22 - 13
dist/preview release/materialsLibrary/babylon.customMaterial.js

@@ -11,7 +11,6 @@ var __extends = (this && this.__extends) || (function () {
 })();
 var BABYLON;
 (function (BABYLON) {
-    // old version of standard material updated every 3 months
     var CustomShaderStructure = /** @class */ (function () {
         function CustomShaderStructure() {
         }
@@ -37,40 +36,51 @@ var BABYLON;
         CustomMaterial.prototype.AttachAfterBind = function (mesh, effect) {
             for (var el in this._newUniformInstances) {
                 var ea = el.toString().split('-');
-                if (ea[0] == 'vec2')
+                if (ea[0] == 'vec2') {
                     effect.setVector2(ea[1], this._newUniformInstances[el]);
-                else if (ea[0] == 'vec3')
+                }
+                else if (ea[0] == 'vec3') {
                     effect.setVector3(ea[1], this._newUniformInstances[el]);
-                else if (ea[0] == 'vec4')
+                }
+                else if (ea[0] == 'vec4') {
                     effect.setVector4(ea[1], this._newUniformInstances[el]);
-                else if (ea[0] == 'mat4')
+                }
+                else if (ea[0] == 'mat4') {
                     effect.setMatrix(ea[1], this._newUniformInstances[el]);
-                else if (ea[0] == 'float')
+                }
+                else if (ea[0] == 'float') {
                     effect.setFloat(ea[1], this._newUniformInstances[el]);
+                }
             }
             for (var el in this._newSamplerInstances) {
                 var ea = el.toString().split('-');
-                if (ea[0] == 'sampler2D' && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady())
+                if (ea[0] == 'sampler2D' && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady()) {
                     effect.setTexture(ea[1], this._newSamplerInstances[el]);
+                }
             }
         };
         CustomMaterial.prototype.ReviewUniform = function (name, arr) {
             if (name == "uniform") {
-                for (var ind in this._newUniforms)
-                    if (this._customUniform[ind].indexOf('sampler') == -1)
+                for (var ind in this._newUniforms) {
+                    if (this._customUniform[ind].indexOf('sampler') == -1) {
                         arr.push(this._newUniforms[ind]);
+                    }
+                }
             }
             if (name == "sampler") {
-                for (var ind in this._newUniforms)
-                    if (this._customUniform[ind].indexOf('sampler') != -1)
+                for (var ind in this._newUniforms) {
+                    if (this._customUniform[ind].indexOf('sampler') != -1) {
                         arr.push(this._newUniforms[ind]);
+                    }
+                }
             }
             return arr;
         };
         CustomMaterial.prototype.Builder = function (shaderName, uniforms, uniformBuffers, samplers, defines) {
             var _this = this;
-            if (this._isCreatedShader)
+            if (this._isCreatedShader) {
                 return this._createdShaderName;
+            }
             this._isCreatedShader = false;
             CustomMaterial.ShaderIndexer++;
             var name = "custom_" + CustomMaterial.ShaderIndexer;
@@ -86,7 +96,6 @@ var BABYLON;
                     fn_afterBind(m, e);
                 }
                 catch (e) { }
-                ;
             };
             BABYLON.Effect.ShadersStore[name + "VertexShader"] = this.VertexShader
                 .replace('#define CUSTOM_VERTEX_BEGIN', (this.CustomParts.Vertex_Begin ? this.CustomParts.Vertex_Begin : ""))

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


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


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


+ 22 - 13
dist/preview release/materialsLibrary/babylonjs.materials.js

@@ -4023,7 +4023,6 @@ BABYLON.Effect.ShadersStore['gridPixelShader'] = "#extension GL_OES_standard_der
 
 var BABYLON;
 (function (BABYLON) {
-    // old version of standard material updated every 3 months
     var CustomShaderStructure = /** @class */ (function () {
         function CustomShaderStructure() {
         }
@@ -4049,40 +4048,51 @@ var BABYLON;
         CustomMaterial.prototype.AttachAfterBind = function (mesh, effect) {
             for (var el in this._newUniformInstances) {
                 var ea = el.toString().split('-');
-                if (ea[0] == 'vec2')
+                if (ea[0] == 'vec2') {
                     effect.setVector2(ea[1], this._newUniformInstances[el]);
-                else if (ea[0] == 'vec3')
+                }
+                else if (ea[0] == 'vec3') {
                     effect.setVector3(ea[1], this._newUniformInstances[el]);
-                else if (ea[0] == 'vec4')
+                }
+                else if (ea[0] == 'vec4') {
                     effect.setVector4(ea[1], this._newUniformInstances[el]);
-                else if (ea[0] == 'mat4')
+                }
+                else if (ea[0] == 'mat4') {
                     effect.setMatrix(ea[1], this._newUniformInstances[el]);
-                else if (ea[0] == 'float')
+                }
+                else if (ea[0] == 'float') {
                     effect.setFloat(ea[1], this._newUniformInstances[el]);
+                }
             }
             for (var el in this._newSamplerInstances) {
                 var ea = el.toString().split('-');
-                if (ea[0] == 'sampler2D' && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady())
+                if (ea[0] == 'sampler2D' && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady()) {
                     effect.setTexture(ea[1], this._newSamplerInstances[el]);
+                }
             }
         };
         CustomMaterial.prototype.ReviewUniform = function (name, arr) {
             if (name == "uniform") {
-                for (var ind in this._newUniforms)
-                    if (this._customUniform[ind].indexOf('sampler') == -1)
+                for (var ind in this._newUniforms) {
+                    if (this._customUniform[ind].indexOf('sampler') == -1) {
                         arr.push(this._newUniforms[ind]);
+                    }
+                }
             }
             if (name == "sampler") {
-                for (var ind in this._newUniforms)
-                    if (this._customUniform[ind].indexOf('sampler') != -1)
+                for (var ind in this._newUniforms) {
+                    if (this._customUniform[ind].indexOf('sampler') != -1) {
                         arr.push(this._newUniforms[ind]);
+                    }
+                }
             }
             return arr;
         };
         CustomMaterial.prototype.Builder = function (shaderName, uniforms, uniformBuffers, samplers, defines) {
             var _this = this;
-            if (this._isCreatedShader)
+            if (this._isCreatedShader) {
                 return this._createdShaderName;
+            }
             this._isCreatedShader = false;
             CustomMaterial.ShaderIndexer++;
             var name = "custom_" + CustomMaterial.ShaderIndexer;
@@ -4098,7 +4108,6 @@ var BABYLON;
                     fn_afterBind(m, e);
                 }
                 catch (e) { }
-                ;
             };
             BABYLON.Effect.ShadersStore[name + "VertexShader"] = this.VertexShader
                 .replace('#define CUSTOM_VERTEX_BEGIN', (this.CustomParts.Vertex_Begin ? this.CustomParts.Vertex_Begin : ""))

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


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


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


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


+ 24 - 0
dist/preview release/serializers/babylon.glTF2Serializer.d.ts

@@ -441,6 +441,30 @@ declare module BABYLON.GLTF2 {
          */
         private static _GetMaxComponent(color);
         /**
+         * Convert a PBRMaterial (Metallic/Roughness) to Metallic Roughness factors.
+         * @param babylonPBRMaterial - BJS PBR Metallic Roughness Material.
+         * @param mimeType - mime type to use for the textures.
+         * @param images - array of glTF image interfaces.
+         * @param textures - array of glTF texture interfaces.
+         * @param glTFPbrMetallicRoughness - glTF PBR Metallic Roughness interface.
+         * @param imageData - map of image file name to data.
+         * @param hasTextureCoords - specifies if texture coordinates are present on the submesh to determine if textures should be applied.
+         * @returns - glTF PBR Metallic Roughness factors.
+         */
+        private static _ConvertMetalRoughFactorsToMetallicRoughness(babylonPBRMaterial, mimeType, images, textures, glTFPbrMetallicRoughness, imageData, hasTextureCoords);
+        /**
+         * Convert a PBRMaterial (Specular/Glossiness) to Metallic Roughness factors.
+         * @param babylonPBRMaterial - BJS PBR Metallic Roughness Material.
+         * @param mimeType - mime type to use for the textures.
+         * @param images - array of glTF image interfaces.
+         * @param textures - array of glTF texture interfaces.
+         * @param glTFPbrMetallicRoughness - glTF PBR Metallic Roughness interface.
+         * @param imageData - map of image file name to data.
+         * @param hasTextureCoords - specifies if texture coordinates are present on the submesh to determine if textures should be applied.
+         * @returns - glTF PBR Metallic Roughness factors.
+         */
+        private static _ConvertSpecGlossFactorsToMetallicRoughness(babylonPBRMaterial, mimeType, images, textures, glTFPbrMetallicRoughness, imageData, hasTextureCoords);
+        /**
          * Converts a Babylon PBR Metallic Roughness Material to a glTF Material.
          * @param babylonPBRMaterial - BJS PBR Metallic Roughness Material.
          * @param mimeType - mime type to use for the textures.

+ 88 - 52
dist/preview release/serializers/babylon.glTF2Serializer.js

@@ -1271,8 +1271,8 @@ var BABYLON;
                 for (var h = 0; h < height; ++h) {
                     for (var w = 0; w < width; ++w) {
                         var offset = (width * h + w) * strideSize;
-                        var diffuseColor = BABYLON.Color3.FromInts(diffuseBuffer[offset], diffuseBuffer[offset + 1], diffuseBuffer[offset + 2]).multiply(factors.diffuseColor);
-                        var specularColor = BABYLON.Color3.FromInts(specularGlossinessBuffer[offset], specularGlossinessBuffer[offset + 1], specularGlossinessBuffer[offset + 2]).multiply(factors.specularColor);
+                        var diffuseColor = BABYLON.Color3.FromInts(diffuseBuffer[offset], diffuseBuffer[offset + 1], diffuseBuffer[offset + 2]).toLinearSpace().multiply(factors.diffuseColor);
+                        var specularColor = BABYLON.Color3.FromInts(specularGlossinessBuffer[offset], specularGlossinessBuffer[offset + 1], specularGlossinessBuffer[offset + 2]).toLinearSpace().multiply(factors.specularColor);
                         var glossiness = (specularGlossinessBuffer[offset + 3] / 255) * factors.glossiness;
                         var specularGlossiness = {
                             diffuseColor: diffuseColor,
@@ -1289,7 +1289,7 @@ var BABYLON;
                         baseColorBuffer[offset + 1] = metallicRoughness.baseColor.g * 255;
                         baseColorBuffer[offset + 2] = metallicRoughness.baseColor.b * 255;
                         baseColorBuffer[offset + 3] = resizedTextures.texture1.hasAlpha ? diffuseBuffer[offset + 3] : 255;
-                        metallicRoughnessBuffer[offset] = 255;
+                        metallicRoughnessBuffer[offset] = 0;
                         metallicRoughnessBuffer[offset + 1] = metallicRoughness.roughness * 255;
                         metallicRoughnessBuffer[offset + 2] = metallicRoughness.metallic * 255;
                         metallicRoughnessBuffer[offset + 3] = 255;
@@ -1309,13 +1309,17 @@ var BABYLON;
                         baseColorBuffer[destinationOffset] /= metallicRoughnessFactors.baseColor.r > this._epsilon ? metallicRoughnessFactors.baseColor.r : 1;
                         baseColorBuffer[destinationOffset + 1] /= metallicRoughnessFactors.baseColor.g > this._epsilon ? metallicRoughnessFactors.baseColor.g : 1;
                         baseColorBuffer[destinationOffset + 2] /= metallicRoughnessFactors.baseColor.b > this._epsilon ? metallicRoughnessFactors.baseColor.b : 1;
-                        var baseColorPixel = new BABYLON.Color3(baseColorBuffer[destinationOffset], baseColorBuffer[destinationOffset + 1], baseColorBuffer[destinationOffset + 2]);
-                        if (!this.FuzzyEquals(baseColorPixel, BABYLON.Color3.White(), this._epsilon)) {
+                        var linearBaseColorPixel = BABYLON.Color3.FromInts(baseColorBuffer[destinationOffset], baseColorBuffer[destinationOffset + 1], baseColorBuffer[destinationOffset + 2]);
+                        var sRGBBaseColorPixel = linearBaseColorPixel.toGammaSpace();
+                        baseColorBuffer[destinationOffset] = sRGBBaseColorPixel.r * 255;
+                        baseColorBuffer[destinationOffset + 1] = sRGBBaseColorPixel.g * 255;
+                        baseColorBuffer[destinationOffset + 2] = sRGBBaseColorPixel.b * 255;
+                        if (!this.FuzzyEquals(sRGBBaseColorPixel, BABYLON.Color3.White(), this._epsilon)) {
                             writeOutBaseColorTexture = true;
                         }
                         metallicRoughnessBuffer[destinationOffset + 1] /= metallicRoughnessFactors.roughness > this._epsilon ? metallicRoughnessFactors.roughness : 1;
                         metallicRoughnessBuffer[destinationOffset + 2] /= metallicRoughnessFactors.metallic > this._epsilon ? metallicRoughnessFactors.metallic : 1;
-                        var metallicRoughnessPixel = new BABYLON.Color3(metallicRoughnessBuffer[destinationOffset], metallicRoughnessBuffer[destinationOffset + 1], metallicRoughnessBuffer[destinationOffset + 2]);
+                        var metallicRoughnessPixel = BABYLON.Color3.FromInts(255, metallicRoughnessBuffer[destinationOffset + 1], metallicRoughnessBuffer[destinationOffset + 2]);
                         if (!this.FuzzyEquals(metallicRoughnessPixel, BABYLON.Color3.White(), this._epsilon)) {
                             writeOutMetallicRoughnessTexture = true;
                         }
@@ -1375,6 +1379,81 @@ var BABYLON;
                 return 0;
             };
             /**
+             * Convert a PBRMaterial (Metallic/Roughness) to Metallic Roughness factors.
+             * @param babylonPBRMaterial - BJS PBR Metallic Roughness Material.
+             * @param mimeType - mime type to use for the textures.
+             * @param images - array of glTF image interfaces.
+             * @param textures - array of glTF texture interfaces.
+             * @param glTFPbrMetallicRoughness - glTF PBR Metallic Roughness interface.
+             * @param imageData - map of image file name to data.
+             * @param hasTextureCoords - specifies if texture coordinates are present on the submesh to determine if textures should be applied.
+             * @returns - glTF PBR Metallic Roughness factors.
+             */
+            _GLTFMaterial._ConvertMetalRoughFactorsToMetallicRoughness = function (babylonPBRMaterial, mimeType, images, textures, glTFPbrMetallicRoughness, imageData, hasTextureCoords) {
+                var metallicRoughness = {
+                    baseColor: babylonPBRMaterial.albedoColor,
+                    metallic: babylonPBRMaterial.metallic,
+                    roughness: babylonPBRMaterial.roughness
+                };
+                if (hasTextureCoords) {
+                    if (babylonPBRMaterial.albedoTexture) {
+                        var glTFTexture = _GLTFMaterial._ExportTexture(babylonPBRMaterial.albedoTexture, mimeType, images, textures, imageData);
+                        if (glTFTexture) {
+                            glTFPbrMetallicRoughness.baseColorTexture = glTFTexture;
+                        }
+                    }
+                    if (babylonPBRMaterial.metallicTexture) {
+                        var glTFTexture = _GLTFMaterial._ExportTexture(babylonPBRMaterial.metallicTexture, mimeType, images, textures, imageData);
+                        if (glTFTexture != null) {
+                            glTFPbrMetallicRoughness.metallicRoughnessTexture = glTFTexture;
+                        }
+                    }
+                }
+                return metallicRoughness;
+            };
+            /**
+             * Convert a PBRMaterial (Specular/Glossiness) to Metallic Roughness factors.
+             * @param babylonPBRMaterial - BJS PBR Metallic Roughness Material.
+             * @param mimeType - mime type to use for the textures.
+             * @param images - array of glTF image interfaces.
+             * @param textures - array of glTF texture interfaces.
+             * @param glTFPbrMetallicRoughness - glTF PBR Metallic Roughness interface.
+             * @param imageData - map of image file name to data.
+             * @param hasTextureCoords - specifies if texture coordinates are present on the submesh to determine if textures should be applied.
+             * @returns - glTF PBR Metallic Roughness factors.
+             */
+            _GLTFMaterial._ConvertSpecGlossFactorsToMetallicRoughness = function (babylonPBRMaterial, mimeType, images, textures, glTFPbrMetallicRoughness, imageData, hasTextureCoords) {
+                var specGloss = {
+                    diffuseColor: babylonPBRMaterial.albedoColor || BABYLON.Color3.White(),
+                    specularColor: babylonPBRMaterial.reflectivityColor || BABYLON.Color3.White(),
+                    glossiness: babylonPBRMaterial.microSurface || 1,
+                };
+                if (babylonPBRMaterial.reflectivityTexture && !babylonPBRMaterial.useMicroSurfaceFromReflectivityMapAlpha) {
+                    throw new Error("_ConvertPBRMaterial: Glossiness values not included in the reflectivity texture currently not supported");
+                }
+                var metallicRoughnessFactors = this._ConvertSpecularGlossinessTexturesToMetallicRoughness(babylonPBRMaterial.albedoTexture, babylonPBRMaterial.reflectivityTexture, specGloss, mimeType);
+                if (!metallicRoughnessFactors) {
+                    metallicRoughnessFactors = this._ConvertSpecularGlossinessToMetallicRoughness(specGloss);
+                }
+                else {
+                    if (hasTextureCoords) {
+                        if (metallicRoughnessFactors.baseColorTextureBase64) {
+                            var glTFBaseColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughnessFactors.baseColorTextureBase64, "bjsBaseColorTexture_" + (textures.length) + ".png", mimeType, images, textures, imageData);
+                            if (glTFBaseColorTexture != null) {
+                                glTFPbrMetallicRoughness.baseColorTexture = glTFBaseColorTexture;
+                            }
+                        }
+                        if (metallicRoughnessFactors.metallicRoughnessTextureBase64) {
+                            var glTFMRColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughnessFactors.metallicRoughnessTextureBase64, "bjsMetallicRoughnessTexture_" + (textures.length) + ".png", mimeType, images, textures, imageData);
+                            if (glTFMRColorTexture != null) {
+                                glTFPbrMetallicRoughness.metallicRoughnessTexture = glTFMRColorTexture;
+                            }
+                        }
+                    }
+                }
+                return metallicRoughnessFactors;
+            };
+            /**
              * Converts a Babylon PBR Metallic Roughness Material to a glTF Material.
              * @param babylonPBRMaterial - BJS PBR Metallic Roughness Material.
              * @param mimeType - mime type to use for the textures.
@@ -1391,42 +1470,11 @@ var BABYLON;
                     name: babylonPBRMaterial.name
                 };
                 var useMetallicRoughness = babylonPBRMaterial.isMetallicWorkflow();
-                if (!useMetallicRoughness) {
-                    var specGloss = {
-                        diffuseColor: babylonPBRMaterial.albedoColor || BABYLON.Color3.White(),
-                        specularColor: babylonPBRMaterial.reflectivityColor || BABYLON.Color3.White(),
-                        glossiness: babylonPBRMaterial.microSurface || 1,
-                    };
-                    if (babylonPBRMaterial.reflectivityTexture && !babylonPBRMaterial.useMicroSurfaceFromReflectivityMapAlpha) {
-                        throw new Error("_ConvertPBRMaterial: Glossiness values not included in the reflectivity texture currently not supported");
-                    }
-                    metallicRoughness = this._ConvertSpecularGlossinessTexturesToMetallicRoughness(babylonPBRMaterial.albedoTexture, babylonPBRMaterial.reflectivityTexture, specGloss, mimeType);
-                    if (!metallicRoughness) {
-                        metallicRoughness = this._ConvertSpecularGlossinessToMetallicRoughness(specGloss);
-                    }
-                    else {
-                        if (hasTextureCoords) {
-                            if (metallicRoughness.baseColorTextureBase64) {
-                                var glTFBaseColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughness.baseColorTextureBase64, "bjsBaseColorTexture_" + (textures.length) + ".png", mimeType, images, textures, imageData);
-                                if (glTFBaseColorTexture != null) {
-                                    glTFPbrMetallicRoughness.baseColorTexture = glTFBaseColorTexture;
-                                }
-                            }
-                            if (metallicRoughness.metallicRoughnessTextureBase64) {
-                                var glTFMRColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughness.metallicRoughnessTextureBase64, "bjsMetallicRoughnessTexture_" + (textures.length) + ".png", mimeType, images, textures, imageData);
-                                if (glTFMRColorTexture != null) {
-                                    glTFPbrMetallicRoughness.metallicRoughnessTexture = glTFMRColorTexture;
-                                }
-                            }
-                        }
-                    }
+                if (useMetallicRoughness) {
+                    metallicRoughness = this._ConvertMetalRoughFactorsToMetallicRoughness(babylonPBRMaterial, mimeType, images, textures, glTFPbrMetallicRoughness, imageData, hasTextureCoords);
                 }
                 else {
-                    metallicRoughness = {
-                        baseColor: babylonPBRMaterial.albedoColor,
-                        metallic: babylonPBRMaterial.metallic,
-                        roughness: babylonPBRMaterial.roughness
-                    };
+                    metallicRoughness = this._ConvertSpecGlossFactorsToMetallicRoughness(babylonPBRMaterial, mimeType, images, textures, glTFPbrMetallicRoughness, imageData, hasTextureCoords);
                 }
                 if (!(this.FuzzyEquals(metallicRoughness.baseColor, BABYLON.Color3.White(), this._epsilon) && babylonPBRMaterial.alpha >= this._epsilon)) {
                     glTFPbrMetallicRoughness.baseColorFactor = [
@@ -1449,12 +1497,6 @@ var BABYLON;
                     glTFMaterial.doubleSided = true;
                 }
                 if (hasTextureCoords) {
-                    if (useMetallicRoughness && babylonPBRMaterial.albedoTexture) {
-                        var glTFTexture = _GLTFMaterial._ExportTexture(babylonPBRMaterial.albedoTexture, mimeType, images, textures, imageData);
-                        if (glTFTexture) {
-                            glTFPbrMetallicRoughness.baseColorTexture = glTFTexture;
-                        }
-                    }
                     if (babylonPBRMaterial.bumpTexture) {
                         var glTFTexture = _GLTFMaterial._ExportTexture(babylonPBRMaterial.bumpTexture, mimeType, images, textures, imageData);
                         if (glTFTexture) {
@@ -1479,12 +1521,6 @@ var BABYLON;
                             glTFMaterial.emissiveTexture = glTFTexture;
                         }
                     }
-                    if (babylonPBRMaterial.metallicTexture) {
-                        var glTFTexture = _GLTFMaterial._ExportTexture(babylonPBRMaterial.metallicTexture, mimeType, images, textures, imageData);
-                        if (glTFTexture != null) {
-                            glTFPbrMetallicRoughness.metallicRoughnessTexture = glTFTexture;
-                        }
-                    }
                 }
                 if (!this.FuzzyEquals(babylonPBRMaterial.emissiveColor, BABYLON.Color3.Black(), this._epsilon)) {
                     glTFMaterial.emissiveFactor = babylonPBRMaterial.emissiveColor.asArray();

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


+ 88 - 52
dist/preview release/serializers/babylonjs.serializers.js

@@ -1425,8 +1425,8 @@ var BABYLON;
                 for (var h = 0; h < height; ++h) {
                     for (var w = 0; w < width; ++w) {
                         var offset = (width * h + w) * strideSize;
-                        var diffuseColor = BABYLON.Color3.FromInts(diffuseBuffer[offset], diffuseBuffer[offset + 1], diffuseBuffer[offset + 2]).multiply(factors.diffuseColor);
-                        var specularColor = BABYLON.Color3.FromInts(specularGlossinessBuffer[offset], specularGlossinessBuffer[offset + 1], specularGlossinessBuffer[offset + 2]).multiply(factors.specularColor);
+                        var diffuseColor = BABYLON.Color3.FromInts(diffuseBuffer[offset], diffuseBuffer[offset + 1], diffuseBuffer[offset + 2]).toLinearSpace().multiply(factors.diffuseColor);
+                        var specularColor = BABYLON.Color3.FromInts(specularGlossinessBuffer[offset], specularGlossinessBuffer[offset + 1], specularGlossinessBuffer[offset + 2]).toLinearSpace().multiply(factors.specularColor);
                         var glossiness = (specularGlossinessBuffer[offset + 3] / 255) * factors.glossiness;
                         var specularGlossiness = {
                             diffuseColor: diffuseColor,
@@ -1443,7 +1443,7 @@ var BABYLON;
                         baseColorBuffer[offset + 1] = metallicRoughness.baseColor.g * 255;
                         baseColorBuffer[offset + 2] = metallicRoughness.baseColor.b * 255;
                         baseColorBuffer[offset + 3] = resizedTextures.texture1.hasAlpha ? diffuseBuffer[offset + 3] : 255;
-                        metallicRoughnessBuffer[offset] = 255;
+                        metallicRoughnessBuffer[offset] = 0;
                         metallicRoughnessBuffer[offset + 1] = metallicRoughness.roughness * 255;
                         metallicRoughnessBuffer[offset + 2] = metallicRoughness.metallic * 255;
                         metallicRoughnessBuffer[offset + 3] = 255;
@@ -1463,13 +1463,17 @@ var BABYLON;
                         baseColorBuffer[destinationOffset] /= metallicRoughnessFactors.baseColor.r > this._epsilon ? metallicRoughnessFactors.baseColor.r : 1;
                         baseColorBuffer[destinationOffset + 1] /= metallicRoughnessFactors.baseColor.g > this._epsilon ? metallicRoughnessFactors.baseColor.g : 1;
                         baseColorBuffer[destinationOffset + 2] /= metallicRoughnessFactors.baseColor.b > this._epsilon ? metallicRoughnessFactors.baseColor.b : 1;
-                        var baseColorPixel = new BABYLON.Color3(baseColorBuffer[destinationOffset], baseColorBuffer[destinationOffset + 1], baseColorBuffer[destinationOffset + 2]);
-                        if (!this.FuzzyEquals(baseColorPixel, BABYLON.Color3.White(), this._epsilon)) {
+                        var linearBaseColorPixel = BABYLON.Color3.FromInts(baseColorBuffer[destinationOffset], baseColorBuffer[destinationOffset + 1], baseColorBuffer[destinationOffset + 2]);
+                        var sRGBBaseColorPixel = linearBaseColorPixel.toGammaSpace();
+                        baseColorBuffer[destinationOffset] = sRGBBaseColorPixel.r * 255;
+                        baseColorBuffer[destinationOffset + 1] = sRGBBaseColorPixel.g * 255;
+                        baseColorBuffer[destinationOffset + 2] = sRGBBaseColorPixel.b * 255;
+                        if (!this.FuzzyEquals(sRGBBaseColorPixel, BABYLON.Color3.White(), this._epsilon)) {
                             writeOutBaseColorTexture = true;
                         }
                         metallicRoughnessBuffer[destinationOffset + 1] /= metallicRoughnessFactors.roughness > this._epsilon ? metallicRoughnessFactors.roughness : 1;
                         metallicRoughnessBuffer[destinationOffset + 2] /= metallicRoughnessFactors.metallic > this._epsilon ? metallicRoughnessFactors.metallic : 1;
-                        var metallicRoughnessPixel = new BABYLON.Color3(metallicRoughnessBuffer[destinationOffset], metallicRoughnessBuffer[destinationOffset + 1], metallicRoughnessBuffer[destinationOffset + 2]);
+                        var metallicRoughnessPixel = BABYLON.Color3.FromInts(255, metallicRoughnessBuffer[destinationOffset + 1], metallicRoughnessBuffer[destinationOffset + 2]);
                         if (!this.FuzzyEquals(metallicRoughnessPixel, BABYLON.Color3.White(), this._epsilon)) {
                             writeOutMetallicRoughnessTexture = true;
                         }
@@ -1529,6 +1533,81 @@ var BABYLON;
                 return 0;
             };
             /**
+             * Convert a PBRMaterial (Metallic/Roughness) to Metallic Roughness factors.
+             * @param babylonPBRMaterial - BJS PBR Metallic Roughness Material.
+             * @param mimeType - mime type to use for the textures.
+             * @param images - array of glTF image interfaces.
+             * @param textures - array of glTF texture interfaces.
+             * @param glTFPbrMetallicRoughness - glTF PBR Metallic Roughness interface.
+             * @param imageData - map of image file name to data.
+             * @param hasTextureCoords - specifies if texture coordinates are present on the submesh to determine if textures should be applied.
+             * @returns - glTF PBR Metallic Roughness factors.
+             */
+            _GLTFMaterial._ConvertMetalRoughFactorsToMetallicRoughness = function (babylonPBRMaterial, mimeType, images, textures, glTFPbrMetallicRoughness, imageData, hasTextureCoords) {
+                var metallicRoughness = {
+                    baseColor: babylonPBRMaterial.albedoColor,
+                    metallic: babylonPBRMaterial.metallic,
+                    roughness: babylonPBRMaterial.roughness
+                };
+                if (hasTextureCoords) {
+                    if (babylonPBRMaterial.albedoTexture) {
+                        var glTFTexture = _GLTFMaterial._ExportTexture(babylonPBRMaterial.albedoTexture, mimeType, images, textures, imageData);
+                        if (glTFTexture) {
+                            glTFPbrMetallicRoughness.baseColorTexture = glTFTexture;
+                        }
+                    }
+                    if (babylonPBRMaterial.metallicTexture) {
+                        var glTFTexture = _GLTFMaterial._ExportTexture(babylonPBRMaterial.metallicTexture, mimeType, images, textures, imageData);
+                        if (glTFTexture != null) {
+                            glTFPbrMetallicRoughness.metallicRoughnessTexture = glTFTexture;
+                        }
+                    }
+                }
+                return metallicRoughness;
+            };
+            /**
+             * Convert a PBRMaterial (Specular/Glossiness) to Metallic Roughness factors.
+             * @param babylonPBRMaterial - BJS PBR Metallic Roughness Material.
+             * @param mimeType - mime type to use for the textures.
+             * @param images - array of glTF image interfaces.
+             * @param textures - array of glTF texture interfaces.
+             * @param glTFPbrMetallicRoughness - glTF PBR Metallic Roughness interface.
+             * @param imageData - map of image file name to data.
+             * @param hasTextureCoords - specifies if texture coordinates are present on the submesh to determine if textures should be applied.
+             * @returns - glTF PBR Metallic Roughness factors.
+             */
+            _GLTFMaterial._ConvertSpecGlossFactorsToMetallicRoughness = function (babylonPBRMaterial, mimeType, images, textures, glTFPbrMetallicRoughness, imageData, hasTextureCoords) {
+                var specGloss = {
+                    diffuseColor: babylonPBRMaterial.albedoColor || BABYLON.Color3.White(),
+                    specularColor: babylonPBRMaterial.reflectivityColor || BABYLON.Color3.White(),
+                    glossiness: babylonPBRMaterial.microSurface || 1,
+                };
+                if (babylonPBRMaterial.reflectivityTexture && !babylonPBRMaterial.useMicroSurfaceFromReflectivityMapAlpha) {
+                    throw new Error("_ConvertPBRMaterial: Glossiness values not included in the reflectivity texture currently not supported");
+                }
+                var metallicRoughnessFactors = this._ConvertSpecularGlossinessTexturesToMetallicRoughness(babylonPBRMaterial.albedoTexture, babylonPBRMaterial.reflectivityTexture, specGloss, mimeType);
+                if (!metallicRoughnessFactors) {
+                    metallicRoughnessFactors = this._ConvertSpecularGlossinessToMetallicRoughness(specGloss);
+                }
+                else {
+                    if (hasTextureCoords) {
+                        if (metallicRoughnessFactors.baseColorTextureBase64) {
+                            var glTFBaseColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughnessFactors.baseColorTextureBase64, "bjsBaseColorTexture_" + (textures.length) + ".png", mimeType, images, textures, imageData);
+                            if (glTFBaseColorTexture != null) {
+                                glTFPbrMetallicRoughness.baseColorTexture = glTFBaseColorTexture;
+                            }
+                        }
+                        if (metallicRoughnessFactors.metallicRoughnessTextureBase64) {
+                            var glTFMRColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughnessFactors.metallicRoughnessTextureBase64, "bjsMetallicRoughnessTexture_" + (textures.length) + ".png", mimeType, images, textures, imageData);
+                            if (glTFMRColorTexture != null) {
+                                glTFPbrMetallicRoughness.metallicRoughnessTexture = glTFMRColorTexture;
+                            }
+                        }
+                    }
+                }
+                return metallicRoughnessFactors;
+            };
+            /**
              * Converts a Babylon PBR Metallic Roughness Material to a glTF Material.
              * @param babylonPBRMaterial - BJS PBR Metallic Roughness Material.
              * @param mimeType - mime type to use for the textures.
@@ -1545,42 +1624,11 @@ var BABYLON;
                     name: babylonPBRMaterial.name
                 };
                 var useMetallicRoughness = babylonPBRMaterial.isMetallicWorkflow();
-                if (!useMetallicRoughness) {
-                    var specGloss = {
-                        diffuseColor: babylonPBRMaterial.albedoColor || BABYLON.Color3.White(),
-                        specularColor: babylonPBRMaterial.reflectivityColor || BABYLON.Color3.White(),
-                        glossiness: babylonPBRMaterial.microSurface || 1,
-                    };
-                    if (babylonPBRMaterial.reflectivityTexture && !babylonPBRMaterial.useMicroSurfaceFromReflectivityMapAlpha) {
-                        throw new Error("_ConvertPBRMaterial: Glossiness values not included in the reflectivity texture currently not supported");
-                    }
-                    metallicRoughness = this._ConvertSpecularGlossinessTexturesToMetallicRoughness(babylonPBRMaterial.albedoTexture, babylonPBRMaterial.reflectivityTexture, specGloss, mimeType);
-                    if (!metallicRoughness) {
-                        metallicRoughness = this._ConvertSpecularGlossinessToMetallicRoughness(specGloss);
-                    }
-                    else {
-                        if (hasTextureCoords) {
-                            if (metallicRoughness.baseColorTextureBase64) {
-                                var glTFBaseColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughness.baseColorTextureBase64, "bjsBaseColorTexture_" + (textures.length) + ".png", mimeType, images, textures, imageData);
-                                if (glTFBaseColorTexture != null) {
-                                    glTFPbrMetallicRoughness.baseColorTexture = glTFBaseColorTexture;
-                                }
-                            }
-                            if (metallicRoughness.metallicRoughnessTextureBase64) {
-                                var glTFMRColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughness.metallicRoughnessTextureBase64, "bjsMetallicRoughnessTexture_" + (textures.length) + ".png", mimeType, images, textures, imageData);
-                                if (glTFMRColorTexture != null) {
-                                    glTFPbrMetallicRoughness.metallicRoughnessTexture = glTFMRColorTexture;
-                                }
-                            }
-                        }
-                    }
+                if (useMetallicRoughness) {
+                    metallicRoughness = this._ConvertMetalRoughFactorsToMetallicRoughness(babylonPBRMaterial, mimeType, images, textures, glTFPbrMetallicRoughness, imageData, hasTextureCoords);
                 }
                 else {
-                    metallicRoughness = {
-                        baseColor: babylonPBRMaterial.albedoColor,
-                        metallic: babylonPBRMaterial.metallic,
-                        roughness: babylonPBRMaterial.roughness
-                    };
+                    metallicRoughness = this._ConvertSpecGlossFactorsToMetallicRoughness(babylonPBRMaterial, mimeType, images, textures, glTFPbrMetallicRoughness, imageData, hasTextureCoords);
                 }
                 if (!(this.FuzzyEquals(metallicRoughness.baseColor, BABYLON.Color3.White(), this._epsilon) && babylonPBRMaterial.alpha >= this._epsilon)) {
                     glTFPbrMetallicRoughness.baseColorFactor = [
@@ -1603,12 +1651,6 @@ var BABYLON;
                     glTFMaterial.doubleSided = true;
                 }
                 if (hasTextureCoords) {
-                    if (useMetallicRoughness && babylonPBRMaterial.albedoTexture) {
-                        var glTFTexture = _GLTFMaterial._ExportTexture(babylonPBRMaterial.albedoTexture, mimeType, images, textures, imageData);
-                        if (glTFTexture) {
-                            glTFPbrMetallicRoughness.baseColorTexture = glTFTexture;
-                        }
-                    }
                     if (babylonPBRMaterial.bumpTexture) {
                         var glTFTexture = _GLTFMaterial._ExportTexture(babylonPBRMaterial.bumpTexture, mimeType, images, textures, imageData);
                         if (glTFTexture) {
@@ -1633,12 +1675,6 @@ var BABYLON;
                             glTFMaterial.emissiveTexture = glTFTexture;
                         }
                     }
-                    if (babylonPBRMaterial.metallicTexture) {
-                        var glTFTexture = _GLTFMaterial._ExportTexture(babylonPBRMaterial.metallicTexture, mimeType, images, textures, imageData);
-                        if (glTFTexture != null) {
-                            glTFPbrMetallicRoughness.metallicRoughnessTexture = glTFTexture;
-                        }
-                    }
                 }
                 if (!this.FuzzyEquals(babylonPBRMaterial.emissiveColor, BABYLON.Color3.Black(), this._epsilon)) {
                     glTFMaterial.emissiveFactor = babylonPBRMaterial.emissiveColor.asArray();

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


+ 24 - 0
dist/preview release/serializers/babylonjs.serializers.module.d.ts

@@ -456,6 +456,30 @@ declare module BABYLON.GLTF2 {
          */
         private static _GetMaxComponent(color);
         /**
+         * Convert a PBRMaterial (Metallic/Roughness) to Metallic Roughness factors.
+         * @param babylonPBRMaterial - BJS PBR Metallic Roughness Material.
+         * @param mimeType - mime type to use for the textures.
+         * @param images - array of glTF image interfaces.
+         * @param textures - array of glTF texture interfaces.
+         * @param glTFPbrMetallicRoughness - glTF PBR Metallic Roughness interface.
+         * @param imageData - map of image file name to data.
+         * @param hasTextureCoords - specifies if texture coordinates are present on the submesh to determine if textures should be applied.
+         * @returns - glTF PBR Metallic Roughness factors.
+         */
+        private static _ConvertMetalRoughFactorsToMetallicRoughness(babylonPBRMaterial, mimeType, images, textures, glTFPbrMetallicRoughness, imageData, hasTextureCoords);
+        /**
+         * Convert a PBRMaterial (Specular/Glossiness) to Metallic Roughness factors.
+         * @param babylonPBRMaterial - BJS PBR Metallic Roughness Material.
+         * @param mimeType - mime type to use for the textures.
+         * @param images - array of glTF image interfaces.
+         * @param textures - array of glTF texture interfaces.
+         * @param glTFPbrMetallicRoughness - glTF PBR Metallic Roughness interface.
+         * @param imageData - map of image file name to data.
+         * @param hasTextureCoords - specifies if texture coordinates are present on the submesh to determine if textures should be applied.
+         * @returns - glTF PBR Metallic Roughness factors.
+         */
+        private static _ConvertSpecGlossFactorsToMetallicRoughness(babylonPBRMaterial, mimeType, images, textures, glTFPbrMetallicRoughness, imageData, hasTextureCoords);
+        /**
          * Converts a Babylon PBR Metallic Roughness Material to a glTF Material.
          * @param babylonPBRMaterial - BJS PBR Metallic Roughness Material.
          * @param mimeType - mime type to use for the textures.

+ 2 - 31
dist/preview release/typedocValidationBaseline.json

@@ -1,7 +1,7 @@
 {
-  "errors": 7184,
+  "errors": 7179,
   "babylon.typedoc.json": {
-    "errors": 7184,
+    "errors": 7179,
     "AnimationKeyInterpolation": {
       "Enumeration": {
         "Comments": {
@@ -24108,35 +24108,6 @@
             }
           }
         },
-        "toEulerAngles": {
-          "Comments": {
-            "MissingReturn": true
-          },
-          "Parameter": {
-            "order": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "toEulerAnglesToRef": {
-          "Comments": {
-            "MissingReturn": true
-          },
-          "Parameter": {
-            "result": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "order": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
         "toRotationMatrix": {
           "Comments": {
             "MissingReturn": true

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


+ 25 - 21
dist/preview release/viewer/babylon.viewer.max.js

@@ -4466,7 +4466,9 @@ var BABYLON;
             return this;
         };
         /**
-         * Returns a new Vector3 set with the Euler angles translated from the current Quaternion.
+         * Returns a new Vector3 set with the Euler angles translated from the current Quaternion
+         * @param order is a reserved parameter and is ignore for now
+         * @returns the new Vector3
          */
         Quaternion.prototype.toEulerAngles = function (order) {
             if (order === void 0) { order = "YZX"; }
@@ -4475,8 +4477,10 @@ var BABYLON;
             return result;
         };
         /**
-         * Sets the passed vector3 "result" with the Euler angles translated from the current Quaternion.
-         * Returns the current Quaternion.
+         * Sets the passed vector3 "result" with the Euler angles translated from the current Quaternion
+         * @param result defines the vector which will be filled with the Euler angles
+         * @param order is a reserved parameter and is ignore for now
+         * @returns the current Quaternion
          */
         Quaternion.prototype.toEulerAnglesToRef = function (result, order) {
             if (order === void 0) { order = "YZX"; }
@@ -22503,11 +22507,11 @@ var BABYLON;
                 }
             }
             if (pickResult) {
+                var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE;
                 if (this.onPointerMove) {
-                    this.onPointerMove(evt, pickResult);
+                    this.onPointerMove(evt, pickResult, type);
                 }
                 if (this.onPointerObservable.hasObservers()) {
-                    var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
@@ -22561,11 +22565,11 @@ var BABYLON;
                 }
             }
             if (pickResult) {
+                var type = BABYLON.PointerEventTypes.POINTERDOWN;
                 if (this.onPointerDown) {
-                    this.onPointerDown(evt, pickResult);
+                    this.onPointerDown(evt, pickResult, type);
                 }
                 if (this.onPointerObservable.hasObservers()) {
-                    var type = BABYLON.PointerEventTypes.POINTERDOWN;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
@@ -22593,9 +22597,9 @@ var BABYLON;
                         this.onPointerPick(evt, pickResult);
                     }
                     if (clickInfo.singleClick && !clickInfo.ignore && this.onPointerObservable.hasObservers()) {
-                        var type = BABYLON.PointerEventTypes.POINTERPICK;
-                        var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                        this.onPointerObservable.notifyObservers(pi, type);
+                        var type_1 = BABYLON.PointerEventTypes.POINTERPICK;
+                        var pi = new BABYLON.PointerInfo(type_1, evt, pickResult);
+                        this.onPointerObservable.notifyObservers(pi, type_1);
                     }
                 }
                 if (pickResult.pickedMesh.actionManager) {
@@ -22616,30 +22620,30 @@ var BABYLON;
                 this._pickedDownMesh !== this._pickedUpMesh) {
                 this._pickedDownMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickOutTrigger, BABYLON.ActionEvent.CreateNew(this._pickedDownMesh, evt));
             }
-            if (this.onPointerUp) {
-                this.onPointerUp(evt, pickResult);
-            }
+            var type = BABYLON.PointerEventTypes.POINTERUP;
             if (this.onPointerObservable.hasObservers()) {
                 if (!clickInfo.ignore) {
                     if (!clickInfo.hasSwiped) {
                         if (clickInfo.singleClick && this.onPointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERTAP)) {
-                            var type = BABYLON.PointerEventTypes.POINTERTAP;
-                            var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                            this.onPointerObservable.notifyObservers(pi, type);
+                            var type_2 = BABYLON.PointerEventTypes.POINTERTAP;
+                            var pi = new BABYLON.PointerInfo(type_2, evt, pickResult);
+                            this.onPointerObservable.notifyObservers(pi, type_2);
                         }
                         if (clickInfo.doubleClick && this.onPointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP)) {
-                            var type = BABYLON.PointerEventTypes.POINTERDOUBLETAP;
-                            var pi = new BABYLON.PointerInfo(type, evt, pickResult);
-                            this.onPointerObservable.notifyObservers(pi, type);
+                            var type_3 = BABYLON.PointerEventTypes.POINTERDOUBLETAP;
+                            var pi = new BABYLON.PointerInfo(type_3, evt, pickResult);
+                            this.onPointerObservable.notifyObservers(pi, type_3);
                         }
                     }
                 }
                 else {
-                    var type = BABYLON.PointerEventTypes.POINTERUP;
                     var pi = new BABYLON.PointerInfo(type, evt, pickResult);
                     this.onPointerObservable.notifyObservers(pi, type);
                 }
             }
+            if (this.onPointerUp) {
+                this.onPointerUp(evt, pickResult, type);
+            }
             return this;
         };
         /**
@@ -32067,7 +32071,7 @@ var BABYLON;
          * @returns - Parsed material.
          */
         Material.Parse = function (parsedMaterial, scene, rootUrl) {
-            if (!parsedMaterial.customType) {
+            if (!parsedMaterial.customType || parsedMaterial.customType === "BABYLON.StandardMaterial") {
                 return BABYLON.StandardMaterial.Parse(parsedMaterial, scene, rootUrl);
             }
             if (parsedMaterial.customType === "BABYLON.PBRMaterial" && parsedMaterial.overloadedAlbedo) {

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

@@ -3163,7 +3163,7 @@
         /**
          * Returns a new Vector3 set with the Euler angles translated from the current Quaternion
          * @param order is a reserved parameter and is ignore for now
-         * @returnsthe new Vector3
+         * @returns the new Vector3
          */
         public toEulerAngles(order = "YZX"): Vector3 {
             var result = Vector3.Zero();