Sebastien Vandenberghe 7 år sedan
förälder
incheckning
6435a1981d
52 ändrade filer med 205119 tillägg och 40682 borttagningar
  1. 15287 15243
      Playground/babylon.d.txt
  2. 15821 15816
      dist/preview release/babylon.d.ts
  3. 61 25
      dist/preview release/babylon.js
  4. 57598 3159
      dist/preview release/babylon.max.js
  5. 57598 3159
      dist/preview release/babylon.no-module.max.js
  6. 61 25
      dist/preview release/babylon.worker.js
  7. 57600 3161
      dist/preview release/es6.js
  8. 3 1
      dist/preview release/inspector/babylon.inspector.d.ts
  9. 46 10
      dist/preview release/inspector/babylon.inspector.js
  10. 4 4
      dist/preview release/inspector/babylon.inspector.min.js
  11. 13 0
      dist/preview release/proceduralTexturesLibrary/babylon.cloudProceduralTexture.d.ts
  12. 32 0
      dist/preview release/proceduralTexturesLibrary/babylon.cloudProceduralTexture.js
  13. 1 1
      dist/preview release/proceduralTexturesLibrary/babylon.cloudProceduralTexture.min.js
  14. 13 0
      dist/preview release/proceduralTexturesLibrary/babylon.fireProceduralTexture.d.ts
  15. 38 0
      dist/preview release/proceduralTexturesLibrary/babylon.fireProceduralTexture.js
  16. 1 1
      dist/preview release/proceduralTexturesLibrary/babylon.fireProceduralTexture.min.js
  17. 13 0
      dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.d.ts
  18. 32 0
      dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.js
  19. 1 1
      dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.min.js
  20. 13 0
      dist/preview release/proceduralTexturesLibrary/babylon.marbleProceduralTexture.d.ts
  21. 38 0
      dist/preview release/proceduralTexturesLibrary/babylon.marbleProceduralTexture.js
  22. 1 1
      dist/preview release/proceduralTexturesLibrary/babylon.marbleProceduralTexture.min.js
  23. 13 0
      dist/preview release/proceduralTexturesLibrary/babylon.normalMapProceduralTexture.d.ts
  24. 29 0
      dist/preview release/proceduralTexturesLibrary/babylon.normalMapProceduralTexture.js
  25. 1 1
      dist/preview release/proceduralTexturesLibrary/babylon.normalMapProceduralTexture.min.js
  26. 13 0
      dist/preview release/proceduralTexturesLibrary/babylon.perlinNoiseProceduralTexture.d.ts
  27. 35 0
      dist/preview release/proceduralTexturesLibrary/babylon.perlinNoiseProceduralTexture.js
  28. 1 1
      dist/preview release/proceduralTexturesLibrary/babylon.perlinNoiseProceduralTexture.min.js
  29. 13 0
      dist/preview release/proceduralTexturesLibrary/babylon.roadProceduralTexture.d.ts
  30. 29 0
      dist/preview release/proceduralTexturesLibrary/babylon.roadProceduralTexture.js
  31. 1 1
      dist/preview release/proceduralTexturesLibrary/babylon.roadProceduralTexture.min.js
  32. 13 0
      dist/preview release/proceduralTexturesLibrary/babylon.starfieldProceduralTexture.d.ts
  33. 59 0
      dist/preview release/proceduralTexturesLibrary/babylon.starfieldProceduralTexture.js
  34. 1 1
      dist/preview release/proceduralTexturesLibrary/babylon.starfieldProceduralTexture.min.js
  35. 13 0
      dist/preview release/proceduralTexturesLibrary/babylon.woodProceduralTexture.d.ts
  36. 32 0
      dist/preview release/proceduralTexturesLibrary/babylon.woodProceduralTexture.js
  37. 1 1
      dist/preview release/proceduralTexturesLibrary/babylon.woodProceduralTexture.min.js
  38. 117 0
      dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.d.ts
  39. 279 0
      dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.js
  40. 1 1
      dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js
  41. 117 0
      dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.module.d.ts
  42. 2 2
      dist/preview release/serializers/babylon.glTF2Serializer.d.ts
  43. 15 24
      dist/preview release/serializers/babylon.glTF2Serializer.js
  44. 1 1
      dist/preview release/serializers/babylon.glTF2Serializer.min.js
  45. 2 2
      dist/preview release/serializers/babylonjs.serializers.d.ts
  46. 15 24
      dist/preview release/serializers/babylonjs.serializers.js
  47. 1 1
      dist/preview release/serializers/babylonjs.serializers.min.js
  48. 2 2
      dist/preview release/serializers/babylonjs.serializers.module.d.ts
  49. 12 12
      dist/preview release/viewer/babylon.viewer.js
  50. 16 1
      dist/preview release/viewer/babylon.viewer.max.js
  51. 2 0
      sandbox/index.js
  52. 8 0
      src/Engine/babylon.engine.ts

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 15287 - 15243
Playground/babylon.d.txt


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 15821 - 15816
dist/preview release/babylon.d.ts


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 61 - 25
dist/preview release/babylon.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 57598 - 3159
dist/preview release/babylon.max.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 57598 - 3159
dist/preview release/babylon.no-module.max.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 61 - 25
dist/preview release/babylon.worker.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 57600 - 3161
dist/preview release/es6.js


+ 3 - 1
dist/preview release/inspector/babylon.inspector.d.ts

@@ -471,7 +471,9 @@ declare module INSPECTOR {
         private _property;
         /** The obj this property refers to */
         private _obj;
-        constructor(prop: string, obj: any);
+        /** The obj parent  */
+        private _parentObj;
+        constructor(prop: string, obj: any, parentObj?: PropertyLine);
         readonly name: string;
         value: any;
         readonly type: string;

+ 46 - 10
dist/preview release/inspector/babylon.inspector.js

@@ -308,7 +308,6 @@ var INSPECTOR;
                 return;
             }
             popup.document.title = "Babylon.js INSPECTOR";
-            popup.document.body.innerHTML = "Coucou!";
             // Get the inspector style      
             var styles = Inspector.DOCUMENT.querySelectorAll('style');
             for (var s = 0; s < styles.length; s++) {
@@ -1363,9 +1362,10 @@ var INSPECTOR;
      * A property is a link between a data (string) and an object.
      */
     var Property = /** @class */ (function () {
-        function Property(prop, obj) {
+        function Property(prop, obj, parentObj) {
             this._property = prop;
             this._obj = obj;
+            this._parentObj = parentObj || null;
         }
         Object.defineProperty(Property.prototype, "name", {
             get: function () {
@@ -1379,6 +1379,45 @@ var INSPECTOR;
                 return this._obj[this._property];
             },
             set: function (newValue) {
+                if (newValue != undefined && this._obj[this._property] != undefined) {
+                    if (this._obj instanceof BABYLON.Scene) {
+                        this._obj.debugLayer.onGlobalPropertyChangeCallback({
+                            object: this._obj,
+                            property: this._property,
+                            value: newValue,
+                            initialValue: this._obj[this._property]
+                        });
+                    }
+                    else {
+                        if (this._parentObj != null) {
+                            // Object that have "children" properties : Color, Vector, imageProcessingConfiguration
+                            if (this._parentObj instanceof BABYLON.Scene) {
+                                this._parentObj.debugLayer.onGlobalPropertyChangeCallback({
+                                    object: this._parentObj,
+                                    property: this._property,
+                                    value: newValue,
+                                    initialValue: this._obj[this._property]
+                                });
+                            }
+                            else {
+                                this._parentObj.getScene().debugLayer.onGlobalPropertyChangeCallback({
+                                    object: this._parentObj,
+                                    property: this._property,
+                                    value: newValue,
+                                    initialValue: this._obj[this._property]
+                                });
+                            }
+                        }
+                        else {
+                            this._obj.getScene().debugLayer.onGlobalPropertyChangeCallback({
+                                object: this._obj,
+                                property: this._property,
+                                value: newValue,
+                                initialValue: this._obj[this._property]
+                            });
+                        }
+                    }
+                }
                 this._obj[this._property] = newValue;
             },
             enumerable: true,
@@ -1516,8 +1555,7 @@ var INSPECTOR;
                 e.preventDefault();
                 this.validateInput(this._input.value);
             }
-            else if (e.keyCode == 27) {
-                // Esc : remove input
+            else if (e.keyCode == 27) { // Esc : remove input
                 this.update();
             }
         };
@@ -1826,20 +1864,20 @@ var INSPECTOR;
                     }
                     for (var _b = 0, propToDisplay_1 = propToDisplay; _b < propToDisplay_1.length; _b++) {
                         var prop = propToDisplay_1[_b];
-                        var infos = new INSPECTOR.Property(prop, this._property.value);
+                        var infos = new INSPECTOR.Property(prop, this._property.value, this._property.obj);
                         var child = new PropertyLine(infos, this, this._level + PropertyLine._MARGIN_LEFT);
                         this._children.push(child);
                     }
                     //Add the Hexa converter
                     if ((propToDisplay.indexOf('r') && propToDisplay.indexOf('g') && propToDisplay.indexOf('b') && propToDisplay.indexOf('a')) == 0) {
                         var hexLineInfos = [];
-                        var hexLinePropCheck = new INSPECTOR.Property("hexEnable", this._property.value);
+                        var hexLinePropCheck = new INSPECTOR.Property("hexEnable", this._property.value, this._property.obj);
                         hexLinePropCheck.value = false;
                         var hexLineCheck = new PropertyLine(hexLinePropCheck, this, this._level + PropertyLine._MARGIN_LEFT);
                         this._children.unshift(hexLineCheck);
                         for (var _c = 0, propToDisplay_2 = propToDisplay; _c < propToDisplay_2.length; _c++) {
                             var prop = propToDisplay_2[_c];
-                            var infos = new INSPECTOR.Property(prop, this._property.value);
+                            var infos = new INSPECTOR.Property(prop, this._property.value, this._property.obj);
                             var valHex = ((infos.value * 255) | 0).toString(16);
                             hexLineInfos.push(valHex);
                             if (valHex == "0") {
@@ -1849,7 +1887,7 @@ var INSPECTOR;
                         hexLineInfos.push("#");
                         hexLineInfos.reverse();
                         var hexLineString = hexLineInfos.join("");
-                        var hexLineProp = new INSPECTOR.Property("hex", this._property.value);
+                        var hexLineProp = new INSPECTOR.Property("hex", this._property.value, this._property.obj);
                         hexLineProp.value = hexLineString;
                         var hexLine = new PropertyLine(hexLineProp, this, this._level + PropertyLine._MARGIN_LEFT);
                         this._children.unshift(hexLine);
@@ -2425,7 +2463,6 @@ var INSPECTOR;
          * Returns true if the user browser is edge.
          */
         Helpers.IsBrowserEdge = function () {
-            //Detect if we are running on a faulty buggy OS.
             var regexp = /Edge/;
             return regexp.test(navigator.userAgent);
         };
@@ -2433,7 +2470,6 @@ var INSPECTOR;
          * Returns true if the user browser is IE.
          */
         Helpers.IsBrowserIE = function () {
-            //Detect if we are running on a faulty buggy OS.
             var regexp = /Trident.*rv\:11\./;
             return regexp.test(navigator.userAgent);
         };

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 4 - 4
dist/preview release/inspector/babylon.inspector.min.js


+ 13 - 0
dist/preview release/proceduralTexturesLibrary/babylon.cloudProceduralTexture.d.ts

@@ -7,5 +7,18 @@ declare module BABYLON {
         updateShaderUniforms(): void;
         skyColor: Color4;
         cloudColor: Color4;
+        /**
+         * Serializes this cloud procedural texture
+         * @returns a serialized cloud procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Cloud Procedural Texture from parsed cloud procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing cloud procedural texture information
+         * @returns a parsed Cloud Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): CloudProceduralTexture;
     }
 }

+ 32 - 0
dist/preview release/proceduralTexturesLibrary/babylon.cloudProceduralTexture.js

@@ -9,6 +9,12 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
 var BABYLON;
 (function (BABYLON) {
     var CloudProceduralTexture = /** @class */ (function (_super) {
@@ -46,6 +52,32 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this cloud procedural texture
+         * @returns a serialized cloud procedural texture object
+         */
+        CloudProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.CloudProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Cloud Procedural Texture from parsed cloud procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing cloud procedural texture information
+         * @returns a parsed Cloud Procedural Texture
+         */
+        CloudProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new CloudProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serializeAsColor4()
+        ], CloudProceduralTexture.prototype, "skyColor", null);
+        __decorate([
+            BABYLON.serializeAsColor4()
+        ], CloudProceduralTexture.prototype, "cloudColor", null);
         return CloudProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.CloudProceduralTexture = CloudProceduralTexture;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/proceduralTexturesLibrary/babylon.cloudProceduralTexture.min.js


+ 13 - 0
dist/preview release/proceduralTexturesLibrary/babylon.fireProceduralTexture.d.ts

@@ -17,5 +17,18 @@ declare module BABYLON {
         time: number;
         speed: Vector2;
         alphaThreshold: number;
+        /**
+         * Serializes this fire procedural texture
+         * @returns a serialized fire procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Fire Procedural Texture from parsed fire procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing fire procedural texture information
+         * @returns a parsed Fire Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): FireProceduralTexture;
     }
 }

+ 38 - 0
dist/preview release/proceduralTexturesLibrary/babylon.fireProceduralTexture.js

@@ -9,6 +9,12 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
 var BABYLON;
 (function (BABYLON) {
     var FireProceduralTexture = /** @class */ (function (_super) {
@@ -142,6 +148,38 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this fire procedural texture
+         * @returns a serialized fire procedural texture object
+         */
+        FireProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.FireProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Fire Procedural Texture from parsed fire procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing fire procedural texture information
+         * @returns a parsed Fire Procedural Texture
+         */
+        FireProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new FireProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serializeAsColor3()
+        ], FireProceduralTexture.prototype, "fireColors", null);
+        __decorate([
+            BABYLON.serialize()
+        ], FireProceduralTexture.prototype, "time", null);
+        __decorate([
+            BABYLON.serializeAsVector2()
+        ], FireProceduralTexture.prototype, "speed", null);
+        __decorate([
+            BABYLON.serialize()
+        ], FireProceduralTexture.prototype, "alphaThreshold", null);
         return FireProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.FireProceduralTexture = FireProceduralTexture;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/proceduralTexturesLibrary/babylon.fireProceduralTexture.min.js


+ 13 - 0
dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.d.ts

@@ -7,5 +7,18 @@ declare module BABYLON {
         updateShaderUniforms(): void;
         grassColors: Color3[];
         groundColor: Color3;
+        /**
+         * Serializes this grass procedural texture
+         * @returns a serialized grass procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Grass Procedural Texture from parsed grass procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing grass procedural texture information
+         * @returns a parsed Grass Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): GrassProceduralTexture;
     }
 }

+ 32 - 0
dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.js

@@ -9,6 +9,12 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
 var BABYLON;
 (function (BABYLON) {
     var GrassProceduralTexture = /** @class */ (function (_super) {
@@ -52,6 +58,32 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this grass procedural texture
+         * @returns a serialized grass procedural texture object
+         */
+        GrassProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.GrassProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Grass Procedural Texture from parsed grass procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing grass procedural texture information
+         * @returns a parsed Grass Procedural Texture
+         */
+        GrassProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new GrassProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serializeAsColor3()
+        ], GrassProceduralTexture.prototype, "grassColors", null);
+        __decorate([
+            BABYLON.serializeAsColor3()
+        ], GrassProceduralTexture.prototype, "groundColor", null);
         return GrassProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.GrassProceduralTexture = GrassProceduralTexture;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.min.js


+ 13 - 0
dist/preview release/proceduralTexturesLibrary/babylon.marbleProceduralTexture.d.ts

@@ -11,5 +11,18 @@ declare module BABYLON {
         amplitude: number;
         numberOfTilesWidth: number;
         jointColor: Color3;
+        /**
+         * Serializes this marble procedural texture
+         * @returns a serialized marble procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Marble Procedural Texture from parsed marble procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing marble procedural texture information
+         * @returns a parsed Marble Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): MarbleProceduralTexture;
     }
 }

+ 38 - 0
dist/preview release/proceduralTexturesLibrary/babylon.marbleProceduralTexture.js

@@ -9,6 +9,12 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
 var BABYLON;
 (function (BABYLON) {
     var MarbleProceduralTexture = /** @class */ (function (_super) {
@@ -72,6 +78,38 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this marble procedural texture
+         * @returns a serialized marble procedural texture object
+         */
+        MarbleProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.MarbleProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Marble Procedural Texture from parsed marble procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing marble procedural texture information
+         * @returns a parsed Marble Procedural Texture
+         */
+        MarbleProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new MarbleProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serialize()
+        ], MarbleProceduralTexture.prototype, "numberOfTilesHeight", null);
+        __decorate([
+            BABYLON.serialize()
+        ], MarbleProceduralTexture.prototype, "amplitude", null);
+        __decorate([
+            BABYLON.serialize()
+        ], MarbleProceduralTexture.prototype, "numberOfTilesWidth", null);
+        __decorate([
+            BABYLON.serialize()
+        ], MarbleProceduralTexture.prototype, "jointColor", null);
         return MarbleProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.MarbleProceduralTexture = MarbleProceduralTexture;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/proceduralTexturesLibrary/babylon.marbleProceduralTexture.min.js


+ 13 - 0
dist/preview release/proceduralTexturesLibrary/babylon.normalMapProceduralTexture.d.ts

@@ -7,5 +7,18 @@ declare module BABYLON {
         render(useCameraPostProcess?: boolean): void;
         resize(size: any, generateMipMaps: any): void;
         baseTexture: Texture;
+        /**
+         * Serializes this normal map procedural texture
+         * @returns a serialized normal map procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Normal Map Procedural Texture from parsed normal map procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing normal map procedural texture information
+         * @returns a parsed Normal Map Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): NormalMapProceduralTexture;
     }
 }

+ 29 - 0
dist/preview release/proceduralTexturesLibrary/babylon.normalMapProceduralTexture.js

@@ -9,6 +9,12 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
 var BABYLON;
 (function (BABYLON) {
     var NormalMapProceduralTexture = /** @class */ (function (_super) {
@@ -41,6 +47,29 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this normal map procedural texture
+         * @returns a serialized normal map procedural texture object
+         */
+        NormalMapProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.NormalMapProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Normal Map Procedural Texture from parsed normal map procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing normal map procedural texture information
+         * @returns a parsed Normal Map Procedural Texture
+         */
+        NormalMapProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new NormalMapProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serializeAsTexture()
+        ], NormalMapProceduralTexture.prototype, "baseTexture", null);
         return NormalMapProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.NormalMapProceduralTexture = NormalMapProceduralTexture;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/proceduralTexturesLibrary/babylon.normalMapProceduralTexture.min.js


+ 13 - 0
dist/preview release/proceduralTexturesLibrary/babylon.perlinNoiseProceduralTexture.d.ts

@@ -9,5 +9,18 @@ declare module BABYLON {
         updateShaderUniforms(): void;
         render(useCameraPostProcess?: boolean): void;
         resize(size: any, generateMipMaps: any): void;
+        /**
+         * Serializes this perlin noise procedural texture
+         * @returns a serialized perlin noise procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Perlin Noise Procedural Texture from parsed perlin noise procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing perlin noise procedural texture information
+         * @returns a parsed Perlin Noise Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): PerlinNoiseProceduralTexture;
     }
 }

+ 35 - 0
dist/preview release/proceduralTexturesLibrary/babylon.perlinNoiseProceduralTexture.js

@@ -9,6 +9,12 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
 var BABYLON;
 (function (BABYLON) {
     var PerlinNoiseProceduralTexture = /** @class */ (function (_super) {
@@ -41,6 +47,35 @@ var BABYLON;
         PerlinNoiseProceduralTexture.prototype.resize = function (size, generateMipMaps) {
             _super.prototype.resize.call(this, size, generateMipMaps);
         };
+        /**
+         * Serializes this perlin noise procedural texture
+         * @returns a serialized perlin noise procedural texture object
+         */
+        PerlinNoiseProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.PerlinNoiseProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Perlin Noise Procedural Texture from parsed perlin noise procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing perlin noise procedural texture information
+         * @returns a parsed Perlin Noise Procedural Texture
+         */
+        PerlinNoiseProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new PerlinNoiseProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serialize()
+        ], PerlinNoiseProceduralTexture.prototype, "time", void 0);
+        __decorate([
+            BABYLON.serialize()
+        ], PerlinNoiseProceduralTexture.prototype, "speed", void 0);
+        __decorate([
+            BABYLON.serialize()
+        ], PerlinNoiseProceduralTexture.prototype, "translationSpeed", void 0);
         return PerlinNoiseProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.PerlinNoiseProceduralTexture = PerlinNoiseProceduralTexture;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/proceduralTexturesLibrary/babylon.perlinNoiseProceduralTexture.min.js


+ 13 - 0
dist/preview release/proceduralTexturesLibrary/babylon.roadProceduralTexture.d.ts

@@ -5,5 +5,18 @@ declare module BABYLON {
         constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean);
         updateShaderUniforms(): void;
         roadColor: Color3;
+        /**
+         * Serializes this road procedural texture
+         * @returns a serialized road procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Road Procedural Texture from parsed road procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing road procedural texture information
+         * @returns a parsed Road Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): RoadProceduralTexture;
     }
 }

+ 29 - 0
dist/preview release/proceduralTexturesLibrary/babylon.roadProceduralTexture.js

@@ -9,6 +9,12 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
 var BABYLON;
 (function (BABYLON) {
     var RoadProceduralTexture = /** @class */ (function (_super) {
@@ -33,6 +39,29 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this road procedural texture
+         * @returns a serialized road procedural texture object
+         */
+        RoadProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.RoadProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Road Procedural Texture from parsed road procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing road procedural texture information
+         * @returns a parsed Road Procedural Texture
+         */
+        RoadProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new RoadProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serializeAsColor3()
+        ], RoadProceduralTexture.prototype, "roadColor", null);
         return RoadProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.RoadProceduralTexture = RoadProceduralTexture;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/proceduralTexturesLibrary/babylon.roadProceduralTexture.min.js


+ 13 - 0
dist/preview release/proceduralTexturesLibrary/babylon.starfieldProceduralTexture.d.ts

@@ -25,5 +25,18 @@ declare module BABYLON {
         darkmatter: number;
         distfading: number;
         saturation: number;
+        /**
+         * Serializes this starfield procedural texture
+         * @returns a serialized starfield procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Starfield Procedural Texture from parsed startfield procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing startfield procedural texture information
+         * @returns a parsed Starfield Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): StarfieldProceduralTexture;
     }
 }

+ 59 - 0
dist/preview release/proceduralTexturesLibrary/babylon.starfieldProceduralTexture.js

@@ -9,6 +9,12 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
 var BABYLON;
 (function (BABYLON) {
     var StarfieldProceduralTexture = /** @class */ (function (_super) {
@@ -163,6 +169,59 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this starfield procedural texture
+         * @returns a serialized starfield procedural texture object
+         */
+        StarfieldProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.StarfieldProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Starfield Procedural Texture from parsed startfield procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing startfield procedural texture information
+         * @returns a parsed Starfield Procedural Texture
+         */
+        StarfieldProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new StarfieldProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "time", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "alpha", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "beta", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "formuparam", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "stepsize", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "zoom", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "tile", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "brightness", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "darkmatter", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "distfading", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "saturation", null);
         return StarfieldProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.StarfieldProceduralTexture = StarfieldProceduralTexture;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/proceduralTexturesLibrary/babylon.starfieldProceduralTexture.min.js


+ 13 - 0
dist/preview release/proceduralTexturesLibrary/babylon.woodProceduralTexture.d.ts

@@ -7,5 +7,18 @@ declare module BABYLON {
         updateShaderUniforms(): void;
         ampScale: number;
         woodColor: Color3;
+        /**
+         * Serializes this wood procedural texture
+         * @returns a serialized wood procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Wood Procedural Texture from parsed wood procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing wood procedural texture information
+         * @returns a parsed Wood Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): WoodProceduralTexture;
     }
 }

+ 32 - 0
dist/preview release/proceduralTexturesLibrary/babylon.woodProceduralTexture.js

@@ -9,6 +9,12 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
 var BABYLON;
 (function (BABYLON) {
     var WoodProceduralTexture = /** @class */ (function (_super) {
@@ -46,6 +52,32 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this wood procedural texture
+         * @returns a serialized wood procedural texture object
+         */
+        WoodProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.WoodProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Wood Procedural Texture from parsed wood procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing wood procedural texture information
+         * @returns a parsed Wood Procedural Texture
+         */
+        WoodProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new WoodProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serialize()
+        ], WoodProceduralTexture.prototype, "ampScale", null);
+        __decorate([
+            BABYLON.serializeAsColor3()
+        ], WoodProceduralTexture.prototype, "woodColor", null);
         return WoodProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.WoodProceduralTexture = WoodProceduralTexture;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/proceduralTexturesLibrary/babylon.woodProceduralTexture.min.js


+ 117 - 0
dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.d.ts

@@ -7,6 +7,19 @@ declare module BABYLON {
         updateShaderUniforms(): void;
         ampScale: number;
         woodColor: Color3;
+        /**
+         * Serializes this wood procedural texture
+         * @returns a serialized wood procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Wood Procedural Texture from parsed wood procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing wood procedural texture information
+         * @returns a parsed Wood Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): WoodProceduralTexture;
     }
 }
 
@@ -29,6 +42,19 @@ declare module BABYLON {
         time: number;
         speed: Vector2;
         alphaThreshold: number;
+        /**
+         * Serializes this fire procedural texture
+         * @returns a serialized fire procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Fire Procedural Texture from parsed fire procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing fire procedural texture information
+         * @returns a parsed Fire Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): FireProceduralTexture;
     }
 }
 
@@ -41,6 +67,19 @@ declare module BABYLON {
         updateShaderUniforms(): void;
         skyColor: Color4;
         cloudColor: Color4;
+        /**
+         * Serializes this cloud procedural texture
+         * @returns a serialized cloud procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Cloud Procedural Texture from parsed cloud procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing cloud procedural texture information
+         * @returns a parsed Cloud Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): CloudProceduralTexture;
     }
 }
 
@@ -53,6 +92,19 @@ declare module BABYLON {
         updateShaderUniforms(): void;
         grassColors: Color3[];
         groundColor: Color3;
+        /**
+         * Serializes this grass procedural texture
+         * @returns a serialized grass procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Grass Procedural Texture from parsed grass procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing grass procedural texture information
+         * @returns a parsed Grass Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): GrassProceduralTexture;
     }
 }
 
@@ -63,6 +115,19 @@ declare module BABYLON {
         constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean);
         updateShaderUniforms(): void;
         roadColor: Color3;
+        /**
+         * Serializes this road procedural texture
+         * @returns a serialized road procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Road Procedural Texture from parsed road procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing road procedural texture information
+         * @returns a parsed Road Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): RoadProceduralTexture;
     }
 }
 
@@ -108,6 +173,19 @@ declare module BABYLON {
         amplitude: number;
         numberOfTilesWidth: number;
         jointColor: Color3;
+        /**
+         * Serializes this marble procedural texture
+         * @returns a serialized marble procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Marble Procedural Texture from parsed marble procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing marble procedural texture information
+         * @returns a parsed Marble Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): MarbleProceduralTexture;
     }
 }
 
@@ -138,6 +216,19 @@ declare module BABYLON {
         darkmatter: number;
         distfading: number;
         saturation: number;
+        /**
+         * Serializes this starfield procedural texture
+         * @returns a serialized starfield procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Starfield Procedural Texture from parsed startfield procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing startfield procedural texture information
+         * @returns a parsed Starfield Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): StarfieldProceduralTexture;
     }
 }
 
@@ -150,6 +241,19 @@ declare module BABYLON {
         render(useCameraPostProcess?: boolean): void;
         resize(size: any, generateMipMaps: any): void;
         baseTexture: Texture;
+        /**
+         * Serializes this normal map procedural texture
+         * @returns a serialized normal map procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Normal Map Procedural Texture from parsed normal map procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing normal map procedural texture information
+         * @returns a parsed Normal Map Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): NormalMapProceduralTexture;
     }
 }
 
@@ -164,5 +268,18 @@ declare module BABYLON {
         updateShaderUniforms(): void;
         render(useCameraPostProcess?: boolean): void;
         resize(size: any, generateMipMaps: any): void;
+        /**
+         * Serializes this perlin noise procedural texture
+         * @returns a serialized perlin noise procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Perlin Noise Procedural Texture from parsed perlin noise procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing perlin noise procedural texture information
+         * @returns a parsed Perlin Noise Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): PerlinNoiseProceduralTexture;
     }
 }

+ 279 - 0
dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.js

@@ -25,6 +25,7 @@ var __decorate=this&&this.__decorate||function(e,t,r,c){var o,f=arguments.length
 var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])};return function(o,n){function r(){this.constructor=o}t(o,n),o.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();
 
 
+
 var BABYLON;
 (function (BABYLON) {
     var WoodProceduralTexture = /** @class */ (function (_super) {
@@ -62,6 +63,32 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this wood procedural texture
+         * @returns a serialized wood procedural texture object
+         */
+        WoodProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.WoodProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Wood Procedural Texture from parsed wood procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing wood procedural texture information
+         * @returns a parsed Wood Procedural Texture
+         */
+        WoodProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new WoodProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serialize()
+        ], WoodProceduralTexture.prototype, "ampScale", null);
+        __decorate([
+            BABYLON.serializeAsColor3()
+        ], WoodProceduralTexture.prototype, "woodColor", null);
         return WoodProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.WoodProceduralTexture = WoodProceduralTexture;
@@ -73,6 +100,7 @@ BABYLON.Effect.ShadersStore['woodProceduralTexturePixelShader'] = "precision hig
 
 
 
+
 var BABYLON;
 (function (BABYLON) {
     var FireProceduralTexture = /** @class */ (function (_super) {
@@ -206,6 +234,38 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this fire procedural texture
+         * @returns a serialized fire procedural texture object
+         */
+        FireProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.FireProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Fire Procedural Texture from parsed fire procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing fire procedural texture information
+         * @returns a parsed Fire Procedural Texture
+         */
+        FireProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new FireProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serializeAsColor3()
+        ], FireProceduralTexture.prototype, "fireColors", null);
+        __decorate([
+            BABYLON.serialize()
+        ], FireProceduralTexture.prototype, "time", null);
+        __decorate([
+            BABYLON.serializeAsVector2()
+        ], FireProceduralTexture.prototype, "speed", null);
+        __decorate([
+            BABYLON.serialize()
+        ], FireProceduralTexture.prototype, "alphaThreshold", null);
         return FireProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.FireProceduralTexture = FireProceduralTexture;
@@ -217,6 +277,7 @@ BABYLON.Effect.ShadersStore['fireProceduralTexturePixelShader'] = "precision hig
 
 
 
+
 var BABYLON;
 (function (BABYLON) {
     var CloudProceduralTexture = /** @class */ (function (_super) {
@@ -254,6 +315,32 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this cloud procedural texture
+         * @returns a serialized cloud procedural texture object
+         */
+        CloudProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.CloudProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Cloud Procedural Texture from parsed cloud procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing cloud procedural texture information
+         * @returns a parsed Cloud Procedural Texture
+         */
+        CloudProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new CloudProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serializeAsColor4()
+        ], CloudProceduralTexture.prototype, "skyColor", null);
+        __decorate([
+            BABYLON.serializeAsColor4()
+        ], CloudProceduralTexture.prototype, "cloudColor", null);
         return CloudProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.CloudProceduralTexture = CloudProceduralTexture;
@@ -265,6 +352,7 @@ BABYLON.Effect.ShadersStore['cloudProceduralTexturePixelShader'] = "precision hi
 
 
 
+
 var BABYLON;
 (function (BABYLON) {
     var GrassProceduralTexture = /** @class */ (function (_super) {
@@ -308,6 +396,32 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this grass procedural texture
+         * @returns a serialized grass procedural texture object
+         */
+        GrassProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.GrassProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Grass Procedural Texture from parsed grass procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing grass procedural texture information
+         * @returns a parsed Grass Procedural Texture
+         */
+        GrassProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new GrassProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serializeAsColor3()
+        ], GrassProceduralTexture.prototype, "grassColors", null);
+        __decorate([
+            BABYLON.serializeAsColor3()
+        ], GrassProceduralTexture.prototype, "groundColor", null);
         return GrassProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.GrassProceduralTexture = GrassProceduralTexture;
@@ -319,6 +433,7 @@ BABYLON.Effect.ShadersStore['grassProceduralTexturePixelShader'] = "precision hi
 
 
 
+
 var BABYLON;
 (function (BABYLON) {
     var RoadProceduralTexture = /** @class */ (function (_super) {
@@ -343,6 +458,29 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this road procedural texture
+         * @returns a serialized road procedural texture object
+         */
+        RoadProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.RoadProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Road Procedural Texture from parsed road procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing road procedural texture information
+         * @returns a parsed Road Procedural Texture
+         */
+        RoadProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new RoadProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serializeAsColor3()
+        ], RoadProceduralTexture.prototype, "roadColor", null);
         return RoadProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.RoadProceduralTexture = RoadProceduralTexture;
@@ -461,6 +599,7 @@ BABYLON.Effect.ShadersStore['brickProceduralTexturePixelShader'] = "precision hi
 
 
 
+
 var BABYLON;
 (function (BABYLON) {
     var MarbleProceduralTexture = /** @class */ (function (_super) {
@@ -524,6 +663,38 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this marble procedural texture
+         * @returns a serialized marble procedural texture object
+         */
+        MarbleProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.MarbleProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Marble Procedural Texture from parsed marble procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing marble procedural texture information
+         * @returns a parsed Marble Procedural Texture
+         */
+        MarbleProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new MarbleProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serialize()
+        ], MarbleProceduralTexture.prototype, "numberOfTilesHeight", null);
+        __decorate([
+            BABYLON.serialize()
+        ], MarbleProceduralTexture.prototype, "amplitude", null);
+        __decorate([
+            BABYLON.serialize()
+        ], MarbleProceduralTexture.prototype, "numberOfTilesWidth", null);
+        __decorate([
+            BABYLON.serialize()
+        ], MarbleProceduralTexture.prototype, "jointColor", null);
         return MarbleProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.MarbleProceduralTexture = MarbleProceduralTexture;
@@ -535,6 +706,7 @@ BABYLON.Effect.ShadersStore['marbleProceduralTexturePixelShader'] = "precision h
 
 
 
+
 var BABYLON;
 (function (BABYLON) {
     var StarfieldProceduralTexture = /** @class */ (function (_super) {
@@ -689,6 +861,59 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this starfield procedural texture
+         * @returns a serialized starfield procedural texture object
+         */
+        StarfieldProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.StarfieldProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Starfield Procedural Texture from parsed startfield procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing startfield procedural texture information
+         * @returns a parsed Starfield Procedural Texture
+         */
+        StarfieldProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new StarfieldProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "time", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "alpha", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "beta", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "formuparam", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "stepsize", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "zoom", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "tile", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "brightness", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "darkmatter", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "distfading", null);
+        __decorate([
+            BABYLON.serialize()
+        ], StarfieldProceduralTexture.prototype, "saturation", null);
         return StarfieldProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.StarfieldProceduralTexture = StarfieldProceduralTexture;
@@ -700,6 +925,7 @@ BABYLON.Effect.ShadersStore['starfieldProceduralTexturePixelShader'] = "precisio
 
 
 
+
 var BABYLON;
 (function (BABYLON) {
     var NormalMapProceduralTexture = /** @class */ (function (_super) {
@@ -732,6 +958,29 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Serializes this normal map procedural texture
+         * @returns a serialized normal map procedural texture object
+         */
+        NormalMapProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.NormalMapProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Normal Map Procedural Texture from parsed normal map procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing normal map procedural texture information
+         * @returns a parsed Normal Map Procedural Texture
+         */
+        NormalMapProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new NormalMapProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serializeAsTexture()
+        ], NormalMapProceduralTexture.prototype, "baseTexture", null);
         return NormalMapProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.NormalMapProceduralTexture = NormalMapProceduralTexture;
@@ -743,6 +992,7 @@ BABYLON.Effect.ShadersStore['normalMapProceduralTexturePixelShader'] = "precisio
 
 
 
+
 var BABYLON;
 (function (BABYLON) {
     var PerlinNoiseProceduralTexture = /** @class */ (function (_super) {
@@ -775,6 +1025,35 @@ var BABYLON;
         PerlinNoiseProceduralTexture.prototype.resize = function (size, generateMipMaps) {
             _super.prototype.resize.call(this, size, generateMipMaps);
         };
+        /**
+         * Serializes this perlin noise procedural texture
+         * @returns a serialized perlin noise procedural texture object
+         */
+        PerlinNoiseProceduralTexture.prototype.serialize = function () {
+            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
+            serializationObject.customType = "BABYLON.PerlinNoiseProceduralTexture";
+            return serializationObject;
+        };
+        /**
+         * Creates a Perlin Noise Procedural Texture from parsed perlin noise procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing perlin noise procedural texture information
+         * @returns a parsed Perlin Noise Procedural Texture
+         */
+        PerlinNoiseProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
+            var texture = BABYLON.SerializationHelper.Parse(function () { return new PerlinNoiseProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
+            return texture;
+        };
+        __decorate([
+            BABYLON.serialize()
+        ], PerlinNoiseProceduralTexture.prototype, "time", void 0);
+        __decorate([
+            BABYLON.serialize()
+        ], PerlinNoiseProceduralTexture.prototype, "speed", void 0);
+        __decorate([
+            BABYLON.serialize()
+        ], PerlinNoiseProceduralTexture.prototype, "translationSpeed", void 0);
         return PerlinNoiseProceduralTexture;
     }(BABYLON.ProceduralTexture));
     BABYLON.PerlinNoiseProceduralTexture = PerlinNoiseProceduralTexture;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js


+ 117 - 0
dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.module.d.ts

@@ -12,6 +12,19 @@ declare module BABYLON {
         updateShaderUniforms(): void;
         ampScale: number;
         woodColor: Color3;
+        /**
+         * Serializes this wood procedural texture
+         * @returns a serialized wood procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Wood Procedural Texture from parsed wood procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing wood procedural texture information
+         * @returns a parsed Wood Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): WoodProceduralTexture;
     }
 }
 
@@ -34,6 +47,19 @@ declare module BABYLON {
         time: number;
         speed: Vector2;
         alphaThreshold: number;
+        /**
+         * Serializes this fire procedural texture
+         * @returns a serialized fire procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Fire Procedural Texture from parsed fire procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing fire procedural texture information
+         * @returns a parsed Fire Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): FireProceduralTexture;
     }
 }
 
@@ -46,6 +72,19 @@ declare module BABYLON {
         updateShaderUniforms(): void;
         skyColor: Color4;
         cloudColor: Color4;
+        /**
+         * Serializes this cloud procedural texture
+         * @returns a serialized cloud procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Cloud Procedural Texture from parsed cloud procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing cloud procedural texture information
+         * @returns a parsed Cloud Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): CloudProceduralTexture;
     }
 }
 
@@ -58,6 +97,19 @@ declare module BABYLON {
         updateShaderUniforms(): void;
         grassColors: Color3[];
         groundColor: Color3;
+        /**
+         * Serializes this grass procedural texture
+         * @returns a serialized grass procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Grass Procedural Texture from parsed grass procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing grass procedural texture information
+         * @returns a parsed Grass Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): GrassProceduralTexture;
     }
 }
 
@@ -68,6 +120,19 @@ declare module BABYLON {
         constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean);
         updateShaderUniforms(): void;
         roadColor: Color3;
+        /**
+         * Serializes this road procedural texture
+         * @returns a serialized road procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Road Procedural Texture from parsed road procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing road procedural texture information
+         * @returns a parsed Road Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): RoadProceduralTexture;
     }
 }
 
@@ -113,6 +178,19 @@ declare module BABYLON {
         amplitude: number;
         numberOfTilesWidth: number;
         jointColor: Color3;
+        /**
+         * Serializes this marble procedural texture
+         * @returns a serialized marble procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Marble Procedural Texture from parsed marble procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing marble procedural texture information
+         * @returns a parsed Marble Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): MarbleProceduralTexture;
     }
 }
 
@@ -143,6 +221,19 @@ declare module BABYLON {
         darkmatter: number;
         distfading: number;
         saturation: number;
+        /**
+         * Serializes this starfield procedural texture
+         * @returns a serialized starfield procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Starfield Procedural Texture from parsed startfield procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing startfield procedural texture information
+         * @returns a parsed Starfield Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): StarfieldProceduralTexture;
     }
 }
 
@@ -155,6 +246,19 @@ declare module BABYLON {
         render(useCameraPostProcess?: boolean): void;
         resize(size: any, generateMipMaps: any): void;
         baseTexture: Texture;
+        /**
+         * Serializes this normal map procedural texture
+         * @returns a serialized normal map procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Normal Map Procedural Texture from parsed normal map procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing normal map procedural texture information
+         * @returns a parsed Normal Map Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): NormalMapProceduralTexture;
     }
 }
 
@@ -169,5 +273,18 @@ declare module BABYLON {
         updateShaderUniforms(): void;
         render(useCameraPostProcess?: boolean): void;
         resize(size: any, generateMipMaps: any): void;
+        /**
+         * Serializes this perlin noise procedural texture
+         * @returns a serialized perlin noise procedural texture object
+         */
+        serialize(): any;
+        /**
+         * Creates a Perlin Noise Procedural Texture from parsed perlin noise procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing perlin noise procedural texture information
+         * @returns a parsed Perlin Noise Procedural Texture
+         */
+        static Parse(parsedTexture: any, scene: Scene, rootUrl: string): PerlinNoiseProceduralTexture;
     }
 }

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

@@ -615,14 +615,14 @@ declare module BABYLON.GLTF2 {
         /**
          * Builds a texture from base64 string
          * @param base64Texture base64 texture string
-         * @param textureName Name to use for the texture
+         * @param baseTextureName Name to use for the texture
          * @param mimeType image mime type for the texture
          * @param images array of images
          * @param textures array of textures
          * @param imageData map of image data
          * @returns glTF texture info, or null if the texture format is not supported
          */
-        private static _GetTextureInfoFromBase64(base64Texture, textureName, mimeType, images, textures, texCoordIndex, samplerIndex, imageData);
+        private static _GetTextureInfoFromBase64(base64Texture, baseTextureName, mimeType, images, textures, texCoordIndex, samplerIndex, imageData);
     }
 }
 

+ 15 - 24
dist/preview release/serializers/babylon.glTF2Serializer.js

@@ -2153,13 +2153,13 @@ var BABYLON;
                 if (metallicRoughnessFactors) {
                     if (hasTextureCoords) {
                         if (metallicRoughnessFactors.baseColorTextureBase64) {
-                            var glTFBaseColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughnessFactors.baseColorTextureBase64, "bjsBaseColorTexture_" + (textures.length) + ".png", mimeType, images, textures, babylonPBRMaterial.albedoTexture ? babylonPBRMaterial.albedoTexture.coordinatesIndex : null, samplerIndex, imageData);
+                            var glTFBaseColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughnessFactors.baseColorTextureBase64, "bjsBaseColorTexture", mimeType, images, textures, babylonPBRMaterial.albedoTexture ? babylonPBRMaterial.albedoTexture.coordinatesIndex : null, samplerIndex, imageData);
                             if (glTFBaseColorTexture != null) {
                                 glTFPbrMetallicRoughness.baseColorTexture = glTFBaseColorTexture;
                             }
                         }
                         if (metallicRoughnessFactors.metallicRoughnessTextureBase64) {
-                            var glTFMRColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughnessFactors.metallicRoughnessTextureBase64, "bjsMetallicRoughnessTexture_" + (textures.length) + ".png", mimeType, images, textures, babylonPBRMaterial.reflectivityTexture ? babylonPBRMaterial.reflectivityTexture.coordinatesIndex : null, samplerIndex, imageData);
+                            var glTFMRColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughnessFactors.metallicRoughnessTextureBase64, "bjsMetallicRoughnessTexture", mimeType, images, textures, babylonPBRMaterial.reflectivityTexture ? babylonPBRMaterial.reflectivityTexture.coordinatesIndex : null, samplerIndex, imageData);
                             if (glTFMRColorTexture != null) {
                                 glTFPbrMetallicRoughness.metallicRoughnessTexture = glTFMRColorTexture;
                             }
@@ -2318,47 +2318,29 @@ var BABYLON;
                 else {
                     samplerIndex = foundSamplerIndex;
                 }
-                var textureName = BABYLON.Tools.RandomId();
-                var textureData = babylonTexture.getInternalTexture();
-                if (textureData != null) {
-                    textureName = textureData.url || textureName;
-                }
-                textureName = BABYLON.Tools.GetFilename(textureName);
-                var baseFile = textureName.split('.')[0];
-                var extension = "";
-                if (mimeType === "image/jpeg" /* JPEG */) {
-                    extension = ".jpg";
-                }
-                else if (mimeType === "image/png" /* PNG */) {
-                    extension = ".png";
-                }
-                else {
-                    return Promise.reject("Unsupported mime type " + mimeType);
-                }
-                textureName = baseFile + extension;
                 return this._SetAlphaToOneAsync(babylonTexture, useAlpha).then(function (texture) {
                     var pixels = _GLTFMaterial.GetPixelsFromTexture(texture);
                     var size = babylonTexture.getSize();
                     var base64Data = _this._CreateBase64FromCanvas(pixels, size.width, size.height, mimeType);
-                    var textureInfo = _this._GetTextureInfoFromBase64(base64Data, textureName, mimeType, images, textures, babylonTexture.coordinatesIndex, samplerIndex, imageData);
+                    var textureInfo = _this._GetTextureInfoFromBase64(base64Data, babylonTexture.name, mimeType, images, textures, babylonTexture.coordinatesIndex, samplerIndex, imageData);
                     return textureInfo;
                 });
             };
             /**
              * Builds a texture from base64 string
              * @param base64Texture base64 texture string
-             * @param textureName Name to use for the texture
+             * @param baseTextureName Name to use for the texture
              * @param mimeType image mime type for the texture
              * @param images array of images
              * @param textures array of textures
              * @param imageData map of image data
              * @returns glTF texture info, or null if the texture format is not supported
              */
-            _GLTFMaterial._GetTextureInfoFromBase64 = function (base64Texture, textureName, mimeType, images, textures, texCoordIndex, samplerIndex, imageData) {
+            _GLTFMaterial._GetTextureInfoFromBase64 = function (base64Texture, baseTextureName, mimeType, images, textures, texCoordIndex, samplerIndex, imageData) {
                 var textureInfo = null;
                 var glTFTexture = {
                     source: images.length,
-                    name: textureName
+                    name: baseTextureName
                 };
                 if (samplerIndex != null) {
                     glTFTexture.sampler = samplerIndex;
@@ -2370,9 +2352,15 @@ var BABYLON;
                     arr[i] = binStr.charCodeAt(i);
                 }
                 var imageValues = { data: arr, mimeType: mimeType };
+                var extension = mimeType === "image/jpeg" /* JPEG */ ? '.jpeg' : '.png';
+                var textureName = baseTextureName + extension;
+                if (textureName in imageData) {
+                    textureName = baseTextureName + "_" + BABYLON.Tools.RandomId() + extension;
+                }
                 imageData[textureName] = imageValues;
                 if (mimeType === "image/jpeg" /* JPEG */ || mimeType === "image/png" /* PNG */) {
                     var glTFImage = {
+                        name: baseTextureName,
                         uri: textureName
                     };
                     var foundIndex = null;
@@ -2397,6 +2385,9 @@ var BABYLON;
                         textureInfo.texCoord = texCoordIndex;
                     }
                 }
+                else {
+                    BABYLON.Tools.Error("Unsupported texture mime type " + mimeType);
+                }
                 return textureInfo;
             };
             /**

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/serializers/babylon.glTF2Serializer.min.js


+ 2 - 2
dist/preview release/serializers/babylonjs.serializers.d.ts

@@ -623,14 +623,14 @@ declare module BABYLON.GLTF2 {
         /**
          * Builds a texture from base64 string
          * @param base64Texture base64 texture string
-         * @param textureName Name to use for the texture
+         * @param baseTextureName Name to use for the texture
          * @param mimeType image mime type for the texture
          * @param images array of images
          * @param textures array of textures
          * @param imageData map of image data
          * @returns glTF texture info, or null if the texture format is not supported
          */
-        private static _GetTextureInfoFromBase64(base64Texture, textureName, mimeType, images, textures, texCoordIndex, samplerIndex, imageData);
+        private static _GetTextureInfoFromBase64(base64Texture, baseTextureName, mimeType, images, textures, texCoordIndex, samplerIndex, imageData);
     }
 }
 

+ 15 - 24
dist/preview release/serializers/babylonjs.serializers.js

@@ -2303,13 +2303,13 @@ var BABYLON;
                 if (metallicRoughnessFactors) {
                     if (hasTextureCoords) {
                         if (metallicRoughnessFactors.baseColorTextureBase64) {
-                            var glTFBaseColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughnessFactors.baseColorTextureBase64, "bjsBaseColorTexture_" + (textures.length) + ".png", mimeType, images, textures, babylonPBRMaterial.albedoTexture ? babylonPBRMaterial.albedoTexture.coordinatesIndex : null, samplerIndex, imageData);
+                            var glTFBaseColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughnessFactors.baseColorTextureBase64, "bjsBaseColorTexture", mimeType, images, textures, babylonPBRMaterial.albedoTexture ? babylonPBRMaterial.albedoTexture.coordinatesIndex : null, samplerIndex, imageData);
                             if (glTFBaseColorTexture != null) {
                                 glTFPbrMetallicRoughness.baseColorTexture = glTFBaseColorTexture;
                             }
                         }
                         if (metallicRoughnessFactors.metallicRoughnessTextureBase64) {
-                            var glTFMRColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughnessFactors.metallicRoughnessTextureBase64, "bjsMetallicRoughnessTexture_" + (textures.length) + ".png", mimeType, images, textures, babylonPBRMaterial.reflectivityTexture ? babylonPBRMaterial.reflectivityTexture.coordinatesIndex : null, samplerIndex, imageData);
+                            var glTFMRColorTexture = _GLTFMaterial._GetTextureInfoFromBase64(metallicRoughnessFactors.metallicRoughnessTextureBase64, "bjsMetallicRoughnessTexture", mimeType, images, textures, babylonPBRMaterial.reflectivityTexture ? babylonPBRMaterial.reflectivityTexture.coordinatesIndex : null, samplerIndex, imageData);
                             if (glTFMRColorTexture != null) {
                                 glTFPbrMetallicRoughness.metallicRoughnessTexture = glTFMRColorTexture;
                             }
@@ -2468,47 +2468,29 @@ var BABYLON;
                 else {
                     samplerIndex = foundSamplerIndex;
                 }
-                var textureName = BABYLON.Tools.RandomId();
-                var textureData = babylonTexture.getInternalTexture();
-                if (textureData != null) {
-                    textureName = textureData.url || textureName;
-                }
-                textureName = BABYLON.Tools.GetFilename(textureName);
-                var baseFile = textureName.split('.')[0];
-                var extension = "";
-                if (mimeType === "image/jpeg" /* JPEG */) {
-                    extension = ".jpg";
-                }
-                else if (mimeType === "image/png" /* PNG */) {
-                    extension = ".png";
-                }
-                else {
-                    return Promise.reject("Unsupported mime type " + mimeType);
-                }
-                textureName = baseFile + extension;
                 return this._SetAlphaToOneAsync(babylonTexture, useAlpha).then(function (texture) {
                     var pixels = _GLTFMaterial.GetPixelsFromTexture(texture);
                     var size = babylonTexture.getSize();
                     var base64Data = _this._CreateBase64FromCanvas(pixels, size.width, size.height, mimeType);
-                    var textureInfo = _this._GetTextureInfoFromBase64(base64Data, textureName, mimeType, images, textures, babylonTexture.coordinatesIndex, samplerIndex, imageData);
+                    var textureInfo = _this._GetTextureInfoFromBase64(base64Data, babylonTexture.name, mimeType, images, textures, babylonTexture.coordinatesIndex, samplerIndex, imageData);
                     return textureInfo;
                 });
             };
             /**
              * Builds a texture from base64 string
              * @param base64Texture base64 texture string
-             * @param textureName Name to use for the texture
+             * @param baseTextureName Name to use for the texture
              * @param mimeType image mime type for the texture
              * @param images array of images
              * @param textures array of textures
              * @param imageData map of image data
              * @returns glTF texture info, or null if the texture format is not supported
              */
-            _GLTFMaterial._GetTextureInfoFromBase64 = function (base64Texture, textureName, mimeType, images, textures, texCoordIndex, samplerIndex, imageData) {
+            _GLTFMaterial._GetTextureInfoFromBase64 = function (base64Texture, baseTextureName, mimeType, images, textures, texCoordIndex, samplerIndex, imageData) {
                 var textureInfo = null;
                 var glTFTexture = {
                     source: images.length,
-                    name: textureName
+                    name: baseTextureName
                 };
                 if (samplerIndex != null) {
                     glTFTexture.sampler = samplerIndex;
@@ -2520,9 +2502,15 @@ var BABYLON;
                     arr[i] = binStr.charCodeAt(i);
                 }
                 var imageValues = { data: arr, mimeType: mimeType };
+                var extension = mimeType === "image/jpeg" /* JPEG */ ? '.jpeg' : '.png';
+                var textureName = baseTextureName + extension;
+                if (textureName in imageData) {
+                    textureName = baseTextureName + "_" + BABYLON.Tools.RandomId() + extension;
+                }
                 imageData[textureName] = imageValues;
                 if (mimeType === "image/jpeg" /* JPEG */ || mimeType === "image/png" /* PNG */) {
                     var glTFImage = {
+                        name: baseTextureName,
                         uri: textureName
                     };
                     var foundIndex = null;
@@ -2547,6 +2535,9 @@ var BABYLON;
                         textureInfo.texCoord = texCoordIndex;
                     }
                 }
+                else {
+                    BABYLON.Tools.Error("Unsupported texture mime type " + mimeType);
+                }
                 return textureInfo;
             };
             /**

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/serializers/babylonjs.serializers.min.js


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

@@ -630,14 +630,14 @@ declare module BABYLON.GLTF2 {
         /**
          * Builds a texture from base64 string
          * @param base64Texture base64 texture string
-         * @param textureName Name to use for the texture
+         * @param baseTextureName Name to use for the texture
          * @param mimeType image mime type for the texture
          * @param images array of images
          * @param textures array of textures
          * @param imageData map of image data
          * @returns glTF texture info, or null if the texture format is not supported
          */
-        private static _GetTextureInfoFromBase64(base64Texture, textureName, mimeType, images, textures, texCoordIndex, samplerIndex, imageData);
+        private static _GetTextureInfoFromBase64(base64Texture, baseTextureName, mimeType, images, textures, texCoordIndex, samplerIndex, imageData);
     }
 }
 

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 12 - 12
dist/preview release/viewer/babylon.viewer.js


+ 16 - 1
dist/preview release/viewer/babylon.viewer.max.js

@@ -14615,6 +14615,13 @@ var BABYLON;
         };
         // Textures
         /**
+         * Clears the list of texture accessible through engine.
+         * This can help preventing texture load conflict due to name collision.
+         */
+        Engine.prototype.clearInternalTexturesCache = function () {
+            this._internalTexturesCache = [];
+        };
+        /**
          * Force the entire cache to be cleared
          * You should not have to use this function unless your engine needs to share the webGL context with another engine
          * @param bruteForce defines a boolean to force clearing ALL caches (including stencil, detoh and alpha states)
@@ -87466,6 +87473,7 @@ var BABYLON;
             this.BJSINSPECTOR = typeof INSPECTOR !== 'undefined' ? INSPECTOR : undefined;
             this._scene = scene;
             // load inspector using require, if it doesn't exist on the global namespace.
+            this.onGlobalPropertyChange = new Array();
         }
         /** Creates the inspector window. */
         DebugLayer.prototype._createInspector = function (config) {
@@ -87534,6 +87542,11 @@ var BABYLON;
         DebugLayer.prototype.getActiveTab = function () {
             return this._inspector ? this._inspector.getActiveTabIndex() : -1;
         };
+        DebugLayer.prototype.onGlobalPropertyChangeCallback = function (result) {
+            this.onGlobalPropertyChange.forEach(function (callback) {
+                callback(result);
+            });
+        };
         DebugLayer.InspectorURL = 'https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js';
         return DebugLayer;
     }());
@@ -100419,7 +100432,9 @@ var BABYLON;
                 // Fog
                 BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect);
                 // image processing
-                this._imageProcessingConfiguration.bind(this._activeEffect);
+                if (this._imageProcessingConfiguration) {
+                    this._imageProcessingConfiguration.bind(this._activeEffect);
+                }
             }
             this._uniformBuffer.update();
             this._afterBind(mesh);

+ 2 - 0
sandbox/index.js

@@ -83,6 +83,8 @@ if (BABYLON.Engine.isSupported()) {
     });
 
     var sceneLoaded = function (sceneFile, babylonScene) {
+        engine.clearInternalTexturesCache();
+
         // Clear dropdown that contains animation names
         dropdownContent.innerHTML = "";
         animationBar.style.display = "none";

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

@@ -4055,6 +4055,14 @@
         // Textures
 
         /**
+         * Clears the list of texture accessible through engine.
+         * This can help preventing texture load conflict due to name collision.
+         */
+        public clearInternalTexturesCache() {
+            this._internalTexturesCache = [];
+        }
+
+        /**
          * Force the entire cache to be cleared
          * You should not have to use this function unless your engine needs to share the webGL context with another engine
          * @param bruteForce defines a boolean to force clearing ALL caches (including stencil, detoh and alpha states)