David Catuhe пре 6 година
родитељ
комит
0fba34b709
100 измењених фајлова са 207410 додато и 117396 уклоњено
  1. 14690 14687
      Playground/babylon.d.txt
  2. 1 1
      Tools/Publisher/index.js
  3. 31206 16752
      dist/babylon.d.ts
  4. 1 60
      dist/babylon.js
  5. 39130 19469
      dist/babylon.max.js
  6. 39130 19469
      dist/babylon.no-module.max.js
  7. 1 62
      dist/babylon.worker.js
  8. 8 8
      dist/draco_decoder_gltf.js
  9. BIN
      dist/draco_decoder_gltf.wasm
  10. 112 126
      dist/draco_wasm_wrapper_gltf.js
  11. 39132 19471
      dist/es6.js
  12. 50 2
      dist/gltf2Interface/babylon.glTF2Interface.d.ts
  13. 8482 0
      dist/gltf_validator.js
  14. 2615 918
      dist/gui/babylon.gui.d.ts
  15. 2 5466
      dist/gui/babylon.gui.js
  16. 2 4
      dist/gui/babylon.gui.min.js
  17. 1 0
      dist/gui/babylon.gui.min.js.map
  18. 5441 922
      dist/gui/babylon.gui.module.d.ts
  19. 2 2
      dist/gui/readme.md
  20. 2 5
      dist/inspector/babylon.inspector.bundle.js
  21. 1 0
      dist/inspector/babylon.inspector.bundle.js.map
  22. 1050 1354
      dist/inspector/babylon.inspector.d.ts
  23. 2393 0
      dist/inspector/babylon.inspector.module.d.ts
  24. 1 1
      dist/inspector/readme.md
  25. 113 147
      dist/loaders/babylon.glTF1FileLoader.d.ts
  26. 280 130
      dist/loaders/babylon.glTF1FileLoader.js
  27. 1 2
      dist/loaders/babylon.glTF1FileLoader.min.js
  28. 736 403
      dist/loaders/babylon.glTF2FileLoader.d.ts
  29. 1955 1176
      dist/loaders/babylon.glTF2FileLoader.js
  30. 1 2
      dist/loaders/babylon.glTF2FileLoader.min.js
  31. 752 434
      dist/loaders/babylon.glTFFileLoader.d.ts
  32. 1995 1220
      dist/loaders/babylon.glTFFileLoader.js
  33. 1 3
      dist/loaders/babylon.glTFFileLoader.min.js
  34. 41 7
      dist/loaders/babylon.objFileLoader.d.ts
  35. 131 48
      dist/loaders/babylon.objFileLoader.js
  36. 1 1
      dist/loaders/babylon.objFileLoader.min.js
  37. 4 4
      dist/loaders/babylon.stlFileLoader.d.ts
  38. 18 15
      dist/loaders/babylon.stlFileLoader.js
  39. 1 1
      dist/loaders/babylon.stlFileLoader.min.js
  40. 797 445
      dist/loaders/babylonjs.loaders.d.ts
  41. 2126 1208
      dist/loaders/babylonjs.loaders.js
  42. 1 4
      dist/loaders/babylonjs.loaders.min.js
  43. 797 445
      dist/loaders/babylonjs.loaders.module.d.ts
  44. 2 2
      dist/loaders/readme.md
  45. 14 8
      dist/materialsLibrary/babylon.cellMaterial.js
  46. 1 1
      dist/materialsLibrary/babylon.cellMaterial.min.js
  47. 6 3
      dist/materialsLibrary/babylon.customMaterial.js
  48. 1 1
      dist/materialsLibrary/babylon.customMaterial.min.js
  49. 14 11
      dist/materialsLibrary/babylon.fireMaterial.js
  50. 1 1
      dist/materialsLibrary/babylon.fireMaterial.min.js
  51. 15 9
      dist/materialsLibrary/babylon.furMaterial.js
  52. 1 1
      dist/materialsLibrary/babylon.furMaterial.min.js
  53. 1 0
      dist/materialsLibrary/babylon.gradientMaterial.d.ts
  54. 20 9
      dist/materialsLibrary/babylon.gradientMaterial.js
  55. 1 1
      dist/materialsLibrary/babylon.gradientMaterial.min.js
  56. 7 4
      dist/materialsLibrary/babylon.gridMaterial.js
  57. 1 1
      dist/materialsLibrary/babylon.gridMaterial.min.js
  58. 2 0
      dist/materialsLibrary/babylon.lavaMaterial.d.ts
  59. 26 10
      dist/materialsLibrary/babylon.lavaMaterial.js
  60. 1 1
      dist/materialsLibrary/babylon.lavaMaterial.min.js
  61. 56 0
      dist/materialsLibrary/babylon.mixMaterial.d.ts
  62. 475 0
      dist/materialsLibrary/babylon.mixMaterial.js
  63. 1 0
      dist/materialsLibrary/babylon.mixMaterial.min.js
  64. 14 8
      dist/materialsLibrary/babylon.normalMaterial.js
  65. 1 1
      dist/materialsLibrary/babylon.normalMaterial.min.js
  66. 1 0
      dist/materialsLibrary/babylon.shadowOnlyMaterial.d.ts
  67. 19 10
      dist/materialsLibrary/babylon.shadowOnlyMaterial.js
  68. 1 1
      dist/materialsLibrary/babylon.shadowOnlyMaterial.min.js
  69. 14 8
      dist/materialsLibrary/babylon.simpleMaterial.js
  70. 1 1
      dist/materialsLibrary/babylon.simpleMaterial.min.js
  71. 14 12
      dist/materialsLibrary/babylon.skyMaterial.js
  72. 1 1
      dist/materialsLibrary/babylon.skyMaterial.min.js
  73. 16 10
      dist/materialsLibrary/babylon.terrainMaterial.js
  74. 1 1
      dist/materialsLibrary/babylon.terrainMaterial.min.js
  75. 14 8
      dist/materialsLibrary/babylon.triPlanarMaterial.js
  76. 1 1
      dist/materialsLibrary/babylon.triPlanarMaterial.min.js
  77. 5 1
      dist/materialsLibrary/babylon.waterMaterial.d.ts
  78. 23 13
      dist/materialsLibrary/babylon.waterMaterial.js
  79. 1 1
      dist/materialsLibrary/babylon.waterMaterial.min.js
  80. 66 1
      dist/materialsLibrary/babylonjs.materials.d.ts
  81. 591 81
      dist/materialsLibrary/babylonjs.materials.js
  82. 1 5
      dist/materialsLibrary/babylonjs.materials.min.js
  83. 66 1
      dist/materialsLibrary/babylonjs.materials.module.d.ts
  84. 2 2
      dist/materialsLibrary/readme.md
  85. 2 2
      dist/postProcessesLibrary/babylon.asciiArtPostProcess.d.ts
  86. 6 3
      dist/postProcessesLibrary/babylon.asciiArtPostProcess.js
  87. 1 1
      dist/postProcessesLibrary/babylon.asciiArtPostProcess.min.js
  88. 2 2
      dist/postProcessesLibrary/babylon.digitalRainPostProcess.d.ts
  89. 6 3
      dist/postProcessesLibrary/babylon.digitalRainPostProcess.js
  90. 1 1
      dist/postProcessesLibrary/babylon.digitalRainPostProcess.min.js
  91. 4 4
      dist/postProcessesLibrary/babylonjs.postProcess.d.ts
  92. 1 1
      dist/postProcessesLibrary/babylonjs.postProcess.min.js
  93. 4 4
      dist/postProcessesLibrary/babylonjs.postProcess.module.d.ts
  94. 2 2
      dist/postProcessesLibrary/readme.md
  95. 12668 12665
      dist/preview release/babylon.d.ts
  96. 1 1
      dist/preview release/babylon.js
  97. 4 1
      dist/preview release/babylon.max.js
  98. 4 1
      dist/preview release/babylon.no-module.max.js
  99. 1 1
      dist/preview release/babylon.worker.js
  100. 0 0
      dist/preview release/es6.js

Разлика између датотеке није приказан због своје велике величине
+ 14690 - 14687
Playground/babylon.d.txt


+ 1 - 1
Tools/Publisher/index.js

@@ -258,7 +258,7 @@ function publish(version, packageName, basePath) {
 
     let tagDef = "";
     // check for alpha or beta
-    if (version.indexOf('alpha') !== -1 || version.indexOf('beta') !== -1) {
+    if (version.indexOf('alpha') !== -1 || version.indexOf('beta') !== -1 || version.indexOf('-rc.') !== -1) {
         tagDef = '--tag preview';
     }
 

Разлика између датотеке није приказан због своје велике величине
+ 31206 - 16752
dist/babylon.d.ts


Разлика између датотеке није приказан због своје велике величине
+ 1 - 60
dist/babylon.js


Разлика између датотеке није приказан због своје велике величине
+ 39130 - 19469
dist/babylon.max.js


Разлика између датотеке није приказан због своје велике величине
+ 39130 - 19469
dist/babylon.no-module.max.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 62
dist/babylon.worker.js


Разлика између датотеке није приказан због своје велике величине
+ 8 - 8
dist/draco_decoder_gltf.js


BIN
dist/draco_decoder_gltf.wasm


Разлика између датотеке није приказан због своје велике величине
+ 112 - 126
dist/draco_wasm_wrapper_gltf.js


Разлика између датотеке није приказан због своје велике величине
+ 39132 - 19471
dist/es6.js


+ 50 - 2
dist/gltf2Interface/babylon.glTF2Interface.d.ts

@@ -6,7 +6,7 @@ declare module "babylonjs-gltf2interface" {
     export = BABYLON.GLTF2;
 }
 /**
- * Moduel for glTF 2.0 Interface
+ * Module for glTF 2.0 Interface
  */
 declare module BABYLON.GLTF2 {
     /**
@@ -769,7 +769,7 @@ declare module BABYLON.GLTF2 {
     /**
      * Reference to a texture
      */
-    interface ITextureInfo {
+    interface ITextureInfo extends IProperty {
         /**
          * The index of the texture
          */
@@ -853,3 +853,51 @@ declare module BABYLON.GLTF2 {
         textures?: ITexture[];
     }
 }
+
+/**
+ * Interface for glTF validation results
+ */
+interface IGLTFValidationResults {
+    info: {
+        generator: string;
+        hasAnimations: boolean;
+        hasDefaultScene: boolean;
+        hasMaterials: boolean;
+        hasMorphTargets: boolean;
+        hasSkins: boolean;
+        hasTextures: boolean;
+        maxAttributesUsed: number;
+        primitivesCount: number
+    };
+    issues: {
+        messages: Array<string>;
+        numErrors: number;
+        numHints: number;
+        numInfos: number;
+        numWarnings: number;
+        truncated: boolean
+    };
+    mimeType: string;
+    uri: string;
+    validatedAt: string;
+    validatorVersion: string;
+}
+
+/**
+ * Interface for glTF validation options
+ */
+interface IGLTFValidationOptions {
+    uri?: string;
+    externalResourceFunction?: (uri: string) => Promise<Uint8Array>;
+    validateAccessorData?: boolean;
+    maxIssues?: number;
+    ignoredIssues?: Array<string>;
+    severityOverrides?: Object;
+}
+
+/**
+ * glTF validator object
+ */
+declare var GLTFValidator: {
+    validateString: (json: string, options?: IGLTFValidationOptions) => Promise<IGLTFValidationResults>;
+};

Разлика између датотеке није приказан због своје велике величине
+ 8482 - 0
dist/gltf_validator.js


Разлика између датотеке није приказан због своје велике величине
+ 2615 - 918
dist/gui/babylon.gui.d.ts


Разлика између датотеке није приказан због своје велике величине
+ 2 - 5466
dist/gui/babylon.gui.js


Разлика између датотеке није приказан због своје велике величине
+ 2 - 4
dist/gui/babylon.gui.min.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
dist/gui/babylon.gui.min.js.map


Разлика између датотеке није приказан због своје велике величине
+ 5441 - 922
dist/gui/babylon.gui.module.d.ts


+ 2 - 2
dist/gui/readme.md

@@ -9,8 +9,8 @@ For usage documentation please visit http://doc.babylonjs.com/overviews/gui
 
 Compiled js files (minified and source) are offered on our public CDN here:
 
-* https://preview.babylonjs.com/gui/babylon.gui.js
-* https://preview.babylonjs.com/gui/babylon.gui.min.js
+* https://cdn.babylonjs.com/gui/babylon.gui.js
+* https://cdn.babylonjs.com/gui/babylon.gui.min.js
 
 ## NPM
 

Разлика између датотеке није приказан због своје велике величине
+ 2 - 5
dist/inspector/babylon.inspector.bundle.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
dist/inspector/babylon.inspector.bundle.js.map


Разлика између датотеке није приказан због своје велике величине
+ 1050 - 1354
dist/inspector/babylon.inspector.d.ts


Разлика између датотеке није приказан због своје велике величине
+ 2393 - 0
dist/inspector/babylon.inspector.module.d.ts


+ 1 - 1
dist/inspector/readme.md

@@ -13,7 +13,7 @@ If you wish however to use a different version of the inspector or host it on yo
 
 The latest compiled js file is offered on our public CDN here:
 
-* https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js
+* https://cdn.babylonjs.com/inspector/babylonjs.inspector.bundle.js
 
 ## NPM
 

+ 113 - 147
dist/loaders/babylon.glTF1FileLoader.d.ts

@@ -1,4 +1,5 @@
 
+
 declare module BABYLON {
     /**
      * Mode that determines the coordinate system to use.
@@ -11,7 +12,7 @@ declare module BABYLON {
         /**
          * Sets the useRightHandedSystem flag on the scene.
          */
-        FORCE_RIGHT_HANDED = 1,
+        FORCE_RIGHT_HANDED = 1
     }
     /**
      * Mode that determines what animations will start.
@@ -28,18 +29,18 @@ declare module BABYLON {
         /**
          * All animations will start.
          */
-        ALL = 2,
+        ALL = 2
     }
     /**
      * Interface that contains the data for the glTF asset.
      */
     interface IGLTFLoaderData {
         /**
-         * JSON that represents the glTF.
+         * Object that represents the glTF JSON.
          */
         json: Object;
         /**
-         * The BIN chunk of a binary glTF
+         * The BIN chunk of a binary glTF.
          */
         bin: Nullable<ArrayBufferView>;
     }
@@ -71,105 +72,27 @@ declare module BABYLON {
         /**
          * The asset is completely loaded.
          */
-        COMPLETE = 2,
+        COMPLETE = 2
     }
-    /**
-     * Loader interface.
-     */
+    /** @hidden */
     interface IGLTFLoader extends IDisposable {
-        /**
-         * Mode that determines the coordinate system to use.
-         */
-        coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
-        /**
-         * Mode that determines what animations will start.
-         */
-        animationStartMode: GLTFLoaderAnimationStartMode;
-        /**
-         * Defines if the loader should compile materials.
-         */
-        compileMaterials: boolean;
-        /**
-         * Defines if the loader should also compile materials with clip planes.
-         */
-        useClipPlane: boolean;
-        /**
-         * Defines if the loader should compile shadow generators.
-         */
-        compileShadowGenerators: boolean;
-        /**
-         * Defines if the Alpha blended materials are only applied as coverage.
-         * If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials.
-         * If true, no extra effects are applied to transparent pixels.
-         */
-        transparencyAsCoverage: boolean;
-        /** @hidden */
-        _normalizeAnimationGroupsToBeginAtZero: boolean;
-        /**
-         * Function called before loading a url referenced by the asset.
-         */
-        preprocessUrlAsync: (url: string) => Promise<string>;
-        /**
-         * Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh.
-         */
-        onMeshLoadedObservable: Observable<AbstractMesh>;
-        /**
-         * Observable raised when the loader creates a texture after parsing the glTF properties of the texture.
-         */
-        onTextureLoadedObservable: Observable<BaseTexture>;
-        /**
-         * Observable raised when the loader creates a material after parsing the glTF properties of the material.
-         */
-        onMaterialLoadedObservable: Observable<Material>;
-        /**
-         * Observable raised when the loader creates a camera after parsing the glTF properties of the camera.
-         */
-        onCameraLoadedObservable: Observable<Camera>;
-        /**
-         * Observable raised when the asset is completely loaded, immediately before the loader is disposed.
-         * For assets with LODs, raised when all of the LODs are complete.
-         * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
-         */
-        onCompleteObservable: Observable<IGLTFLoader>;
-        /**
-         * Observable raised after the loader is disposed.
-         */
-        onDisposeObservable: Observable<IGLTFLoader>;
-        /**
-         * Observable raised after a loader extension is created.
-         * Set additional options for a loader extension in this event.
-         */
-        onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
-        /**
-         * Loader state or null if the loader is not active.
-         */
-        state: Nullable<GLTFLoaderState>;
-        /**
-         * Imports meshes from the given data and adds them to the scene.
-         */
-        importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<{
+        readonly state: Nullable<GLTFLoaderState>;
+        importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string) => Promise<{
             meshes: AbstractMesh[];
-            particleSystems: ParticleSystem[];
+            particleSystems: IParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
-        /**
-         * Loads all objects from the given data and adds them to the scene.
-         */
-        loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<void>;
+        loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string) => Promise<void>;
     }
     /**
      * File loader for loading glTF files into a scene.
      */
     class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
-        /**
-         * Factory function that creates a glTF 1.0 loader
-         */
-        static CreateGLTFLoaderV1: () => IGLTFLoader;
-        /**
-         * Factory function that creates a glTF 2.0 loader
-         */
-        static CreateGLTFLoaderV2: () => IGLTFLoader;
+        /** @hidden */
+        static _CreateGLTFLoaderV1: (parent: GLTFFileLoader) => IGLTFLoader;
+        /** @hidden */
+        static _CreateGLTFLoaderV2: (parent: GLTFFileLoader) => IGLTFLoader;
         /**
          * Raised when the asset has been parsed
          */
@@ -183,11 +106,13 @@ declare module BABYLON {
          * Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders.
          * Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled.
          * Defaults to true.
+         * @hidden
          */
         static IncrementalLoading: boolean;
         /**
          * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters.
          * Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates.
+         * @hidden
          */
         static HomogeneousCoordinates: boolean;
         /**
@@ -216,8 +141,6 @@ declare module BABYLON {
          * If true, no extra effects are applied to transparent pixels.
          */
         transparencyAsCoverage: boolean;
-        /** @hidden */
-        _normalizeAnimationGroupsToBeginAtZero: boolean;
         /**
          * Function called before loading a url referenced by the asset.
          */
@@ -263,16 +186,27 @@ declare module BABYLON {
          * For assets with LODs, raised when all of the LODs are complete.
          * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
          */
-        readonly onCompleteObservable: Observable<GLTFFileLoader>;
+        readonly onCompleteObservable: Observable<void>;
         private _onCompleteObserver;
         /**
          * Callback raised when the asset is completely loaded, immediately before the loader is disposed.
+         * For assets with LODs, raised when all of the LODs are complete.
+         * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
          */
         onComplete: () => void;
         /**
+         * Observable raised when an error occurs.
+         */
+        readonly onErrorObservable: Observable<any>;
+        private _onErrorObserver;
+        /**
+         * Callback raised when an error occurs.
+         */
+        onError: (reason: any) => void;
+        /**
          * Observable raised after the loader is disposed.
          */
-        readonly onDisposeObservable: Observable<GLTFFileLoader>;
+        readonly onDisposeObservable: Observable<void>;
         private _onDisposeObserver;
         /**
          * Callback raised after the loader is disposed.
@@ -289,14 +223,26 @@ declare module BABYLON {
          */
         onExtensionLoaded: (extension: IGLTFLoaderExtension) => void;
         /**
-         * Returns a promise that resolves when the asset is completely loaded.
-         * @returns a promise that resolves when the asset is completely loaded.
+         * Defines if the loader logging is enabled.
          */
-        whenCompleteAsync(): Promise<void>;
+        loggingEnabled: boolean;
         /**
-         * The loader state or null if the loader is not active.
+         * Defines if the loader should capture performance counters.
          */
-        readonly loaderState: Nullable<GLTFLoaderState>;
+        capturePerformanceCounters: boolean;
+        /**
+         * Defines if the loader should validate the asset.
+         */
+        validate: boolean;
+        /**
+         * Observable raised after validation when validate is set to true. The event data is the result of the validation.
+         */
+        readonly onValidatedObservable: Observable<IGLTFValidationResults>;
+        private _onValidatedObserver;
+        /**
+         * Callback raised after a loader extension is created.
+         */
+        onValidated: (results: IGLTFValidationResults) => void;
         private _loader;
         /**
          * Name of the loader ("gltf")
@@ -310,6 +256,8 @@ declare module BABYLON {
          * Disposes the loader, releases resources during load, and cancels any outstanding requests.
          */
         dispose(): void;
+        /** @hidden */
+        _clear(): void;
         /**
          * Imports one or more meshes from the loaded glTF data and adds them to the scene
          * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
@@ -317,11 +265,12 @@ declare module BABYLON {
          * @param data the glTF data to load
          * @param rootUrl root url to load from
          * @param onProgress event that fires when loading progress has occured
+         * @param fileName Defines the name of the file to load
          * @returns a promise containg the loaded meshes, particles, skeletons and animations
          */
-        importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
+        importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<{
             meshes: AbstractMesh[];
-            particleSystems: ParticleSystem[];
+            particleSystems: IParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
@@ -331,18 +280,20 @@ declare module BABYLON {
          * @param data the glTF data to load
          * @param rootUrl root url to load from
          * @param onProgress event that fires when loading progress has occured
+         * @param fileName Defines the name of the file to load
          * @returns a promise which completes when objects have been loaded to the scene
          */
-        loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
+        loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
         /**
          * Load into an asset container.
          * @param scene The scene to load into
          * @param data The data to import
          * @param rootUrl The root url for scene and resources
          * @param onProgress The callback when the load progresses
+         * @param fileName Defines the name of the file to load
          * @returns The loaded asset container
          */
-        loadAssetContainerAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<AssetContainer>;
+        loadAssetContainerAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;
         /**
          * If the data string can be loaded directly.
          * @param data string contianing the file data
@@ -358,14 +309,44 @@ declare module BABYLON {
          * @returns the created plugin
          */
         createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
-        private _parse(data);
-        private _getLoader(loaderData);
-        private static _parseBinary(data);
-        private static _parseV1(binaryReader);
-        private static _parseV2(binaryReader);
-        private static _parseVersion(version);
-        private static _compareVersion(a, b);
-        private static _decodeBufferToText(buffer);
+        /**
+         * The loader state or null if the loader is not active.
+         */
+        readonly loaderState: Nullable<GLTFLoaderState>;
+        /**
+         * Returns a promise that resolves when the asset is completely loaded.
+         * @returns a promise that resolves when the asset is completely loaded.
+         */
+        whenCompleteAsync(): Promise<void>;
+        private _parseAsync;
+        private _validateAsync;
+        private _getLoader;
+        private _unpackBinary;
+        private _unpackBinaryV1;
+        private _unpackBinaryV2;
+        private static _parseVersion;
+        private static _compareVersion;
+        private static _decodeBufferToText;
+        private static readonly _logSpaces;
+        private _logIndentLevel;
+        private _loggingEnabled;
+        /** @hidden */
+        _log: (message: string) => void;
+        /** @hidden */
+        _logOpen(message: string): void;
+        /** @hidden */
+        _logClose(): void;
+        private _logEnabled;
+        private _logDisabled;
+        private _capturePerformanceCounters;
+        /** @hidden */
+        _startPerformanceCounter: (counterName: string) => void;
+        /** @hidden */
+        _endPerformanceCounter: (counterName: string) => void;
+        private _startPerformanceCounterEnabled;
+        private _startPerformanceCounterDisabled;
+        private _endPerformanceCounterEnabled;
+        private _endPerformanceCounterDisabled;
     }
 }
 
@@ -379,11 +360,11 @@ declare module BABYLON.GLTF1 {
         UNSIGNED_BYTE = 5121,
         SHORT = 5122,
         UNSIGNED_SHORT = 5123,
-        FLOAT = 5126,
+        FLOAT = 5126
     }
     enum EShaderType {
         FRAGMENT = 35632,
-        VERTEX = 35633,
+        VERTEX = 35633
     }
     enum EParameterType {
         BYTE = 5120,
@@ -406,12 +387,12 @@ declare module BABYLON.GLTF1 {
         FLOAT_MAT2 = 35674,
         FLOAT_MAT3 = 35675,
         FLOAT_MAT4 = 35676,
-        SAMPLER_2D = 35678,
+        SAMPLER_2D = 35678
     }
     enum ETextureWrapMode {
         CLAMP_TO_EDGE = 33071,
         MIRRORED_REPEAT = 33648,
-        REPEAT = 10497,
+        REPEAT = 10497
     }
     enum ETextureFilterType {
         NEAREST = 9728,
@@ -419,19 +400,19 @@ declare module BABYLON.GLTF1 {
         NEAREST_MIPMAP_NEAREST = 9984,
         LINEAR_MIPMAP_NEAREST = 9985,
         NEAREST_MIPMAP_LINEAR = 9986,
-        LINEAR_MIPMAP_LINEAR = 9987,
+        LINEAR_MIPMAP_LINEAR = 9987
     }
     enum ETextureFormat {
         ALPHA = 6406,
         RGB = 6407,
         RGBA = 6408,
         LUMINANCE = 6409,
-        LUMINANCE_ALPHA = 6410,
+        LUMINANCE_ALPHA = 6410
     }
     enum ECullingType {
         FRONT = 1028,
         BACK = 1029,
-        FRONT_AND_BACK = 1032,
+        FRONT_AND_BACK = 1032
     }
     enum EBlendingFunction {
         ZERO = 0,
@@ -448,7 +429,7 @@ declare module BABYLON.GLTF1 {
         ONE_MINUS_CONSTANT_COLOR = 32770,
         CONSTANT_ALPHA = 32771,
         ONE_MINUS_CONSTANT_ALPHA = 32772,
-        SRC_ALPHA_SATURATE = 776,
+        SRC_ALPHA_SATURATE = 776
     }
     /**
     * Interfaces
@@ -762,24 +743,9 @@ declare module BABYLON.GLTF1 {
             [name: string]: GLTFLoaderExtension;
         };
         static RegisterExtension(extension: GLTFLoaderExtension): void;
-        coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
-        animationStartMode: GLTFLoaderAnimationStartMode;
-        compileMaterials: boolean;
-        useClipPlane: boolean;
-        compileShadowGenerators: boolean;
-        transparencyAsCoverage: boolean;
-        _normalizeAnimationGroupsToBeginAtZero: boolean;
-        preprocessUrlAsync: (url: string) => Promise<string>;
-        readonly onMeshLoadedObservable: Observable<AbstractMesh>;
-        readonly onTextureLoadedObservable: Observable<BaseTexture>;
-        readonly onMaterialLoadedObservable: Observable<Material>;
-        readonly onCameraLoadedObservable: Observable<Camera>;
-        readonly onCompleteObservable: Observable<IGLTFLoader>;
-        readonly onDisposeObservable: Observable<IGLTFLoader>;
-        readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
         state: Nullable<GLTFLoaderState>;
         dispose(): void;
-        private _importMeshAsync(meshesNames, scene, data, rootUrl, onSuccess, onProgress?, onError?);
+        private _importMeshAsync;
         /**
         * Imports one or more meshes from a loaded gltf file and adds them to the scene
         * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
@@ -791,11 +757,11 @@ declare module BABYLON.GLTF1 {
         */
         importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
             meshes: AbstractMesh[];
-            particleSystems: ParticleSystem[];
+            particleSystems: IParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
-        private _loadAsync(scene, data, rootUrl, onSuccess, onProgress?, onError?);
+        private _loadAsync;
         /**
         * Imports all objects from a loaded gltf file and adds them to the scene
         * @param scene the scene the objects should be added to
@@ -805,9 +771,9 @@ declare module BABYLON.GLTF1 {
         * @returns a promise which completes when objects have been loaded to the scene
         */
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
-        private _loadShadersAsync(gltfRuntime, onload);
-        private _loadBuffersAsync(gltfRuntime, onLoad, onProgress?);
-        private _createNodes(gltfRuntime);
+        private _loadShadersAsync;
+        private _loadBuffersAsync;
+        private _createNodes;
     }
 }
 
@@ -819,7 +785,7 @@ declare module BABYLON.GLTF1 {
     class GLTFUtils {
         /**
          * Sets the given "parameter" matrix
-         * @param scene: the {BABYLON.Scene} object
+         * @param scene: the Scene object
          * @param source: the source node where to pick the matrix
          * @param parameter: the GLTF technique parameter
          * @param uniformName: the name of the shader's uniform
@@ -918,9 +884,9 @@ declare module BABYLON.GLTF1 {
         static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: (message: string) => void): void;
         static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string | ArrayBuffer) => void, onError: (message: string) => void): void;
         static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): void;
-        private static LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError);
-        private static CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError);
-        private static ApplyExtensions(func, defaultFunc);
+        private static LoadTextureBufferAsync;
+        private static CreateTextureAsync;
+        private static ApplyExtensions;
     }
 }
 
@@ -942,6 +908,6 @@ declare module BABYLON.GLTF1 {
         constructor();
         loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: (message: string) => void): boolean;
         loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean;
-        private _loadTexture(gltfRuntime, id, material, propertyPath, onError);
+        private _loadTexture;
     }
 }

+ 280 - 130
dist/loaders/babylon.glTF1FileLoader.js

@@ -1,4 +1,5 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/glTF2Interface/babylon.glTF2Interface.d.ts"/>
 var BABYLON;
 (function (BABYLON) {
     /**
@@ -56,13 +57,16 @@ var BABYLON;
      */
     var GLTFFileLoader = /** @class */ (function () {
         function GLTFFileLoader() {
-            // #region Common options
+            // --------------
+            // Common options
+            // --------------
             /**
              * Raised when the asset has been parsed
              */
             this.onParsedObservable = new BABYLON.Observable();
-            // #endregion
-            // #region V2 options
+            // ----------
+            // V2 options
+            // ----------
             /**
              * The coordinate system mode. Defaults to AUTO.
              */
@@ -89,8 +93,6 @@ var BABYLON;
              * If true, no extra effects are applied to transparent pixels.
              */
             this.transparencyAsCoverage = false;
-            /** @hidden */
-            this._normalizeAnimationGroupsToBeginAtZero = true;
             /**
              * Function called before loading a url referenced by the asset.
              */
@@ -118,6 +120,10 @@ var BABYLON;
              */
             this.onCompleteObservable = new BABYLON.Observable();
             /**
+             * Observable raised when an error occurs.
+             */
+            this.onErrorObservable = new BABYLON.Observable();
+            /**
              * Observable raised after the loader is disposed.
              */
             this.onDisposeObservable = new BABYLON.Observable();
@@ -126,7 +132,14 @@ var BABYLON;
              * Set additional options for a loader extension in this event.
              */
             this.onExtensionLoadedObservable = new BABYLON.Observable();
-            // #endregion
+            /**
+             * Defines if the loader should validate the asset.
+             */
+            this.validate = false;
+            /**
+             * Observable raised after validation when validate is set to true. The event data is the result of the validation.
+             */
+            this.onValidatedObservable = new BABYLON.Observable();
             this._loader = null;
             /**
              * Name of the loader ("gltf")
@@ -139,6 +152,15 @@ var BABYLON;
                 ".gltf": { isBinary: false },
                 ".glb": { isBinary: true }
             };
+            this._logIndentLevel = 0;
+            this._loggingEnabled = false;
+            /** @hidden */
+            this._log = this._logDisabled;
+            this._capturePerformanceCounters = false;
+            /** @hidden */
+            this._startPerformanceCounter = this._startPerformanceCounterDisabled;
+            /** @hidden */
+            this._endPerformanceCounter = this._endPerformanceCounterDisabled;
         }
         Object.defineProperty(GLTFFileLoader.prototype, "onParsed", {
             /**
@@ -208,6 +230,8 @@ var BABYLON;
         Object.defineProperty(GLTFFileLoader.prototype, "onComplete", {
             /**
              * Callback raised when the asset is completely loaded, immediately before the loader is disposed.
+             * For assets with LODs, raised when all of the LODs are complete.
+             * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
              */
             set: function (callback) {
                 if (this._onCompleteObserver) {
@@ -218,6 +242,19 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(GLTFFileLoader.prototype, "onError", {
+            /**
+             * Callback raised when an error occurs.
+             */
+            set: function (callback) {
+                if (this._onErrorObserver) {
+                    this.onErrorObservable.remove(this._onErrorObserver);
+                }
+                this._onErrorObserver = this.onErrorObservable.add(callback);
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(GLTFFileLoader.prototype, "onDispose", {
             /**
              * Callback raised after the loader is disposed.
@@ -244,24 +281,61 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        /**
-         * Returns a promise that resolves when the asset is completely loaded.
-         * @returns a promise that resolves when the asset is completely loaded.
-         */
-        GLTFFileLoader.prototype.whenCompleteAsync = function () {
-            var _this = this;
-            return new Promise(function (resolve) {
-                _this.onCompleteObservable.add(function () {
-                    resolve();
-                }, undefined, undefined, undefined, true);
-            });
-        };
-        Object.defineProperty(GLTFFileLoader.prototype, "loaderState", {
+        Object.defineProperty(GLTFFileLoader.prototype, "loggingEnabled", {
             /**
-             * The loader state or null if the loader is not active.
+             * Defines if the loader logging is enabled.
              */
             get: function () {
-                return this._loader ? this._loader.state : null;
+                return this._loggingEnabled;
+            },
+            set: function (value) {
+                if (this._loggingEnabled === value) {
+                    return;
+                }
+                this._loggingEnabled = value;
+                if (this._loggingEnabled) {
+                    this._log = this._logEnabled;
+                }
+                else {
+                    this._log = this._logDisabled;
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(GLTFFileLoader.prototype, "capturePerformanceCounters", {
+            /**
+             * Defines if the loader should capture performance counters.
+             */
+            get: function () {
+                return this._capturePerformanceCounters;
+            },
+            set: function (value) {
+                if (this._capturePerformanceCounters === value) {
+                    return;
+                }
+                this._capturePerformanceCounters = value;
+                if (this._capturePerformanceCounters) {
+                    this._startPerformanceCounter = this._startPerformanceCounterEnabled;
+                    this._endPerformanceCounter = this._endPerformanceCounterEnabled;
+                }
+                else {
+                    this._startPerformanceCounter = this._startPerformanceCounterDisabled;
+                    this._endPerformanceCounter = this._endPerformanceCounterDisabled;
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(GLTFFileLoader.prototype, "onValidated", {
+            /**
+             * Callback raised after a loader extension is created.
+             */
+            set: function (callback) {
+                if (this._onValidatedObserver) {
+                    this.onValidatedObservable.remove(this._onValidatedObserver);
+                }
+                this._onValidatedObserver = this.onValidatedObservable.add(callback);
             },
             enumerable: true,
             configurable: true
@@ -274,6 +348,12 @@ var BABYLON;
                 this._loader.dispose();
                 this._loader = null;
             }
+            this._clear();
+            this.onDisposeObservable.notifyObservers(undefined);
+            this.onDisposeObservable.clear();
+        };
+        /** @hidden */
+        GLTFFileLoader.prototype._clear = function () {
             this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
             this.onMeshLoadedObservable.clear();
             this.onTextureLoadedObservable.clear();
@@ -281,8 +361,6 @@ var BABYLON;
             this.onCameraLoadedObservable.clear();
             this.onCompleteObservable.clear();
             this.onExtensionLoadedObservable.clear();
-            this.onDisposeObservable.notifyObservers(this);
-            this.onDisposeObservable.clear();
         };
         /**
          * Imports one or more meshes from the loaded glTF data and adds them to the scene
@@ -291,14 +369,15 @@ var BABYLON;
          * @param data the glTF data to load
          * @param rootUrl root url to load from
          * @param onProgress event that fires when loading progress has occured
+         * @param fileName Defines the name of the file to load
          * @returns a promise containg the loaded meshes, particles, skeletons and animations
          */
-        GLTFFileLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
+        GLTFFileLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress, fileName) {
             var _this = this;
-            return Promise.resolve().then(function () {
-                var loaderData = _this._parse(data);
+            return this._parseAsync(scene, data, rootUrl, fileName).then(function (loaderData) {
+                _this._log("Loading " + (fileName || ""));
                 _this._loader = _this._getLoader(loaderData);
-                return _this._loader.importMeshAsync(meshesNames, scene, loaderData, rootUrl, onProgress);
+                return _this._loader.importMeshAsync(meshesNames, scene, loaderData, rootUrl, onProgress, fileName);
             });
         };
         /**
@@ -307,14 +386,15 @@ var BABYLON;
          * @param data the glTF data to load
          * @param rootUrl root url to load from
          * @param onProgress event that fires when loading progress has occured
+         * @param fileName Defines the name of the file to load
          * @returns a promise which completes when objects have been loaded to the scene
          */
-        GLTFFileLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress) {
+        GLTFFileLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress, fileName) {
             var _this = this;
-            return Promise.resolve().then(function () {
-                var loaderData = _this._parse(data);
+            return this._parseAsync(scene, data, rootUrl, fileName).then(function (loaderData) {
+                _this._log("Loading " + (fileName || ""));
                 _this._loader = _this._getLoader(loaderData);
-                return _this._loader.loadAsync(scene, loaderData, rootUrl, onProgress);
+                return _this._loader.loadAsync(scene, loaderData, rootUrl, onProgress, fileName);
             });
         };
         /**
@@ -323,14 +403,15 @@ var BABYLON;
          * @param data The data to import
          * @param rootUrl The root url for scene and resources
          * @param onProgress The callback when the load progresses
+         * @param fileName Defines the name of the file to load
          * @returns The loaded asset container
          */
-        GLTFFileLoader.prototype.loadAssetContainerAsync = function (scene, data, rootUrl, onProgress) {
+        GLTFFileLoader.prototype.loadAssetContainerAsync = function (scene, data, rootUrl, onProgress, fileName) {
             var _this = this;
-            return Promise.resolve().then(function () {
-                var loaderData = _this._parse(data);
+            return this._parseAsync(scene, data, rootUrl, fileName).then(function (loaderData) {
+                _this._log("Loading " + (fileName || ""));
                 _this._loader = _this._getLoader(loaderData);
-                return _this._loader.importMeshAsync(null, scene, loaderData, rootUrl, onProgress).then(function (result) {
+                return _this._loader.importMeshAsync(null, scene, loaderData, rootUrl, onProgress, fileName).then(function (result) {
                     var container = new BABYLON.AssetContainer(scene);
                     Array.prototype.push.apply(container.meshes, result.meshes);
                     Array.prototype.push.apply(container.particleSystems, result.particleSystems);
@@ -356,25 +437,76 @@ var BABYLON;
         GLTFFileLoader.prototype.createPlugin = function () {
             return new GLTFFileLoader();
         };
-        GLTFFileLoader.prototype._parse = function (data) {
-            var parsedData;
-            if (data instanceof ArrayBuffer) {
-                parsedData = GLTFFileLoader._parseBinary(data);
+        Object.defineProperty(GLTFFileLoader.prototype, "loaderState", {
+            /**
+             * The loader state or null if the loader is not active.
+             */
+            get: function () {
+                return this._loader ? this._loader.state : null;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        /**
+         * Returns a promise that resolves when the asset is completely loaded.
+         * @returns a promise that resolves when the asset is completely loaded.
+         */
+        GLTFFileLoader.prototype.whenCompleteAsync = function () {
+            var _this = this;
+            return new Promise(function (resolve, reject) {
+                _this.onCompleteObservable.addOnce(function () {
+                    resolve();
+                });
+                _this.onErrorObservable.addOnce(function (reason) {
+                    reject(reason);
+                });
+            });
+        };
+        GLTFFileLoader.prototype._parseAsync = function (scene, data, rootUrl, fileName) {
+            var _this = this;
+            return Promise.resolve().then(function () {
+                var unpacked = (data instanceof ArrayBuffer) ? _this._unpackBinary(data) : { json: data, bin: null };
+                return _this._validateAsync(scene, unpacked.json, rootUrl, fileName).then(function () {
+                    _this._startPerformanceCounter("Parse JSON");
+                    _this._log("JSON length: " + unpacked.json.length);
+                    var loaderData = {
+                        json: JSON.parse(unpacked.json),
+                        bin: unpacked.bin
+                    };
+                    _this._endPerformanceCounter("Parse JSON");
+                    _this.onParsedObservable.notifyObservers(loaderData);
+                    _this.onParsedObservable.clear();
+                    return loaderData;
+                });
+            });
+        };
+        GLTFFileLoader.prototype._validateAsync = function (scene, json, rootUrl, fileName) {
+            var _this = this;
+            if (!this.validate || typeof GLTFValidator === "undefined") {
+                return Promise.resolve();
             }
-            else {
-                parsedData = {
-                    json: JSON.parse(data),
-                    bin: null
-                };
+            this._startPerformanceCounter("Validate JSON");
+            var options = {
+                externalResourceFunction: function (uri) {
+                    return _this.preprocessUrlAsync(rootUrl + uri)
+                        .then(function (url) { return scene._loadFileAsync(url, true, true); })
+                        .then(function (data) { return new Uint8Array(data); });
+                }
+            };
+            if (fileName && fileName.substr(0, 5) !== "data:") {
+                options.uri = (rootUrl === "file:" ? fileName : "" + rootUrl + fileName);
             }
-            this.onParsedObservable.notifyObservers(parsedData);
-            this.onParsedObservable.clear();
-            return parsedData;
+            return GLTFValidator.validateString(json, options).then(function (result) {
+                _this._endPerformanceCounter("Validate JSON");
+                _this.onValidatedObservable.notifyObservers(result);
+                _this.onValidatedObservable.clear();
+            });
         };
         GLTFFileLoader.prototype._getLoader = function (loaderData) {
-            var _this = this;
-            var loaderVersion = { major: 2, minor: 0 };
             var asset = loaderData.json.asset || {};
+            this._log("Asset version: " + asset.version);
+            asset.minVersion && this._log("Asset minimum version: " + asset.minVersion);
+            asset.generator && this._log("Asset generator: " + asset.generator);
             var version = GLTFFileLoader._parseVersion(asset.version);
             if (!version) {
                 throw new Error("Invalid version: " + asset.version);
@@ -384,44 +516,23 @@ var BABYLON;
                 if (!minVersion) {
                     throw new Error("Invalid minimum version: " + asset.minVersion);
                 }
-                if (GLTFFileLoader._compareVersion(minVersion, loaderVersion) > 0) {
+                if (GLTFFileLoader._compareVersion(minVersion, { major: 2, minor: 0 }) > 0) {
                     throw new Error("Incompatible minimum version: " + asset.minVersion);
                 }
             }
             var createLoaders = {
-                1: GLTFFileLoader.CreateGLTFLoaderV1,
-                2: GLTFFileLoader.CreateGLTFLoaderV2
+                1: GLTFFileLoader._CreateGLTFLoaderV1,
+                2: GLTFFileLoader._CreateGLTFLoaderV2
             };
             var createLoader = createLoaders[version.major];
             if (!createLoader) {
                 throw new Error("Unsupported version: " + asset.version);
             }
-            var loader = createLoader();
-            loader.coordinateSystemMode = this.coordinateSystemMode;
-            loader.animationStartMode = this.animationStartMode;
-            loader.compileMaterials = this.compileMaterials;
-            loader.useClipPlane = this.useClipPlane;
-            loader.compileShadowGenerators = this.compileShadowGenerators;
-            loader.transparencyAsCoverage = this.transparencyAsCoverage;
-            loader._normalizeAnimationGroupsToBeginAtZero = this._normalizeAnimationGroupsToBeginAtZero;
-            loader.preprocessUrlAsync = this.preprocessUrlAsync;
-            loader.onMeshLoadedObservable.add(function (mesh) { return _this.onMeshLoadedObservable.notifyObservers(mesh); });
-            loader.onTextureLoadedObservable.add(function (texture) { return _this.onTextureLoadedObservable.notifyObservers(texture); });
-            loader.onMaterialLoadedObservable.add(function (material) { return _this.onMaterialLoadedObservable.notifyObservers(material); });
-            loader.onCameraLoadedObservable.add(function (camera) { return _this.onCameraLoadedObservable.notifyObservers(camera); });
-            loader.onExtensionLoadedObservable.add(function (extension) { return _this.onExtensionLoadedObservable.notifyObservers(extension); });
-            loader.onCompleteObservable.add(function () {
-                _this.onMeshLoadedObservable.clear();
-                _this.onTextureLoadedObservable.clear();
-                _this.onMaterialLoadedObservable.clear();
-                _this.onCameraLoadedObservable.clear();
-                _this.onExtensionLoadedObservable.clear();
-                _this.onCompleteObservable.notifyObservers(_this);
-                _this.onCompleteObservable.clear();
-            });
-            return loader;
+            return createLoader(this);
         };
-        GLTFFileLoader._parseBinary = function (data) {
+        GLTFFileLoader.prototype._unpackBinary = function (data) {
+            this._startPerformanceCounter("Unpack binary");
+            this._log("Binary length: " + data.byteLength);
             var Binary = {
                 Magic: 0x46546C67
             };
@@ -431,13 +542,27 @@ var BABYLON;
                 throw new Error("Unexpected magic: " + magic);
             }
             var version = binaryReader.readUint32();
+            if (this.loggingEnabled) {
+                this._log("Binary version: " + version);
+            }
+            var unpacked;
             switch (version) {
-                case 1: return GLTFFileLoader._parseV1(binaryReader);
-                case 2: return GLTFFileLoader._parseV2(binaryReader);
+                case 1: {
+                    unpacked = this._unpackBinaryV1(binaryReader);
+                    break;
+                }
+                case 2: {
+                    unpacked = this._unpackBinaryV2(binaryReader);
+                    break;
+                }
+                default: {
+                    throw new Error("Unsupported version: " + version);
+                }
             }
-            throw new Error("Unsupported version: " + version);
+            this._endPerformanceCounter("Unpack binary");
+            return unpacked;
         };
-        GLTFFileLoader._parseV1 = function (binaryReader) {
+        GLTFFileLoader.prototype._unpackBinaryV1 = function (binaryReader) {
             var ContentFormat = {
                 JSON: 0
             };
@@ -450,7 +575,7 @@ var BABYLON;
             var content;
             switch (contentFormat) {
                 case ContentFormat.JSON: {
-                    content = JSON.parse(GLTFFileLoader._decodeBufferToText(binaryReader.readUint8Array(contentLength)));
+                    content = GLTFFileLoader._decodeBufferToText(binaryReader.readUint8Array(contentLength));
                     break;
                 }
                 default: {
@@ -464,7 +589,7 @@ var BABYLON;
                 bin: body
             };
         };
-        GLTFFileLoader._parseV2 = function (binaryReader) {
+        GLTFFileLoader.prototype._unpackBinaryV2 = function (binaryReader) {
             var ChunkFormat = {
                 JSON: 0x4E4F534A,
                 BIN: 0x004E4942
@@ -479,7 +604,7 @@ var BABYLON;
             if (chunkFormat !== ChunkFormat.JSON) {
                 throw new Error("First chunk format is not JSON");
             }
-            var json = JSON.parse(GLTFFileLoader._decodeBufferToText(binaryReader.readUint8Array(chunkLength)));
+            var json = GLTFFileLoader._decodeBufferToText(binaryReader.readUint8Array(chunkLength));
             // Look for BIN chunk
             var bin = null;
             while (binaryReader.getPosition() < binaryReader.getLength()) {
@@ -522,14 +647,18 @@ var BABYLON;
             };
         };
         GLTFFileLoader._compareVersion = function (a, b) {
-            if (a.major > b.major)
+            if (a.major > b.major) {
                 return 1;
-            if (a.major < b.major)
+            }
+            if (a.major < b.major) {
                 return -1;
-            if (a.minor > b.minor)
+            }
+            if (a.minor > b.minor) {
                 return 1;
-            if (a.minor < b.minor)
+            }
+            if (a.minor < b.minor) {
                 return -1;
+            }
             return 0;
         };
         GLTFFileLoader._decodeBufferToText = function (buffer) {
@@ -540,19 +669,48 @@ var BABYLON;
             }
             return result;
         };
-        // #endregion
-        // #region V1 options
+        /** @hidden */
+        GLTFFileLoader.prototype._logOpen = function (message) {
+            this._log(message);
+            this._logIndentLevel++;
+        };
+        /** @hidden */
+        GLTFFileLoader.prototype._logClose = function () {
+            --this._logIndentLevel;
+        };
+        GLTFFileLoader.prototype._logEnabled = function (message) {
+            var spaces = GLTFFileLoader._logSpaces.substr(0, this._logIndentLevel * 2);
+            BABYLON.Tools.Log("" + spaces + message);
+        };
+        GLTFFileLoader.prototype._logDisabled = function (message) {
+        };
+        GLTFFileLoader.prototype._startPerformanceCounterEnabled = function (counterName) {
+            BABYLON.Tools.StartPerformanceCounter(counterName);
+        };
+        GLTFFileLoader.prototype._startPerformanceCounterDisabled = function (counterName) {
+        };
+        GLTFFileLoader.prototype._endPerformanceCounterEnabled = function (counterName) {
+            BABYLON.Tools.EndPerformanceCounter(counterName);
+        };
+        GLTFFileLoader.prototype._endPerformanceCounterDisabled = function (counterName) {
+        };
+        // ----------
+        // V1 options
+        // ----------
         /**
          * Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders.
          * Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled.
          * Defaults to true.
+         * @hidden
          */
         GLTFFileLoader.IncrementalLoading = true;
         /**
          * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters.
          * Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates.
+         * @hidden
          */
         GLTFFileLoader.HomogeneousCoordinates = false;
+        GLTFFileLoader._logSpaces = "                                ";
         return GLTFFileLoader;
     }());
     BABYLON.GLTFFileLoader = GLTFFileLoader;
@@ -713,8 +871,9 @@ var BABYLON;
                 this._maxPos = toParse.length;
             }
             Tokenizer.prototype.getNextToken = function () {
-                if (this.isEnd())
+                if (this.isEnd()) {
                     return ETokenType.END_OF_INPUT;
+                }
                 this.currentString = this.read();
                 this.currentToken = ETokenType.UNKNOWN;
                 if (this.currentString === "_" || this.isLetterOrDigitPattern.test(this.currentString)) {
@@ -1805,7 +1964,7 @@ var BABYLON;
                     (sampler.minFilter === GLTF1.ETextureFilterType.LINEAR_MIPMAP_NEAREST) ||
                     (sampler.minFilter === GLTF1.ETextureFilterType.LINEAR_MIPMAP_LINEAR);
                 var samplingMode = BABYLON.Texture.BILINEAR_SAMPLINGMODE;
-                var blob = new Blob([buffer]);
+                var blob = buffer == null ? new Blob() : new Blob([buffer]);
                 var blobURL = URL.createObjectURL(blob);
                 var revokeBlobURL = function () { return URL.revokeObjectURL(blobURL); };
                 var newTexture = new BABYLON.Texture(blobURL, gltfRuntime.scene, !createMipMaps, true, samplingMode, revokeBlobURL, revokeBlobURL);
@@ -1889,7 +2048,10 @@ var BABYLON;
                     var attribute = technique.attributes[attr];
                     var attributeParameter = technique.parameters[attribute];
                     if (attributeParameter.semantic) {
-                        attributes.push(getAttribute(attributeParameter));
+                        var name_1 = getAttribute(attributeParameter);
+                        if (name_1) {
+                            attributes.push(name_1);
+                        }
                     }
                 }
                 // Configure vertex shader
@@ -1976,22 +2138,6 @@ var BABYLON;
         */
         var GLTFLoader = /** @class */ (function () {
             function GLTFLoader() {
-                // #region Stubs for IGLTFLoader interface
-                this.coordinateSystemMode = BABYLON.GLTFLoaderCoordinateSystemMode.AUTO;
-                this.animationStartMode = BABYLON.GLTFLoaderAnimationStartMode.FIRST;
-                this.compileMaterials = false;
-                this.useClipPlane = false;
-                this.compileShadowGenerators = false;
-                this.transparencyAsCoverage = false;
-                this._normalizeAnimationGroupsToBeginAtZero = true;
-                this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
-                this.onMeshLoadedObservable = new BABYLON.Observable();
-                this.onTextureLoadedObservable = new BABYLON.Observable();
-                this.onMaterialLoadedObservable = new BABYLON.Observable();
-                this.onCameraLoadedObservable = new BABYLON.Observable();
-                this.onCompleteObservable = new BABYLON.Observable();
-                this.onDisposeObservable = new BABYLON.Observable();
-                this.onExtensionLoadedObservable = new BABYLON.Observable();
                 this.state = null;
             }
             GLTFLoader.RegisterExtension = function (extension) {
@@ -2001,8 +2147,9 @@ var BABYLON;
                 }
                 GLTFLoader.Extensions[extension.name] = extension;
             };
-            GLTFLoader.prototype.dispose = function () { };
-            // #endregion
+            GLTFLoader.prototype.dispose = function () {
+                // do nothing
+            };
             GLTFLoader.prototype._importMeshAsync = function (meshesNames, scene, data, rootUrl, onSuccess, onProgress, onError) {
                 var _this = this;
                 scene.useRightHandedSystem = true;
@@ -2152,7 +2299,6 @@ var BABYLON;
                     onload();
                 }
             };
-            ;
             GLTFLoader.prototype._loadBuffersAsync = function (gltfRuntime, onLoad, onProgress) {
                 var hasBuffers = false;
                 var processBuffer = function (buf, buffer) {
@@ -2207,8 +2353,7 @@ var BABYLON;
             return GLTFLoader;
         }());
         GLTF1.GLTFLoader = GLTFLoader;
-        ;
-        BABYLON.GLTFFileLoader.CreateGLTFLoaderV1 = function () { return new GLTFLoader(); };
+        BABYLON.GLTFFileLoader._CreateGLTFLoaderV1 = function () { return new GLTFLoader(); };
     })(GLTF1 = BABYLON.GLTF1 || (BABYLON.GLTF1 = {}));
 })(BABYLON || (BABYLON = {}));
 
@@ -2227,7 +2372,7 @@ var BABYLON;
             }
             /**
              * Sets the given "parameter" matrix
-             * @param scene: the {BABYLON.Scene} object
+             * @param scene: the Scene object
              * @param source: the source node where to pick the matrix
              * @param parameter: the GLTF technique parameter
              * @param uniformName: the name of the shader's uniform
@@ -2599,9 +2744,12 @@ var BABYLON;
 
 /// <reference path="../../../../dist/preview release/babylon.d.ts"/>
 var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    }
     return function (d, b) {
         extendStatics(d, b);
         function __() { this.constructor = d; }
@@ -2613,8 +2761,6 @@ var BABYLON;
     var GLTF1;
     (function (GLTF1) {
         var BinaryExtensionBufferName = "binary_glTF";
-        ;
-        ;
         var GLTFBinaryExtension = /** @class */ (function (_super) {
             __extends(GLTFBinaryExtension, _super);
             function GLTFBinaryExtension() {
@@ -2676,9 +2822,12 @@ var BABYLON;
 
 /// <reference path="../../../../dist/preview release/babylon.d.ts"/>
 var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    }
     return function (d, b) {
         extendStatics(d, b);
         function __() { this.constructor = d; }
@@ -2689,20 +2838,19 @@ var BABYLON;
 (function (BABYLON) {
     var GLTF1;
     (function (GLTF1) {
-        ;
-        ;
-        ;
         var GLTFMaterialsCommonExtension = /** @class */ (function (_super) {
             __extends(GLTFMaterialsCommonExtension, _super);
             function GLTFMaterialsCommonExtension() {
                 return _super.call(this, "KHR_materials_common") || this;
             }
             GLTFMaterialsCommonExtension.prototype.loadRuntimeExtensionsAsync = function (gltfRuntime, onSuccess, onError) {
-                if (!gltfRuntime.extensions)
+                if (!gltfRuntime.extensions) {
                     return false;
+                }
                 var extension = gltfRuntime.extensions[this.name];
-                if (!extension)
+                if (!extension) {
                     return false;
+                }
                 // Create lights
                 var lights = extension.lights;
                 if (lights) {
@@ -2747,11 +2895,13 @@ var BABYLON;
             };
             GLTFMaterialsCommonExtension.prototype.loadMaterialAsync = function (gltfRuntime, id, onSuccess, onError) {
                 var material = gltfRuntime.materials[id];
-                if (!material || !material.extensions)
+                if (!material || !material.extensions) {
                     return false;
+                }
                 var extension = material.extensions[this.name];
-                if (!extension)
+                if (!extension) {
                     return false;
+                }
                 var standardMaterial = new BABYLON.StandardMaterial(id, gltfRuntime.scene);
                 standardMaterial.sideOrientation = BABYLON.Material.CounterClockWiseSideOrientation;
                 if (extension.technique === "CONSTANT") {

Разлика између датотеке није приказан због своје велике величине
+ 1 - 2
dist/loaders/babylon.glTF1FileLoader.min.js


Разлика између датотеке није приказан због своје велике величине
+ 736 - 403
dist/loaders/babylon.glTF2FileLoader.d.ts


Разлика између датотеке није приказан због своје велике величине
+ 1955 - 1176
dist/loaders/babylon.glTF2FileLoader.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 2
dist/loaders/babylon.glTF2FileLoader.min.js


Разлика између датотеке није приказан због своје велике величине
+ 752 - 434
dist/loaders/babylon.glTFFileLoader.d.ts


Разлика између датотеке није приказан због своје велике величине
+ 1995 - 1220
dist/loaders/babylon.glTFFileLoader.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 3
dist/loaders/babylon.glTFFileLoader.min.js


+ 41 - 7
dist/loaders/babylon.objFileLoader.d.ts

@@ -26,9 +26,9 @@ declare module BABYLON {
          * @param value The value stored in the mtl
          * @return The Texture
          */
-        private static _getTexture(rootUrl, value, scene);
+        private static _getTexture;
     }
-    class OBJFileLoader implements ISceneLoaderPlugin {
+    class OBJFileLoader implements ISceneLoaderPluginAsync {
         static OPTIMIZE_WITH_UV: boolean;
         static INVERT_Y: boolean;
         name: string;
@@ -45,6 +45,7 @@ declare module BABYLON {
         facePattern2: RegExp;
         facePattern3: RegExp;
         facePattern4: RegExp;
+        facePattern5: RegExp;
         /**
          * Calls synchronously the MTL file attached to this obj.
          * Load function or importMesh function don't enable to load 2 files in the same time asynchronously.
@@ -56,10 +57,43 @@ declare module BABYLON {
          * @param onSuccess Callback function to be called when the MTL file is loaded
          * @private
          */
-        private _loadMTL(url, rootUrl, onSuccess);
-        importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: Nullable<AbstractMesh[]>, particleSystems: Nullable<ParticleSystem[]>, skeletons: Nullable<Skeleton[]>): boolean;
-        load(scene: Scene, data: string, rootUrl: string): boolean;
-        loadAssetContainer(scene: Scene, data: string, rootUrl: string, onError?: (message: string, exception?: any) => void): AssetContainer;
+        private _loadMTL;
+        /**
+         * Imports one or more meshes from the loaded glTF data and adds them to the scene
+         * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+         * @param scene the scene the meshes should be added to
+         * @param data the glTF data to load
+         * @param rootUrl root url to load from
+         * @param onProgress event that fires when loading progress has occured
+         * @param fileName Defines the name of the file to load
+         * @returns a promise containg the loaded meshes, particles, skeletons and animations
+         */
+        importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<{
+            meshes: AbstractMesh[];
+            particleSystems: IParticleSystem[];
+            skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
+        }>;
+        /**
+         * Imports all objects from the loaded glTF data and adds them to the scene
+         * @param scene the scene the objects should be added to
+         * @param data the glTF data to load
+         * @param rootUrl root url to load from
+         * @param onProgress event that fires when loading progress has occured
+         * @param fileName Defines the name of the file to load
+         * @returns a promise which completes when objects have been loaded to the scene
+         */
+        loadAsync(scene: Scene, data: string, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
+        /**
+         * Load into an asset container.
+         * @param scene The scene to load into
+         * @param data The data to import
+         * @param rootUrl The root url for scene and resources
+         * @param onProgress The callback when the load progresses
+         * @param fileName Defines the name of the file to load
+         * @returns The loaded asset container
+         */
+        loadAssetContainerAsync(scene: Scene, data: string, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;
         /**
          * Read the OBJ file and create an Array of meshes.
          * Each mesh contains all information given by the OBJ and the MTL file.
@@ -72,6 +106,6 @@ declare module BABYLON {
          * @returns Array<AbstractMesh>
          * @private
          */
-        private _parseSolid(meshesNames, scene, data, rootUrl);
+        private _parseSolid;
     }
 }

+ 131 - 48
dist/loaders/babylon.objFileLoader.js

@@ -231,6 +231,8 @@ var BABYLON;
             this.facePattern3 = /f\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){3,})+)/;
             // f vertex//normal vertex//normal vertex//normal ...
             this.facePattern4 = /f\s+((([\d]{1,}\/\/[\d]{1,}[\s]?){3,})+)/;
+            // f -vertex/-uvs/-normal -vertex/-uvs/-normal -vertex/-uvs/-normal ...
+            this.facePattern5 = /f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/;
         }
         /**
          * Calls synchronously the MTL file attached to this obj.
@@ -249,26 +251,58 @@ var BABYLON;
             // Loads through the babylon tools to allow fileInput search.
             BABYLON.Tools.LoadFile(pathOfFile, onSuccess, undefined, undefined, false, function () { console.warn("Error - Unable to load " + pathOfFile); });
         };
-        OBJFileLoader.prototype.importMesh = function (meshesNames, scene, data, rootUrl, meshes, particleSystems, skeletons) {
+        /**
+         * Imports one or more meshes from the loaded glTF data and adds them to the scene
+         * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+         * @param scene the scene the meshes should be added to
+         * @param data the glTF data to load
+         * @param rootUrl root url to load from
+         * @param onProgress event that fires when loading progress has occured
+         * @param fileName Defines the name of the file to load
+         * @returns a promise containg the loaded meshes, particles, skeletons and animations
+         */
+        OBJFileLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress, fileName) {
             //get the meshes from OBJ file
-            var loadedMeshes = this._parseSolid(meshesNames, scene, data, rootUrl);
-            //Push meshes from OBJ file into the variable mesh of this function
-            if (meshes) {
-                loadedMeshes.forEach(function (mesh) {
-                    meshes.push(mesh);
-                });
-            }
-            return true;
+            return this._parseSolid(meshesNames, scene, data, rootUrl).then(function (meshes) {
+                return {
+                    meshes: meshes,
+                    particleSystems: [],
+                    skeletons: [],
+                    animationGroups: []
+                };
+            });
         };
-        OBJFileLoader.prototype.load = function (scene, data, rootUrl) {
+        /**
+         * Imports all objects from the loaded glTF data and adds them to the scene
+         * @param scene the scene the objects should be added to
+         * @param data the glTF data to load
+         * @param rootUrl root url to load from
+         * @param onProgress event that fires when loading progress has occured
+         * @param fileName Defines the name of the file to load
+         * @returns a promise which completes when objects have been loaded to the scene
+         */
+        OBJFileLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress, fileName) {
             //Get the 3D model
-            return this.importMesh(null, scene, data, rootUrl, null, null, null);
+            return this.importMeshAsync(null, scene, data, rootUrl, onProgress).then(function () {
+                // return void
+            });
         };
-        OBJFileLoader.prototype.loadAssetContainer = function (scene, data, rootUrl, onError) {
-            var container = new BABYLON.AssetContainer(scene);
-            this.importMesh(null, scene, data, rootUrl, container.meshes, null, null);
-            container.removeAllFromScene();
-            return container;
+        /**
+         * Load into an asset container.
+         * @param scene The scene to load into
+         * @param data The data to import
+         * @param rootUrl The root url for scene and resources
+         * @param onProgress The callback when the load progresses
+         * @param fileName Defines the name of the file to load
+         * @returns The loaded asset container
+         */
+        OBJFileLoader.prototype.loadAssetContainerAsync = function (scene, data, rootUrl, onProgress, fileName) {
+            return this.importMeshAsync(null, scene, data, rootUrl).then(function (result) {
+                var container = new BABYLON.AssetContainer(scene);
+                result.meshes.forEach(function (mesh) { return container.meshes.push(mesh); });
+                container.removeAllFromScene();
+                return container;
+            });
         };
         /**
          * Read the OBJ file and create an Array of meshes.
@@ -283,6 +317,7 @@ var BABYLON;
          * @private
          */
         OBJFileLoader.prototype._parseSolid = function (meshesNames, scene, data, rootUrl) {
+            var _this = this;
             var positions = []; //values for the positions of vertices
             var normals = []; //Values for the normals
             var uvs = []; //Values for the textures
@@ -315,14 +350,16 @@ var BABYLON;
              * @returns {boolean}
              */
             var isInArray = function (arr, obj) {
-                if (!arr[obj[0]])
+                if (!arr[obj[0]]) {
                     arr[obj[0]] = { normals: [], idx: [] };
+                }
                 var idx = arr[obj[0]].normals.indexOf(obj[1]);
                 return idx === -1 ? -1 : arr[obj[0]].idx[idx];
             };
             var isInArrayUV = function (arr, obj) {
-                if (!arr[obj[0]])
+                if (!arr[obj[0]]) {
                     arr[obj[0]] = { normals: [], idx: [], uv: [] };
+                }
                 var idx = arr[obj[0]].normals.indexOf(obj[1]);
                 if (idx != 1 && (obj[2] == arr[obj[0]].uv[idx])) {
                     return arr[obj[0]].idx[idx];
@@ -376,8 +413,9 @@ var BABYLON;
                     //Add the tuple in the comparison list
                     tuplePosNorm[indicePositionFromObj].normals.push(indiceNormalFromObj);
                     tuplePosNorm[indicePositionFromObj].idx.push(curPositionInIndices++);
-                    if (OBJFileLoader.OPTIMIZE_WITH_UV)
+                    if (OBJFileLoader.OPTIMIZE_WITH_UV) {
                         tuplePosNorm[indicePositionFromObj].uv.push(indiceUvsFromObj);
+                    }
                 }
                 else {
                     //The tuple already exists
@@ -408,11 +446,12 @@ var BABYLON;
              * Create triangles from polygons by recursion
              * The best to understand how it works is to draw it in the same time you get the recursion.
              * It is important to notice that a triangle is a polygon
-             * We get 4 patterns of face defined in OBJ File :
+             * We get 5 patterns of face defined in OBJ File :
              * facePattern1 = ["1","2","3","4","5","6"]
              * facePattern2 = ["1/1","2/2","3/3","4/4","5/5","6/6"]
              * facePattern3 = ["1/1/1","2/2/2","3/3/3","4/4/4","5/5/5","6/6/6"]
              * facePattern4 = ["1//1","2//2","3//3","4//4","5//5","6//6"]
+             * facePattern5 = ["-1/-1/-1","-2/-2/-2","-3/-3/-3","-4/-4/-4","-5/-5/-5","-6/-6/-6"]
              * Each pattern is divided by the same method
              * @param face Array[String] The indices of elements
              * @param v Integer The variable to increment
@@ -432,6 +471,7 @@ var BABYLON;
                 //Pattern2 => triangle = ["1/1","2/2","3/3","1/1","3/3","4/4"];
                 //Pattern3 => triangle = ["1/1/1","2/2/2","3/3/3","1/1/1","3/3/3","4/4/4"];
                 //Pattern4 => triangle = ["1//1","2//2","3//3","1//1","3//3","4//4"];
+                //Pattern5 => triangle = ["-1/-1/-1","-2/-2/-2","-3/-3/-3","-1/-1/-1","-3/-3/-3","-4/-4/-4"];
             };
             /**
              * Create triangles and push the data for each polygon for the pattern 1
@@ -527,6 +567,31 @@ var BABYLON;
                 //Reset variable for the next line
                 triangles = [];
             };
+            /**
+             * Create triangles and push the data for each polygon for the pattern 3
+             * In this pattern we get vertice positions, uvs and normals
+             * @param face
+             * @param v
+             */
+            var setDataForCurrentFaceWithPattern5 = function (face, v) {
+                //Get the indices of triangles for each polygon
+                getTriangles(face, v);
+                for (var k = 0; k < triangles.length; k++) {
+                    //triangle[k] = "-1/-1/-1"
+                    //Split the data for getting position, uv, and normals
+                    var point = triangles[k].split("/"); // ["-1", "-1", "-1"]
+                    // Set position indice
+                    var indicePositionFromObj = positions.length + parseInt(point[0]);
+                    // Set uv indice
+                    var indiceUvsFromObj = uvs.length + parseInt(point[1]);
+                    // Set normal indice
+                    var indiceNormalFromObj = normals.length + parseInt(point[2]);
+                    setData(indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, positions[indicePositionFromObj], uvs[indiceUvsFromObj], normals[indiceNormalFromObj] //Set the vector for each component
+                    );
+                }
+                //Reset variable for the next line
+                triangles = [];
+            };
             var addPreviousObjMesh = function () {
                 //Check if it is not the first mesh. Otherwise we don't have data.
                 if (meshesFromObj.length > 0) {
@@ -599,6 +664,13 @@ var BABYLON;
                     setDataForCurrentFaceWithPattern4(result[1].trim().split(" "), // ["1//1", "2//2", "3//3"]
                     1);
                 }
+                else if ((result = this.facePattern5.exec(line)) !== null) {
+                    //Value of result:
+                    //["f -1/-1/-1 -2/-2/-2 -3/-3/-3", "-1/-1/-1 -2/-2/-2 -3/-3/-3"...]
+                    //Set the data for this face
+                    setDataForCurrentFaceWithPattern5(result[1].trim().split(" "), // ["-1/-1/-1", "-2/-2/-2", "-3/-3/-3"]
+                    1);
+                }
                 else if ((result = this.facePattern2.exec(line)) !== null) {
                     //Value of result:
                     //["f 1/1 2/2 3/3", "1/1 2/2 3/3"...]
@@ -752,42 +824,53 @@ var BABYLON;
                 //Push the mesh into an array
                 babylonMeshesArray.push(babylonMesh);
             }
+            var mtlPromises = [];
             //load the materials
             //Check if we have a file to load
             if (fileToLoad !== "") {
                 //Load the file synchronously
-                this._loadMTL(fileToLoad, rootUrl, function (dataLoaded) {
-                    //Create materials thanks MTLLoader function
-                    materialsFromMTLFile.parseMTL(scene, dataLoaded, rootUrl);
-                    //Look at each material loaded in the mtl file
-                    for (var n = 0; n < materialsFromMTLFile.materials.length; n++) {
-                        //Three variables to get all meshes with the same material
-                        var startIndex = 0;
-                        var _indices = [];
-                        var _index;
-                        //The material from MTL file is used in the meshes loaded
-                        //Push the indice in an array
-                        //Check if the material is not used for another mesh
-                        while ((_index = materialToUse.indexOf(materialsFromMTLFile.materials[n].name, startIndex)) > -1) {
-                            _indices.push(_index);
-                            startIndex = _index + 1;
-                        }
-                        //If the material is not used dispose it
-                        if (_index == -1 && _indices.length == 0) {
-                            //If the material is not needed, remove it
-                            materialsFromMTLFile.materials[n].dispose();
-                        }
-                        else {
-                            for (var o = 0; o < _indices.length; o++) {
-                                //Apply the material to the BABYLON.Mesh for each mesh with the material
-                                babylonMeshesArray[_indices[o]].material = materialsFromMTLFile.materials[n];
+                mtlPromises.push(new Promise(function (resolve, reject) {
+                    _this._loadMTL(fileToLoad, rootUrl, function (dataLoaded) {
+                        try {
+                            //Create materials thanks MTLLoader function
+                            materialsFromMTLFile.parseMTL(scene, dataLoaded, rootUrl);
+                            //Look at each material loaded in the mtl file
+                            for (var n = 0; n < materialsFromMTLFile.materials.length; n++) {
+                                //Three variables to get all meshes with the same material
+                                var startIndex = 0;
+                                var _indices = [];
+                                var _index;
+                                //The material from MTL file is used in the meshes loaded
+                                //Push the indice in an array
+                                //Check if the material is not used for another mesh
+                                while ((_index = materialToUse.indexOf(materialsFromMTLFile.materials[n].name, startIndex)) > -1) {
+                                    _indices.push(_index);
+                                    startIndex = _index + 1;
+                                }
+                                //If the material is not used dispose it
+                                if (_index == -1 && _indices.length == 0) {
+                                    //If the material is not needed, remove it
+                                    materialsFromMTLFile.materials[n].dispose();
+                                }
+                                else {
+                                    for (var o = 0; o < _indices.length; o++) {
+                                        //Apply the material to the BABYLON.Mesh for each mesh with the material
+                                        babylonMeshesArray[_indices[o]].material = materialsFromMTLFile.materials[n];
+                                    }
+                                }
                             }
+                            resolve();
                         }
-                    }
-                });
+                        catch (e) {
+                            reject(e);
+                        }
+                    });
+                }));
             }
             //Return an array with all BABYLON.Mesh
-            return babylonMeshesArray;
+            return Promise.all(mtlPromises).then(function () {
+                return babylonMeshesArray;
+            });
         };
         OBJFileLoader.OPTIMIZE_WITH_UV = false;
         OBJFileLoader.INVERT_Y = false;

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/loaders/babylon.objFileLoader.min.js


+ 4 - 4
dist/loaders/babylon.stlFileLoader.d.ts

@@ -7,11 +7,11 @@ declare module BABYLON {
         vertexPattern: RegExp;
         name: string;
         extensions: ISceneLoaderPluginExtensions;
-        importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: Nullable<AbstractMesh[]>, particleSystems: Nullable<ParticleSystem[]>, skeletons: Nullable<Skeleton[]>): boolean;
+        importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: Nullable<AbstractMesh[]>, particleSystems: Nullable<IParticleSystem[]>, skeletons: Nullable<Skeleton[]>): boolean;
         load(scene: Scene, data: any, rootUrl: string): boolean;
         loadAssetContainer(scene: Scene, data: string, rootUrl: string, onError?: (message: string, exception?: any) => void): AssetContainer;
-        private isBinary(data);
-        private parseBinary(mesh, data);
-        private parseASCII(mesh, solidData);
+        private isBinary;
+        private parseBinary;
+        private parseASCII;
     }
 }

+ 18 - 15
dist/loaders/babylon.stlFileLoader.js

@@ -16,23 +16,26 @@ var BABYLON;
         }
         STLFileLoader.prototype.importMesh = function (meshesNames, scene, data, rootUrl, meshes, particleSystems, skeletons) {
             var matches;
-            if (this.isBinary(data)) {
-                // binary .stl
-                var babylonMesh = new BABYLON.Mesh("stlmesh", scene);
-                this.parseBinary(babylonMesh, data);
-                if (meshes) {
-                    meshes.push(babylonMesh);
+            if (typeof data !== "string") {
+                if (this.isBinary(data)) {
+                    // binary .stl
+                    var babylonMesh = new BABYLON.Mesh("stlmesh", scene);
+                    this.parseBinary(babylonMesh, data);
+                    if (meshes) {
+                        meshes.push(babylonMesh);
+                    }
+                    return true;
                 }
-                return true;
-            }
-            // ASCII .stl
-            // convert to string
-            var array_buffer = new Uint8Array(data);
-            var str = '';
-            for (var i = 0; i < data.byteLength; i++) {
-                str += String.fromCharCode(array_buffer[i]); // implicitly assumes little-endian
+                // ASCII .stl
+                // convert to string
+                var array_buffer = new Uint8Array(data);
+                var str = '';
+                for (var i = 0; i < data.byteLength; i++) {
+                    str += String.fromCharCode(array_buffer[i]); // implicitly assumes little-endian
+                }
+                data = str;
             }
-            data = str;
+            //if arrived here, data is a string, containing the STLA data.
             while (matches = this.solidPattern.exec(data)) {
                 var meshName = matches[1];
                 var meshNameFromEnd = matches[3];

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/loaders/babylon.stlFileLoader.min.js


Разлика између датотеке није приказан због своје велике величине
+ 797 - 445
dist/loaders/babylonjs.loaders.d.ts


Разлика између датотеке није приказан због своје велике величине
+ 2126 - 1208
dist/loaders/babylonjs.loaders.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 4
dist/loaders/babylonjs.loaders.min.js


Разлика између датотеке није приказан због своје велике величине
+ 797 - 445
dist/loaders/babylonjs.loaders.module.d.ts


+ 2 - 2
dist/loaders/readme.md

@@ -9,8 +9,8 @@ For usage documentation please visit http://doc.babylonjs.com/extensions and cho
 
 Compiled js files (minified and source) are offered on our public CDN here:
 
-* https://preview.babylonjs.com/loaders/babylonjs.loaders.js
-* https://preview.babylonjs.com/loaders/babylonjs.loaders.min.js
+* https://cdn.babylonjs.com/loaders/babylonjs.loaders.js
+* https://cdn.babylonjs.com/loaders/babylonjs.loaders.min.js
 
 ## NPM
 

+ 14 - 8
dist/materialsLibrary/babylon.cellMaterial.js

@@ -1,8 +1,11 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    }
     return function (d, b) {
         extendStatics(d, b);
         function __() { this.constructor = d; }
@@ -23,6 +26,9 @@ var BABYLON;
             var _this = _super.call(this) || this;
             _this.DIFFUSE = false;
             _this.CLIPPLANE = false;
+            _this.CLIPPLANE2 = false;
+            _this.CLIPPLANE3 = false;
+            _this.CLIPPLANE4 = false;
             _this.ALPHATEST = false;
             _this.POINTSIZE = false;
             _this.FOG = false;
@@ -62,7 +68,7 @@ var BABYLON;
         CellMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         CellMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -105,7 +111,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -140,7 +146,7 @@ var BABYLON;
                     "vFogInfos", "vFogColor", "pointSize",
                     "vDiffuseInfos",
                     "mBones",
-                    "vClipPlane", "diffuseMatrix"
+                    "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "diffuseMatrix"
                 ];
                 var samplers = ["diffuseSampler"];
                 var uniformBuffers = new Array();
@@ -181,13 +187,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/materialsLibrary/babylon.cellMaterial.min.js


+ 6 - 3
dist/materialsLibrary/babylon.customMaterial.js

@@ -1,8 +1,11 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    }
     return function (d, b) {
         extendStatics(d, b);
         function __() { this.constructor = d; }

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/materialsLibrary/babylon.customMaterial.min.js


+ 14 - 11
dist/materialsLibrary/babylon.fireMaterial.js

@@ -1,8 +1,11 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    }
     return function (d, b) {
         extendStatics(d, b);
         function __() { this.constructor = d; }
@@ -23,6 +26,9 @@ var BABYLON;
             var _this = _super.call(this) || this;
             _this.DIFFUSE = false;
             _this.CLIPPLANE = false;
+            _this.CLIPPLANE2 = false;
+            _this.CLIPPLANE3 = false;
+            _this.CLIPPLANE4 = false;
             _this.ALPHATEST = false;
             _this.DEPTHPREPASS = false;
             _this.POINTSIZE = false;
@@ -57,7 +63,7 @@ var BABYLON;
         FireMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         FireMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -98,7 +104,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -129,7 +135,7 @@ var BABYLON;
                         "vFogInfos", "vFogColor", "pointSize",
                         "vDiffuseInfos",
                         "mBones",
-                        "vClipPlane", "diffuseMatrix",
+                        "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "diffuseMatrix",
                         // Fire
                         "time", "speed"
                     ],
@@ -171,7 +177,7 @@ var BABYLON;
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);
@@ -180,10 +186,7 @@ var BABYLON;
                     this._activeEffect.setTexture("opacitySampler", this._opacityTexture);
                 }
                 // Clip plane
-                if (scene.clipPlane) {
-                    var clipPlane = scene.clipPlane;
-                    this._activeEffect.setFloat4("vClipPlane", clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d);
-                }
+                BABYLON.MaterialHelper.BindClipPlane(this._activeEffect, scene);
                 // Point size
                 if (this.pointsCloud) {
                     this._activeEffect.setFloat("pointSize", this.pointSize);

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/materialsLibrary/babylon.fireMaterial.min.js


+ 15 - 9
dist/materialsLibrary/babylon.furMaterial.js

@@ -1,8 +1,11 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    }
     return function (d, b) {
         extendStatics(d, b);
         function __() { this.constructor = d; }
@@ -24,6 +27,9 @@ var BABYLON;
             _this.DIFFUSE = false;
             _this.HEIGHTMAP = false;
             _this.CLIPPLANE = false;
+            _this.CLIPPLANE2 = false;
+            _this.CLIPPLANE3 = false;
+            _this.CLIPPLANE4 = false;
             _this.ALPHATEST = false;
             _this.DEPTHPREPASS = false;
             _this.POINTSIZE = false;
@@ -97,7 +103,7 @@ var BABYLON;
                 offsetFur.furDensity = this.furDensity;
             }
         };
-        // Methods   
+        // Methods
         FurMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -143,7 +149,7 @@ var BABYLON;
                 defines.HIGHLEVEL = true;
                 defines.markAsUnprocessed();
             }
-            // Misc.   
+            // Misc.
             BABYLON.MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);
             // Lights
             defines._needNormals = BABYLON.MaterialHelper.PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);
@@ -151,7 +157,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -187,7 +193,7 @@ var BABYLON;
                     "vFogInfos", "vFogColor", "pointSize",
                     "vDiffuseInfos",
                     "mBones",
-                    "vClipPlane", "diffuseMatrix",
+                    "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "diffuseMatrix",
                     "furLength", "furAngle", "furColor", "furOffset", "furGravity", "furTime", "furSpacing", "furDensity", "furOcclusion"
                 ];
                 var samplers = ["diffuseSampler",
@@ -231,13 +237,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (scene.getCachedMaterial() !== this) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/materialsLibrary/babylon.furMaterial.min.js


+ 1 - 0
dist/materialsLibrary/babylon.gradientMaterial.d.ts

@@ -8,6 +8,7 @@ declare module BABYLON {
         bottomColor: Color3;
         bottomColorAlpha: number;
         offset: number;
+        scale: number;
         smoothness: number;
         disableLighting: boolean;
         private _scaledDiffuse;

Разлика између датотеке није приказан због своје велике величине
+ 20 - 9
dist/materialsLibrary/babylon.gradientMaterial.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/materialsLibrary/babylon.gradientMaterial.min.js


+ 7 - 4
dist/materialsLibrary/babylon.gridMaterial.js

@@ -1,8 +1,11 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    }
     return function (d, b) {
         extendStatics(d, b);
         function __() { this.constructor = d; }
@@ -111,7 +114,7 @@ var BABYLON;
                 defines.markAsUnprocessed();
             }
             BABYLON.MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, false, this.fogEnabled, false, defines);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/materialsLibrary/babylon.gridMaterial.min.js


+ 2 - 0
dist/materialsLibrary/babylon.lavaMaterial.d.ts

@@ -13,6 +13,8 @@ declare module BABYLON {
         diffuseColor: Color3;
         private _disableLighting;
         disableLighting: boolean;
+        private _unlit;
+        unlit: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
         private _scaledDiffuse;

Разлика између датотеке није приказан због своје велике величине
+ 26 - 10
dist/materialsLibrary/babylon.lavaMaterial.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/materialsLibrary/babylon.lavaMaterial.min.js


+ 56 - 0
dist/materialsLibrary/babylon.mixMaterial.d.ts

@@ -0,0 +1,56 @@
+
+declare module BABYLON {
+    class MixMaterial extends PushMaterial {
+        /**
+         * Mix textures
+         */
+        private _mixTexture1;
+        mixTexture1: BaseTexture;
+        private _mixTexture2;
+        mixTexture2: BaseTexture;
+        /**
+         * Diffuse textures
+         */
+        private _diffuseTexture1;
+        diffuseTexture1: Texture;
+        private _diffuseTexture2;
+        diffuseTexture2: Texture;
+        private _diffuseTexture3;
+        diffuseTexture3: Texture;
+        private _diffuseTexture4;
+        diffuseTexture4: Texture;
+        private _diffuseTexture5;
+        diffuseTexture5: Texture;
+        private _diffuseTexture6;
+        diffuseTexture6: Texture;
+        private _diffuseTexture7;
+        diffuseTexture7: Texture;
+        private _diffuseTexture8;
+        diffuseTexture8: Texture;
+        /**
+         * Uniforms
+         */
+        diffuseColor: Color3;
+        specularColor: Color3;
+        specularPower: number;
+        private _disableLighting;
+        disableLighting: boolean;
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: number;
+        private _renderId;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        getActiveTextures(): BaseTexture[];
+        hasTexture(texture: BaseTexture): boolean;
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): MixMaterial;
+        serialize(): any;
+        getClassName(): string;
+        static Parse(source: any, scene: Scene, rootUrl: string): MixMaterial;
+    }
+}

Разлика између датотеке није приказан због своје велике величине
+ 475 - 0
dist/materialsLibrary/babylon.mixMaterial.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
dist/materialsLibrary/babylon.mixMaterial.min.js


+ 14 - 8
dist/materialsLibrary/babylon.normalMaterial.js

@@ -1,8 +1,11 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    }
     return function (d, b) {
         extendStatics(d, b);
         function __() { this.constructor = d; }
@@ -23,6 +26,9 @@ var BABYLON;
             var _this = _super.call(this) || this;
             _this.DIFFUSE = false;
             _this.CLIPPLANE = false;
+            _this.CLIPPLANE2 = false;
+            _this.CLIPPLANE3 = false;
+            _this.CLIPPLANE4 = false;
             _this.ALPHATEST = false;
             _this.DEPTHPREPASS = false;
             _this.POINTSIZE = false;
@@ -99,7 +105,7 @@ var BABYLON;
         NormalMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         NormalMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -140,7 +146,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -175,7 +181,7 @@ var BABYLON;
                     "vFogInfos", "vFogColor", "pointSize",
                     "vDiffuseInfos",
                     "mBones",
-                    "vClipPlane", "diffuseMatrix"
+                    "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "diffuseMatrix"
                 ];
                 var samplers = ["diffuseSampler"];
                 var uniformBuffers = new Array();
@@ -216,13 +222,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this.diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level);

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/materialsLibrary/babylon.normalMaterial.min.js


+ 1 - 0
dist/materialsLibrary/babylon.shadowOnlyMaterial.d.ts

@@ -4,6 +4,7 @@ declare module BABYLON {
         private _renderId;
         private _activeLight;
         constructor(name: string, scene: Scene);
+        shadowColor: Color3;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         getAlphaTestTexture(): Nullable<BaseTexture>;

Разлика између датотеке није приказан због своје велике величине
+ 19 - 10
dist/materialsLibrary/babylon.shadowOnlyMaterial.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/materialsLibrary/babylon.shadowOnlyMaterial.min.js


+ 14 - 8
dist/materialsLibrary/babylon.simpleMaterial.js

@@ -1,8 +1,11 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    }
     return function (d, b) {
         extendStatics(d, b);
         function __() { this.constructor = d; }
@@ -23,6 +26,9 @@ var BABYLON;
             var _this = _super.call(this) || this;
             _this.DIFFUSE = false;
             _this.CLIPPLANE = false;
+            _this.CLIPPLANE2 = false;
+            _this.CLIPPLANE3 = false;
+            _this.CLIPPLANE4 = false;
             _this.ALPHATEST = false;
             _this.DEPTHPREPASS = false;
             _this.POINTSIZE = false;
@@ -58,7 +64,7 @@ var BABYLON;
         SimpleMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         SimpleMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -99,7 +105,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -134,7 +140,7 @@ var BABYLON;
                     "vFogInfos", "vFogColor", "pointSize",
                     "vDiffuseInfos",
                     "mBones",
-                    "vClipPlane", "diffuseMatrix"
+                    "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "diffuseMatrix"
                 ];
                 var samplers = ["diffuseSampler"];
                 var uniformBuffers = new Array();
@@ -175,13 +181,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/materialsLibrary/babylon.simpleMaterial.min.js


+ 14 - 12
dist/materialsLibrary/babylon.skyMaterial.js

@@ -1,8 +1,11 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    }
     return function (d, b) {
         extendStatics(d, b);
         function __() { this.constructor = d; }
@@ -22,6 +25,9 @@ var BABYLON;
         function SkyMaterialDefines() {
             var _this = _super.call(this) || this;
             _this.CLIPPLANE = false;
+            _this.CLIPPLANE2 = false;
+            _this.CLIPPLANE3 = false;
+            _this.CLIPPLANE4 = false;
             _this.POINTSIZE = false;
             _this.FOG = false;
             _this.VERTEXCOLOR = false;
@@ -59,7 +65,7 @@ var BABYLON;
         SkyMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         SkyMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -79,7 +85,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, false, defines);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, false);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -96,7 +102,7 @@ var BABYLON;
                 var shaderName = "sky";
                 var join = defines.toString();
                 subMesh.setEffect(scene.getEngine().createEffect(shaderName, attribs, ["world", "viewProjection", "view",
-                    "vFogInfos", "vFogColor", "pointSize", "vClipPlane",
+                    "vFogInfos", "vFogColor", "pointSize", "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4",
                     "luminance", "turbidity", "rayleigh", "mieCoefficient", "mieDirectionalG", "sunPosition",
                     "cameraPosition"
                 ], [], join, fallbacks, this.onCompiled, this.onError), defines);
@@ -119,15 +125,11 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             if (this._mustRebind(scene, effect)) {
-                // Clip plane
-                if (scene.clipPlane) {
-                    var clipPlane = scene.clipPlane;
-                    this._activeEffect.setFloat4("vClipPlane", clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d);
-                }
+                BABYLON.MaterialHelper.BindClipPlane(this._activeEffect, scene);
                 // Point size
                 if (this.pointsCloud) {
                     this._activeEffect.setFloat("pointSize", this.pointSize);

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/materialsLibrary/babylon.skyMaterial.min.js


Разлика између датотеке није приказан због своје велике величине
+ 16 - 10
dist/materialsLibrary/babylon.terrainMaterial.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/materialsLibrary/babylon.terrainMaterial.min.js


+ 14 - 8
dist/materialsLibrary/babylon.triPlanarMaterial.js

@@ -1,8 +1,11 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    }
     return function (d, b) {
         extendStatics(d, b);
         function __() { this.constructor = d; }
@@ -28,6 +31,9 @@ var BABYLON;
             _this.BUMPY = false;
             _this.BUMPZ = false;
             _this.CLIPPLANE = false;
+            _this.CLIPPLANE2 = false;
+            _this.CLIPPLANE3 = false;
+            _this.CLIPPLANE4 = false;
             _this.ALPHATEST = false;
             _this.DEPTHPREPASS = false;
             _this.POINTSIZE = false;
@@ -65,7 +71,7 @@ var BABYLON;
         TriPlanarMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         TriPlanarMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -124,7 +130,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -153,7 +159,7 @@ var BABYLON;
                 var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor",
                     "vFogInfos", "vFogColor", "pointSize",
                     "mBones",
-                    "vClipPlane",
+                    "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4",
                     "tileSize"
                 ];
                 var samplers = ["diffuseSamplerX", "diffuseSamplerY", "diffuseSamplerZ",
@@ -197,14 +203,14 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             this._activeEffect.setFloat("tileSize", this.tileSize);
             if (scene.getCachedMaterial() !== this) {
-                // Textures        
+                // Textures
                 if (this.diffuseTextureX) {
                     this._activeEffect.setTexture("diffuseSamplerX", this.diffuseTextureX);
                 }

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/materialsLibrary/babylon.triPlanarMaterial.min.js


+ 5 - 1
dist/materialsLibrary/babylon.waterMaterial.d.ts

@@ -77,6 +77,10 @@ declare module BABYLON {
         private _useLogarithmicDepth;
         private _waitingRenderList;
         /**
+         * Gets a boolean indicating that current material needs to register RTT
+         */
+        readonly hasRenderTargetTextures: boolean;
+        /**
         * Constructor
         */
         constructor(name: string, scene: Scene, renderTargetSize?: Vector2);
@@ -92,7 +96,7 @@ declare module BABYLON {
         getAlphaTestTexture(): Nullable<BaseTexture>;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
-        private _createRenderTargets(scene, renderTargetSize);
+        private _createRenderTargets;
         getAnimatables(): IAnimatable[];
         getActiveTextures(): BaseTexture[];
         hasTexture(texture: BaseTexture): boolean;

+ 23 - 13
dist/materialsLibrary/babylon.waterMaterial.js

@@ -1,8 +1,11 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    }
     return function (d, b) {
         extendStatics(d, b);
         function __() { this.constructor = d; }
@@ -24,6 +27,9 @@ var BABYLON;
             _this.BUMP = false;
             _this.REFLECTION = false;
             _this.CLIPPLANE = false;
+            _this.CLIPPLANE2 = false;
+            _this.CLIPPLANE3 = false;
+            _this.CLIPPLANE4 = false;
             _this.ALPHATEST = false;
             _this.DEPTHPREPASS = false;
             _this.POINTSIZE = false;
@@ -130,6 +136,16 @@ var BABYLON;
             };
             return _this;
         }
+        Object.defineProperty(WaterMaterial.prototype, "hasRenderTargetTextures", {
+            /**
+             * Gets a boolean indicating that current material needs to register RTT
+             */
+            get: function () {
+                return true;
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(WaterMaterial.prototype, "useLogarithmicDepth", {
             get: function () {
                 return this._useLogarithmicDepth;
@@ -253,7 +269,7 @@ var BABYLON;
                 }
                 this._waitingRenderList = null;
             }
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -292,7 +308,7 @@ var BABYLON;
                     "vFogInfos", "vFogColor", "pointSize",
                     "vNormalInfos",
                     "mBones",
-                    "vClipPlane", "normalMatrix",
+                    "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "normalMatrix",
                     "logarithmicDepthConstant",
                     // Water
                     "worldReflectionViewProjection", "windDirection", "waveLength", "time", "windForce",
@@ -340,13 +356,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this.bumpTexture && BABYLON.StandardMaterial.BumpTextureEnabled) {
                     this._activeEffect.setTexture("normalSampler", this.bumpTexture);
                     this._activeEffect.setFloat2("vNormalInfos", this.bumpTexture.coordinatesIndex, this.bumpTexture.level);
@@ -421,17 +437,11 @@ var BABYLON;
                     isVisible = _this._mesh.isVisible;
                     _this._mesh.isVisible = false;
                 }
-                // Clip plane
-                clipPlane = scene.clipPlane;
-                var positiony = _this._mesh ? _this._mesh.position.y : 0.0;
-                scene.clipPlane = BABYLON.Plane.FromPositionAndNormal(new BABYLON.Vector3(0, positiony + 0.05, 0), new BABYLON.Vector3(0, 1, 0));
             };
             this._refractionRTT.onAfterRender = function () {
                 if (_this._mesh) {
                     _this._mesh.isVisible = isVisible;
                 }
-                // Clip plane 
-                scene.clipPlane = clipPlane;
             };
             this._reflectionRTT.onBeforeRender = function () {
                 if (_this._mesh) {

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/materialsLibrary/babylon.waterMaterial.min.js


+ 66 - 1
dist/materialsLibrary/babylonjs.materials.d.ts

@@ -4,6 +4,7 @@ declare module BABYLON {
         private _renderId;
         private _activeLight;
         constructor(name: string, scene: Scene);
+        shadowColor: Color3;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         getAlphaTestTexture(): Nullable<BaseTexture>;
@@ -27,6 +28,7 @@ declare module BABYLON {
         bottomColor: Color3;
         bottomColorAlpha: number;
         offset: number;
+        scale: number;
         smoothness: number;
         disableLighting: boolean;
         private _scaledDiffuse;
@@ -89,6 +91,8 @@ declare module BABYLON {
         diffuseColor: Color3;
         private _disableLighting;
         disableLighting: boolean;
+        private _unlit;
+        unlit: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
         private _scaledDiffuse;
@@ -217,6 +221,10 @@ declare module BABYLON {
         private _useLogarithmicDepth;
         private _waitingRenderList;
         /**
+         * Gets a boolean indicating that current material needs to register RTT
+         */
+        readonly hasRenderTargetTextures: boolean;
+        /**
         * Constructor
         */
         constructor(name: string, scene: Scene, renderTargetSize?: Vector2);
@@ -232,7 +240,7 @@ declare module BABYLON {
         getAlphaTestTexture(): Nullable<BaseTexture>;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
-        private _createRenderTargets(scene, renderTargetSize);
+        private _createRenderTargets;
         getAnimatables(): IAnimatable[];
         getActiveTextures(): BaseTexture[];
         hasTexture(texture: BaseTexture): boolean;
@@ -367,6 +375,63 @@ declare module BABYLON {
 
 
 declare module BABYLON {
+    class MixMaterial extends PushMaterial {
+        /**
+         * Mix textures
+         */
+        private _mixTexture1;
+        mixTexture1: BaseTexture;
+        private _mixTexture2;
+        mixTexture2: BaseTexture;
+        /**
+         * Diffuse textures
+         */
+        private _diffuseTexture1;
+        diffuseTexture1: Texture;
+        private _diffuseTexture2;
+        diffuseTexture2: Texture;
+        private _diffuseTexture3;
+        diffuseTexture3: Texture;
+        private _diffuseTexture4;
+        diffuseTexture4: Texture;
+        private _diffuseTexture5;
+        diffuseTexture5: Texture;
+        private _diffuseTexture6;
+        diffuseTexture6: Texture;
+        private _diffuseTexture7;
+        diffuseTexture7: Texture;
+        private _diffuseTexture8;
+        diffuseTexture8: Texture;
+        /**
+         * Uniforms
+         */
+        diffuseColor: Color3;
+        specularColor: Color3;
+        specularPower: number;
+        private _disableLighting;
+        disableLighting: boolean;
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: number;
+        private _renderId;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        getActiveTextures(): BaseTexture[];
+        hasTexture(texture: BaseTexture): boolean;
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): MixMaterial;
+        serialize(): any;
+        getClassName(): string;
+        static Parse(source: any, scene: Scene, rootUrl: string): MixMaterial;
+    }
+}
+
+
+declare module BABYLON {
     class TriPlanarMaterial extends PushMaterial {
         mixTexture: BaseTexture;
         private _diffuseTextureX;

Разлика између датотеке није приказан због своје велике величине
+ 591 - 81
dist/materialsLibrary/babylonjs.materials.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 5
dist/materialsLibrary/babylonjs.materials.min.js


+ 66 - 1
dist/materialsLibrary/babylonjs.materials.module.d.ts

@@ -9,6 +9,7 @@ declare module BABYLON {
         private _renderId;
         private _activeLight;
         constructor(name: string, scene: Scene);
+        shadowColor: Color3;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         getAlphaTestTexture(): Nullable<BaseTexture>;
@@ -32,6 +33,7 @@ declare module BABYLON {
         bottomColor: Color3;
         bottomColorAlpha: number;
         offset: number;
+        scale: number;
         smoothness: number;
         disableLighting: boolean;
         private _scaledDiffuse;
@@ -94,6 +96,8 @@ declare module BABYLON {
         diffuseColor: Color3;
         private _disableLighting;
         disableLighting: boolean;
+        private _unlit;
+        unlit: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
         private _scaledDiffuse;
@@ -222,6 +226,10 @@ declare module BABYLON {
         private _useLogarithmicDepth;
         private _waitingRenderList;
         /**
+         * Gets a boolean indicating that current material needs to register RTT
+         */
+        readonly hasRenderTargetTextures: boolean;
+        /**
         * Constructor
         */
         constructor(name: string, scene: Scene, renderTargetSize?: Vector2);
@@ -237,7 +245,7 @@ declare module BABYLON {
         getAlphaTestTexture(): Nullable<BaseTexture>;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
-        private _createRenderTargets(scene, renderTargetSize);
+        private _createRenderTargets;
         getAnimatables(): IAnimatable[];
         getActiveTextures(): BaseTexture[];
         hasTexture(texture: BaseTexture): boolean;
@@ -372,6 +380,63 @@ declare module BABYLON {
 
 
 declare module BABYLON {
+    class MixMaterial extends PushMaterial {
+        /**
+         * Mix textures
+         */
+        private _mixTexture1;
+        mixTexture1: BaseTexture;
+        private _mixTexture2;
+        mixTexture2: BaseTexture;
+        /**
+         * Diffuse textures
+         */
+        private _diffuseTexture1;
+        diffuseTexture1: Texture;
+        private _diffuseTexture2;
+        diffuseTexture2: Texture;
+        private _diffuseTexture3;
+        diffuseTexture3: Texture;
+        private _diffuseTexture4;
+        diffuseTexture4: Texture;
+        private _diffuseTexture5;
+        diffuseTexture5: Texture;
+        private _diffuseTexture6;
+        diffuseTexture6: Texture;
+        private _diffuseTexture7;
+        diffuseTexture7: Texture;
+        private _diffuseTexture8;
+        diffuseTexture8: Texture;
+        /**
+         * Uniforms
+         */
+        diffuseColor: Color3;
+        specularColor: Color3;
+        specularPower: number;
+        private _disableLighting;
+        disableLighting: boolean;
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: number;
+        private _renderId;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        getActiveTextures(): BaseTexture[];
+        hasTexture(texture: BaseTexture): boolean;
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): MixMaterial;
+        serialize(): any;
+        getClassName(): string;
+        static Parse(source: any, scene: Scene, rootUrl: string): MixMaterial;
+    }
+}
+
+
+declare module BABYLON {
     class TriPlanarMaterial extends PushMaterial {
         mixTexture: BaseTexture;
         private _diffuseTextureX;

+ 2 - 2
dist/materialsLibrary/readme.md

@@ -9,8 +9,8 @@ For usage documentation please visit http://doc.babylonjs.com/extensions and cho
 
 Compiled js files (minified and source) are offered on our public CDN here:
 
-* https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.js
-* https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js
+* https://cdn.babylonjs.com/materialsLibrary/babylonjs.materials.js
+* https://cdn.babylonjs.com/materialsLibrary/babylonjs.materials.min.js
 
 ## NPM
 

+ 2 - 2
dist/postProcessesLibrary/babylon.asciiArtPostProcess.d.ts

@@ -27,13 +27,13 @@ declare module BABYLON {
          * @param font the font to use, use the W3C CSS notation
          * @return the max char width
          */
-        private getFontWidth(font);
+        private getFontWidth;
         /**
          * Gets the max char height of a font.
          * @param font the font to use, use the W3C CSS notation
          * @return the max char height
          */
-        private getFontHeight(font);
+        private getFontHeight;
         /**
          * Clones the current AsciiArtTexture.
          * @return the clone of the texture.

+ 6 - 3
dist/postProcessesLibrary/babylon.asciiArtPostProcess.js

@@ -1,8 +1,11 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    }
     return function (d, b) {
         extendStatics(d, b);
         function __() { this.constructor = d; }

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/postProcessesLibrary/babylon.asciiArtPostProcess.min.js


+ 2 - 2
dist/postProcessesLibrary/babylon.digitalRainPostProcess.d.ts

@@ -27,13 +27,13 @@ declare module BABYLON {
          * @param font the font to use, use the W3C CSS notation
          * @return the max char width
          */
-        private getFontWidth(font);
+        private getFontWidth;
         /**
          * Gets the max char height of a font.
          * @param font the font to use, use the W3C CSS notation
          * @return the max char height
          */
-        private getFontHeight(font);
+        private getFontHeight;
         /**
          * Clones the current DigitalRainFontTexture.
          * @return the clone of the texture.

+ 6 - 3
dist/postProcessesLibrary/babylon.digitalRainPostProcess.js

@@ -1,8 +1,11 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    }
     return function (d, b) {
         extendStatics(d, b);
         function __() { this.constructor = d; }

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/postProcessesLibrary/babylon.digitalRainPostProcess.min.js


+ 4 - 4
dist/postProcessesLibrary/babylonjs.postProcess.d.ts

@@ -27,13 +27,13 @@ declare module BABYLON {
          * @param font the font to use, use the W3C CSS notation
          * @return the max char width
          */
-        private getFontWidth(font);
+        private getFontWidth;
         /**
          * Gets the max char height of a font.
          * @param font the font to use, use the W3C CSS notation
          * @return the max char height
          */
-        private getFontHeight(font);
+        private getFontHeight;
         /**
          * Clones the current AsciiArtTexture.
          * @return the clone of the texture.
@@ -130,13 +130,13 @@ declare module BABYLON {
          * @param font the font to use, use the W3C CSS notation
          * @return the max char width
          */
-        private getFontWidth(font);
+        private getFontWidth;
         /**
          * Gets the max char height of a font.
          * @param font the font to use, use the W3C CSS notation
          * @return the max char height
          */
-        private getFontHeight(font);
+        private getFontHeight;
         /**
          * Clones the current DigitalRainFontTexture.
          * @return the clone of the texture.

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/postProcessesLibrary/babylonjs.postProcess.min.js


+ 4 - 4
dist/postProcessesLibrary/babylonjs.postProcess.module.d.ts

@@ -32,13 +32,13 @@ declare module BABYLON {
          * @param font the font to use, use the W3C CSS notation
          * @return the max char width
          */
-        private getFontWidth(font);
+        private getFontWidth;
         /**
          * Gets the max char height of a font.
          * @param font the font to use, use the W3C CSS notation
          * @return the max char height
          */
-        private getFontHeight(font);
+        private getFontHeight;
         /**
          * Clones the current AsciiArtTexture.
          * @return the clone of the texture.
@@ -135,13 +135,13 @@ declare module BABYLON {
          * @param font the font to use, use the W3C CSS notation
          * @return the max char width
          */
-        private getFontWidth(font);
+        private getFontWidth;
         /**
          * Gets the max char height of a font.
          * @param font the font to use, use the W3C CSS notation
          * @return the max char height
          */
-        private getFontHeight(font);
+        private getFontHeight;
         /**
          * Clones the current DigitalRainFontTexture.
          * @return the clone of the texture.

+ 2 - 2
dist/postProcessesLibrary/readme.md

@@ -9,8 +9,8 @@ For usage documentation please visit http://doc.babylonjs.com/extensions and cho
 
 Compiled js files (minified and source) are offered on our public CDN here:
 
-* https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.js
-* https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.min.js
+* https://cdn.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.js
+* https://cdn.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.min.js
 
 ## NPM
 

Разлика између датотеке није приказан због своје велике величине
+ 12668 - 12665
dist/preview release/babylon.d.ts


Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/preview release/babylon.js


+ 4 - 1
dist/preview release/babylon.max.js

@@ -12684,7 +12684,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "3.3.0-rc.5";
+                return "3.3.0";
             },
             enumerable: true,
             configurable: true
@@ -79757,6 +79757,9 @@ var BABYLON;
              * Define if the texture is enabled or not (disabled texture will not render)
              */
             _this.isEnabled = true;
+            /**
+             * Define if the texture must be cleared before rendering (default is true)
+             */
             _this.autoClear = true;
             /**
              * Event raised when the texture is generated

+ 4 - 1
dist/preview release/babylon.no-module.max.js

@@ -12651,7 +12651,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "3.3.0-rc.5";
+                return "3.3.0";
             },
             enumerable: true,
             configurable: true
@@ -79724,6 +79724,9 @@ var BABYLON;
              * Define if the texture is enabled or not (disabled texture will not render)
              */
             _this.isEnabled = true;
+            /**
+             * Define if the texture must be cleared before rendering (default is true)
+             */
             _this.autoClear = true;
             /**
              * Event raised when the texture is generated

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/preview release/babylon.worker.js


+ 0 - 0
dist/preview release/es6.js


Неке датотеке нису приказане због велике количине промена