ソースを参照

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

Guide 6 年 前
コミット
2e61d281ff
96 ファイル変更3178 行追加1761 行削除
  1. 120 16
      Playground/babylon.d.txt
  2. 2 2
      Playground/index.html
  3. 2 0
      dist/preview release/_redirects
  4. 101 9
      dist/preview release/babylon.d.ts
  5. 1 1
      dist/preview release/babylon.js
  6. 378 127
      dist/preview release/babylon.max.js
  7. 1 1
      dist/preview release/babylon.max.js.map
  8. 218 30
      dist/preview release/babylon.module.d.ts
  9. 1 1
      dist/preview release/gui/babylon.gui.js
  10. 1 1
      dist/preview release/gui/babylon.gui.js.map
  11. 1 1
      dist/preview release/gui/babylon.gui.min.js
  12. 6 6
      dist/preview release/inspector/babylon.inspector.bundle.js
  13. 105 2
      dist/preview release/inspector/babylon.inspector.bundle.max.js
  14. 1 1
      dist/preview release/inspector/babylon.inspector.bundle.max.js.map
  15. 14 0
      dist/preview release/inspector/babylon.inspector.d.ts
  16. 30 0
      dist/preview release/inspector/babylon.inspector.module.d.ts
  17. 140 108
      dist/preview release/loaders/babylon.glTF2FileLoader.js
  18. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.js.map
  19. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  20. 140 108
      dist/preview release/loaders/babylon.glTFFileLoader.js
  21. 1 1
      dist/preview release/loaders/babylon.glTFFileLoader.js.map
  22. 2 2
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  23. 19 7
      dist/preview release/loaders/babylonjs.loaders.d.ts
  24. 140 108
      dist/preview release/loaders/babylonjs.loaders.js
  25. 1 1
      dist/preview release/loaders/babylonjs.loaders.js.map
  26. 1 1
      dist/preview release/loaders/babylonjs.loaders.min.js
  27. 40 14
      dist/preview release/loaders/babylonjs.loaders.module.d.ts
  28. 6 6
      dist/preview release/materialsLibrary/babylon.cellMaterial.js
  29. 1 1
      dist/preview release/materialsLibrary/babylon.cellMaterial.js.map
  30. 4 4
      dist/preview release/materialsLibrary/babylon.customMaterial.js
  31. 1 1
      dist/preview release/materialsLibrary/babylon.customMaterial.js.map
  32. 6 6
      dist/preview release/materialsLibrary/babylon.fireMaterial.js
  33. 1 1
      dist/preview release/materialsLibrary/babylon.fireMaterial.js.map
  34. 6 6
      dist/preview release/materialsLibrary/babylon.furMaterial.js
  35. 1 1
      dist/preview release/materialsLibrary/babylon.furMaterial.js.map
  36. 6 6
      dist/preview release/materialsLibrary/babylon.gradientMaterial.js
  37. 1 1
      dist/preview release/materialsLibrary/babylon.gradientMaterial.js.map
  38. 6 6
      dist/preview release/materialsLibrary/babylon.gridMaterial.js
  39. 1 1
      dist/preview release/materialsLibrary/babylon.gridMaterial.js.map
  40. 6 6
      dist/preview release/materialsLibrary/babylon.lavaMaterial.js
  41. 1 1
      dist/preview release/materialsLibrary/babylon.lavaMaterial.js.map
  42. 6 6
      dist/preview release/materialsLibrary/babylon.mixMaterial.js
  43. 1 1
      dist/preview release/materialsLibrary/babylon.mixMaterial.js.map
  44. 6 6
      dist/preview release/materialsLibrary/babylon.normalMaterial.js
  45. 1 1
      dist/preview release/materialsLibrary/babylon.normalMaterial.js.map
  46. 6 6
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.js
  47. 1 1
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.js.map
  48. 6 6
      dist/preview release/materialsLibrary/babylon.simpleMaterial.js
  49. 1 1
      dist/preview release/materialsLibrary/babylon.simpleMaterial.js.map
  50. 6 6
      dist/preview release/materialsLibrary/babylon.skyMaterial.js
  51. 1 1
      dist/preview release/materialsLibrary/babylon.skyMaterial.js.map
  52. 6 6
      dist/preview release/materialsLibrary/babylon.terrainMaterial.js
  53. 1 1
      dist/preview release/materialsLibrary/babylon.terrainMaterial.js.map
  54. 6 6
      dist/preview release/materialsLibrary/babylon.triPlanarMaterial.js
  55. 1 1
      dist/preview release/materialsLibrary/babylon.triPlanarMaterial.js.map
  56. 6 6
      dist/preview release/materialsLibrary/babylon.waterMaterial.js
  57. 1 1
      dist/preview release/materialsLibrary/babylon.waterMaterial.js.map
  58. 46 46
      dist/preview release/materialsLibrary/babylonjs.materials.js
  59. 1 1
      dist/preview release/materialsLibrary/babylonjs.materials.js.map
  60. 1 1
      dist/preview release/packagesSizeBaseLine.json
  61. 218 30
      dist/preview release/viewer/babylon.module.d.ts
  62. 59 43
      dist/preview release/viewer/babylon.viewer.js
  63. 3 3
      dist/preview release/viewer/babylon.viewer.max.js
  64. 1 0
      dist/preview release/what's new.md
  65. 13 1
      inspector/src/components/actionTabs/tabs/toolsTabComponent.tsx
  66. 11 0
      inspector/src/components/globalState.ts
  67. 71 0
      inspector/src/components/replayRecorder.ts
  68. 1 1
      inspector/src/inspector.ts
  69. 3 2
      loaders/src/glTF/2.0/Extensions/MSFT_audio_emitter.ts
  70. 4 3
      loaders/src/glTF/2.0/Extensions/MSFT_lod.ts
  71. 133 112
      loaders/src/glTF/2.0/glTFLoader.ts
  72. 3 1
      loaders/src/glTF/2.0/glTFLoaderExtension.ts
  73. 9 0
      src/Bones/skeleton.ts
  74. 34 0
      src/Engines/engine.ts
  75. 2 14
      src/Layers/highlightLayer.ts
  76. 24 2
      src/Meshes/abstractMesh.ts
  77. 1 0
      src/Meshes/transformNode.ts
  78. 6 3
      src/PostProcesses/RenderPipeline/postProcessRenderPipeline.ts
  79. 27 0
      src/Rendering/outlineRenderer.ts
  80. 14 11
      src/Shaders/ShadersInclude/helperFunctions.fx
  81. 7 7
      src/Shaders/ShadersInclude/imageProcessingFunctions.fx
  82. 287 0
      src/Shaders/ShadersInclude/pbrBRDFFunctions.fx
  83. 5 6
      src/Shaders/ShadersInclude/pbrFalloffLightingFunctions.fx
  84. 134 0
      src/Shaders/ShadersInclude/pbrDirectLightingFunctions.fx
  85. 6 6
      src/Shaders/ShadersInclude/pbrPreLightingFunctions.fx
  86. 30 0
      src/Shaders/ShadersInclude/pbrFragmentExtraDeclaration.fx
  87. 203 0
      src/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.fx
  88. 0 448
      src/Shaders/ShadersInclude/pbrFunctions.fx
  89. 101 0
      src/Shaders/ShadersInclude/pbrHelperFunctions.fx
  90. 50 0
      src/Shaders/ShadersInclude/pbrIBLFunctions.fx
  91. 0 87
      src/Shaders/ShadersInclude/pbrLightingFunctions.fx
  92. 6 0
      src/Shaders/ShadersInclude/shadowsFragmentFunctions.fx
  93. 6 6
      src/Shaders/background.fragment.fx
  94. 40 273
      src/Shaders/pbr.fragment.fx
  95. 2 1
      src/node.ts
  96. 45 0
      src/scene.ts

+ 120 - 16
Playground/babylon.d.txt

@@ -7648,6 +7648,7 @@ declare module BABYLON {
         /**
          * Defines the passed node as the parent of the current node.
          * The node will remain exactly where it is and its position / rotation will be updated accordingly
+         * @see https://doc.babylonjs.com/how_to/parenting
          * @param node the node ot set as the parent
          * @returns this TransformNode.
          */
@@ -18336,6 +18337,7 @@ declare module BABYLON {
         private _ranges;
         private _lastAbsoluteTransformsUpdateId;
         private _canUseTextureForBones;
+        private _uniqueId;
         /** @hidden */
numBonesWithLinkedTransformNode: number;
         /**
          * Specifies if the skeleton should be serialized
@@ -18366,6 +18368,10 @@ declare module BABYLON {
          */
         readonly isUsingTextureForMatrices: boolean;
         /**
+         * Gets the unique ID of this skeleton
+         */
+        readonly uniqueId: number;
+        /**
          * Creates a new skeleton
          * @param name defines the skeleton name
          * @param id defines the skeleton Id
@@ -19211,6 +19217,7 @@ declare module BABYLON {
         setBodyVelocityIterations?(impostor: PhysicsImpostor, velocityIterations: number): void;
         getBodyPositionIterations?(impostor: PhysicsImpostor): number;
         setBodyPositionIterations?(impostor: PhysicsImpostor, positionIterations: number): void;
+        appendAnchor?(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): void;
         sleepBody(impostor: PhysicsImpostor): void;
         wakeUpBody(impostor: PhysicsImpostor): void;
         raycast(from: Vector3, to: Vector3): PhysicsRaycastResult;
@@ -19783,6 +19790,16 @@ declare module BABYLON {
          */
         addJoint(otherImpostor: PhysicsImpostor, joint: PhysicsJoint): PhysicsImpostor;
         /**
+         * Add an anchor to a soft impostor
+         * @param otherImpostor rigid impostor as the anchor
+         * @param width ratio across width from 0 to 1
+         * @param height ratio up height from 0 to 1
+         * @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, no strech
+         * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
+         * @returns impostor the soft imposter
+         */
+        addAnchor(otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): PhysicsImpostor;
+        /**
          * Will keep this body still, in a sleep mode.
          * @returns the physics imposter
          */
@@ -23642,10 +23659,11 @@ declare module BABYLON {
         getBoundingInfo(): BoundingInfo;
         /**
          * Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
-         * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box
+         * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
+         * @param ignoreRotation ignore rotation when computing the scale (ie. object will be axis aligned). Default is false
          * @returns the current mesh
          */
-        normalizeToUnitCube(includeDescendants?: boolean): AbstractMesh;
+        normalizeToUnitCube(includeDescendants?: boolean, ignoreRotation?: boolean): AbstractMesh;
         /**
          * Overwrite the current bounding info
          * @param boundingInfo defines the new bounding info
@@ -24220,7 +24238,8 @@ declare module BABYLON {
          */
         isDisposed(): boolean;
         /**
-         * Gets or sets the parent of the node
+         * Gets or sets the parent of the node (without keeping the current position in the scene)
+         * @see https://doc.babylonjs.com/how_to/parenting
          */
         parent: Nullable<Node>;
         private addToSceneRootNodes;
@@ -26161,8 +26180,6 @@ declare module BABYLON {
         canUseTimestampForTimerQuery: boolean;
         /** Function used to let the system compiles shaders in background */
         parallelShaderCompile: {
-            MAX_SHADER_COMPILER_THREADS_KHR: number;
-            maxShaderCompilerThreadsKHR: (thread: number) => void;
             COMPLETION_STATUS_KHR: number;
         };
     }
@@ -26904,6 +26921,21 @@ declare module BABYLON {
          * Sets the current depth function to LESS
          */
         setDepthFunctionToLess(): void;
+        private _cachedStencilBuffer;
+        private _cachedStencilFunction;
+        private _cachedStencilMask;
+        private _cachedStencilOperationPass;
+        private _cachedStencilOperationFail;
+        private _cachedStencilOperationDepthFail;
+        private _cachedStencilReference;
+        /**
+         * Caches the the state of the stencil buffer
+         */
+        cacheStencilState(): void;
+        /**
+         * Restores the state of the stencil buffer
+         */
+        restoreStencilState(): void;
         /**
          * Sets the current depth function to LEQUAL
          */
@@ -32108,6 +32140,12 @@ declare module BABYLON {
          */
         getAnimationGroupByName(name: string): Nullable<AnimationGroup>;
         /**
+         * Get a material using its unique id
+         * @param uniqueId defines the material's unique id
+         * @return the material or null if none found.
+         */
+        getMaterialByUniqueID(uniqueId: number): Nullable<Material>;
+        /**
          * get a material using its id
          * @param id defines the material's ID
          * @return the material or null if none found.
@@ -32217,6 +32255,12 @@ declare module BABYLON {
          */
         getTransformNodeByID(id: string): Nullable<TransformNode>;
         /**
+         * Gets a transform node with its auto-generated unique id
+         * @param uniqueId efines the unique id to search for
+         * @return the found transform node or null if not found at all.
+         */
+        getTransformNodeByUniqueID(uniqueId: number): Nullable<TransformNode>;
+        /**
          * Gets a list of transform nodes using their id
          * @param id defines the id to search for
          * @returns a list of transform nodes
@@ -32271,6 +32315,12 @@ declare module BABYLON {
          */
         getLastSkeletonByID(id: string): Nullable<Skeleton>;
         /**
+         * Gets a skeleton using a given auto generated unique id
+         * @param  uniqueId defines the unique id to search for
+         * @return the found skeleton or null if not found at all.
+         */
+        getSkeletonByUniqueId(uniqueId: number): Nullable<Skeleton>;
+        /**
          * Gets a skeleton using a given id (if many are found, this function will pick the first one)
          * @param id defines the id to search for
          * @return the found skeleton or null if not found at all.
@@ -42895,7 +42945,21 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrFunctions: {
+    export var pbrFragmentExtraDeclaration: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrFragmentSamplersDeclaration: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrHelperFunctions: {
         name: string;
         shader: string;
     };
@@ -42909,21 +42973,35 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrPreLightingFunctions: {
+    export var pbrDirectLightingSetupFunctions: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrDirectLightingFalloffFunctions: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrBRDFFunctions: {
         name: string;
         shader: string;
     };
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrFalloffLightingFunctions: {
+    export var pbrDirectLightingFunctions: {
         name: string;
         shader: string;
     };
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrLightingFunctions: {
+    export var pbrIBLFunctions: {
         name: string;
         shader: string;
     };
@@ -50193,6 +50271,16 @@ declare module BABYLON {
          */
         setBodyPositionIterations(impostor: PhysicsImpostor, positionIterations: number): void;
         /**
+        * Append an anchor to a soft object
+        * @param impostor soft impostor to add anchor to
+        * @param otherImpostor rigid impostor as the anchor
+        * @param width ratio across width from 0 to 1
+        * @param height ratio up height from 0 to 1
+        * @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, no strech
+        * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
+        */
+        appendAnchor(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, width: number, height: number, influence?: number, noCollisionBetweenLinkedBodies?: boolean): void;
+        /**
          * Sleeps the physics body and stops it from being active
          * @param impostor impostor to sleep
          */
@@ -52848,6 +52936,10 @@ declare module BABYLON {
      */
     export class OutlineRenderer implements ISceneComponent {
         /**
+         * Stencil value used to avoid outline being seen within the mesh when the mesh is transparent
+         */
+        private static _StencilReference;
+        /**
          * The name of the component. Each component must have a unique name.
          */
         name: string;
@@ -59570,9 +59662,10 @@ declare module BABYLON.GLTF2 {
         /**
          * Define this method to modify the default behavior when loading uris.
          * @param context The context when loading the asset
+         * @param property The glTF property associated with the uri
          * @param uri The uri to load
          * @returns A promise that resolves with the loaded data when the load is complete or null if not handled
-         */
loadUriAsync?(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
+         */
loadUriAsync?(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>>;
     }
 }
 declare module BABYLON.GLTF2 {
@@ -59598,10 +59691,6 @@ declare module BABYLON.GLTF2 {
      * The glTF 2.0 loader
      */
     export class GLTFLoader implements IGLTFLoader {
-        /** The glTF object parsed from the JSON. */
-        gltf: IGLTF;
-        /** The Babylon scene when loading the asset. */
-        babylonScene: Scene;
         /** @hidden */
completePromises: Promise<any>[];
         private _disposed;
         private _parent;
@@ -59610,6 +59699,8 @@ declare module BABYLON.GLTF2 {
         private _rootUrl;
         private _fileName;
         private _uniqueRootUrl;
+        private _gltf;
+        private _babylonScene;
         private _rootBabylonMesh;
         private _defaultBabylonMaterialData;
         private _progressCallback?;
@@ -59633,6 +59724,18 @@ declare module BABYLON.GLTF2 {
          * Gets the loader state.
          */
         readonly state: Nullable<GLTFLoaderState>;
+        /**
+         * The glTF object parsed from the JSON.
+         */
+        readonly gltf: IGLTF;
+        /**
+         * The Babylon scene when loading the asset.
+         */
+        readonly babylonScene: Scene;
+        /**
+         * The root Babylon mesh when loading the asset.
+         */
+        readonly rootBabylonMesh: Mesh;
         /** @hidden */
         constructor(parent: GLTFFileLoader);
         /** @hidden */
@@ -59771,10 +59874,11 @@ declare module BABYLON.GLTF2 {
         /**
          * Loads a glTF uri.
          * @param context The context when loading the asset
+         * @param property The glTF property associated with the uri
          * @param uri The base64 or relative uri
          * @returns A promise that resolves with the loaded data when the load is complete
          */
-        loadUriAsync(context: string, uri: string): Promise<ArrayBufferView>;
+        loadUriAsync(context: string, property: IProperty, uri: string): Promise<ArrayBufferView>;
         private _onProgress;
         /**
          * Adds a JSON pointer to the metadata of the Babylon object at `<object>.metadata.gltf.pointers`.
@@ -60038,7 +60142,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
         /** @hidden */
         loadNodeAsync(context: string, node: INode, assign: (babylonTransformNode: TransformNode) => void): Nullable<Promise<TransformNode>>;
         /** @hidden */
loadMaterialAsync(context: string, material: IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
-        /** @hidden */
loadUriAsync(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
+        /** @hidden */
loadUriAsync(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>>;
         /**
          * Gets an array of LOD properties from lowest to highest.
          */

+ 2 - 2
Playground/index.html

@@ -56,8 +56,8 @@
     <!-- Extensions -->
     <script src="https://rawgit.com/BabylonJS/Extensions/master/ClonerSystem/src/babylonx.cloner.js" async></script>
     <script src="https://rawgit.com/BabylonJS/Extensions/master/CompoundShader/src/babylonx.CompoundShader.js" async></script>
-    <!-- <script async src="https://www.babylontoolkit.com/Playground/scripts/babylon.navmesh.js"></script>
-    <script async src="https://www.babylontoolkit.com/Playground/scripts/babylon.manager.js"></script> -->
+    <script src="https://rawgit.com/BabylonJS/Extensions/master/SceneManager/dist/babylon.manager.js"></script>
+    <script src="https://rawgit.com/BabylonJS/Extensions/master/SceneManager/dist/babylon.navmesh.js"></script>
 
     <link href="css/index.css" rel="stylesheet" />
 </head>

+ 2 - 0
dist/preview release/_redirects

@@ -0,0 +1,2 @@
+# Redirect default Netlify subdomain to primary domain
+https://babylonjs-preview.netlify.com/* https://preview.babylonjs.com/:splat 301!

+ 101 - 9
dist/preview release/babylon.d.ts

@@ -7734,6 +7734,7 @@ declare module BABYLON {
         /**
          * Defines the passed node as the parent of the current node.
          * The node will remain exactly where it is and its position / rotation will be updated accordingly
+         * @see https://doc.babylonjs.com/how_to/parenting
          * @param node the node ot set as the parent
          * @returns this TransformNode.
          */
@@ -18603,6 +18604,7 @@ declare module BABYLON {
         private _ranges;
         private _lastAbsoluteTransformsUpdateId;
         private _canUseTextureForBones;
+        private _uniqueId;
         /** @hidden */
         _numBonesWithLinkedTransformNode: number;
         /**
@@ -18634,6 +18636,10 @@ declare module BABYLON {
          */
         readonly isUsingTextureForMatrices: boolean;
         /**
+         * Gets the unique ID of this skeleton
+         */
+        readonly uniqueId: number;
+        /**
          * Creates a new skeleton
          * @param name defines the skeleton name
          * @param id defines the skeleton Id
@@ -19491,6 +19497,7 @@ declare module BABYLON {
         setBodyVelocityIterations?(impostor: PhysicsImpostor, velocityIterations: number): void;
         getBodyPositionIterations?(impostor: PhysicsImpostor): number;
         setBodyPositionIterations?(impostor: PhysicsImpostor, positionIterations: number): void;
+        appendAnchor?(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): void;
         sleepBody(impostor: PhysicsImpostor): void;
         wakeUpBody(impostor: PhysicsImpostor): void;
         raycast(from: Vector3, to: Vector3): PhysicsRaycastResult;
@@ -20067,6 +20074,16 @@ declare module BABYLON {
          */
         addJoint(otherImpostor: PhysicsImpostor, joint: PhysicsJoint): PhysicsImpostor;
         /**
+         * Add an anchor to a soft impostor
+         * @param otherImpostor rigid impostor as the anchor
+         * @param width ratio across width from 0 to 1
+         * @param height ratio up height from 0 to 1
+         * @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, no strech
+         * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
+         * @returns impostor the soft imposter
+         */
+        addAnchor(otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): PhysicsImpostor;
+        /**
          * Will keep this body still, in a sleep mode.
          * @returns the physics imposter
          */
@@ -24025,10 +24042,11 @@ declare module BABYLON {
         getBoundingInfo(): BoundingInfo;
         /**
          * Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
-         * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box
+         * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
+         * @param ignoreRotation ignore rotation when computing the scale (ie. object will be axis aligned). Default is false
          * @returns the current mesh
          */
-        normalizeToUnitCube(includeDescendants?: boolean): AbstractMesh;
+        normalizeToUnitCube(includeDescendants?: boolean, ignoreRotation?: boolean): AbstractMesh;
         /**
          * Overwrite the current bounding info
          * @param boundingInfo defines the new bounding info
@@ -24624,7 +24642,8 @@ declare module BABYLON {
          */
         isDisposed(): boolean;
         /**
-         * Gets or sets the parent of the node
+         * Gets or sets the parent of the node (without keeping the current position in the scene)
+         * @see https://doc.babylonjs.com/how_to/parenting
          */
         parent: Nullable<Node>;
         private addToSceneRootNodes;
@@ -26588,8 +26607,6 @@ declare module BABYLON {
         canUseTimestampForTimerQuery: boolean;
         /** Function used to let the system compiles shaders in background */
         parallelShaderCompile: {
-            MAX_SHADER_COMPILER_THREADS_KHR: number;
-            maxShaderCompilerThreadsKHR: (thread: number) => void;
             COMPLETION_STATUS_KHR: number;
         };
     }
@@ -27341,6 +27358,21 @@ declare module BABYLON {
          * Sets the current depth function to LESS
          */
         setDepthFunctionToLess(): void;
+        private _cachedStencilBuffer;
+        private _cachedStencilFunction;
+        private _cachedStencilMask;
+        private _cachedStencilOperationPass;
+        private _cachedStencilOperationFail;
+        private _cachedStencilOperationDepthFail;
+        private _cachedStencilReference;
+        /**
+         * Caches the the state of the stencil buffer
+         */
+        cacheStencilState(): void;
+        /**
+         * Restores the state of the stencil buffer
+         */
+        restoreStencilState(): void;
         /**
          * Sets the current depth function to LEQUAL
          */
@@ -32673,6 +32705,12 @@ declare module BABYLON {
          */
         getAnimationGroupByName(name: string): Nullable<AnimationGroup>;
         /**
+         * Get a material using its unique id
+         * @param uniqueId defines the material's unique id
+         * @return the material or null if none found.
+         */
+        getMaterialByUniqueID(uniqueId: number): Nullable<Material>;
+        /**
          * get a material using its id
          * @param id defines the material's ID
          * @return the material or null if none found.
@@ -32782,6 +32820,12 @@ declare module BABYLON {
          */
         getTransformNodeByID(id: string): Nullable<TransformNode>;
         /**
+         * Gets a transform node with its auto-generated unique id
+         * @param uniqueId efines the unique id to search for
+         * @return the found transform node or null if not found at all.
+         */
+        getTransformNodeByUniqueID(uniqueId: number): Nullable<TransformNode>;
+        /**
          * Gets a list of transform nodes using their id
          * @param id defines the id to search for
          * @returns a list of transform nodes
@@ -32836,6 +32880,12 @@ declare module BABYLON {
          */
         getLastSkeletonByID(id: string): Nullable<Skeleton>;
         /**
+         * Gets a skeleton using a given auto generated unique id
+         * @param  uniqueId defines the unique id to search for
+         * @return the found skeleton or null if not found at all.
+         */
+        getSkeletonByUniqueId(uniqueId: number): Nullable<Skeleton>;
+        /**
          * Gets a skeleton using a given id (if many are found, this function will pick the first one)
          * @param id defines the id to search for
          * @return the found skeleton or null if not found at all.
@@ -43548,7 +43598,21 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrFunctions: {
+    export var pbrFragmentExtraDeclaration: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrFragmentSamplersDeclaration: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrHelperFunctions: {
         name: string;
         shader: string;
     };
@@ -43562,21 +43626,35 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrPreLightingFunctions: {
+    export var pbrDirectLightingSetupFunctions: {
         name: string;
         shader: string;
     };
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrFalloffLightingFunctions: {
+    export var pbrDirectLightingFalloffFunctions: {
         name: string;
         shader: string;
     };
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrLightingFunctions: {
+    export var pbrBRDFFunctions: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrDirectLightingFunctions: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrIBLFunctions: {
         name: string;
         shader: string;
     };
@@ -50867,6 +50945,16 @@ declare module BABYLON {
          */
         setBodyPositionIterations(impostor: PhysicsImpostor, positionIterations: number): void;
         /**
+        * Append an anchor to a soft object
+        * @param impostor soft impostor to add anchor to
+        * @param otherImpostor rigid impostor as the anchor
+        * @param width ratio across width from 0 to 1
+        * @param height ratio up height from 0 to 1
+        * @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, no strech
+        * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
+        */
+        appendAnchor(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, width: number, height: number, influence?: number, noCollisionBetweenLinkedBodies?: boolean): void;
+        /**
          * Sleeps the physics body and stops it from being active
          * @param impostor impostor to sleep
          */
@@ -53569,6 +53657,10 @@ declare module BABYLON {
      */
     export class OutlineRenderer implements ISceneComponent {
         /**
+         * Stencil value used to avoid outline being seen within the mesh when the mesh is transparent
+         */
+        private static _StencilReference;
+        /**
          * The name of the component. Each component must have a unique name.
          */
         name: string;

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/babylon.js


ファイルの差分が大きいため隠しています
+ 378 - 127
dist/preview release/babylon.max.js


ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/babylon.max.js.map


+ 218 - 30
dist/preview release/babylon.module.d.ts

@@ -7790,6 +7790,7 @@ declare module "babylonjs/Meshes/transformNode" {
         /**
          * Defines the passed node as the parent of the current node.
          * The node will remain exactly where it is and its position / rotation will be updated accordingly
+         * @see https://doc.babylonjs.com/how_to/parenting
          * @param node the node ot set as the parent
          * @returns this TransformNode.
          */
@@ -19088,6 +19089,7 @@ declare module "babylonjs/Bones/skeleton" {
         private _ranges;
         private _lastAbsoluteTransformsUpdateId;
         private _canUseTextureForBones;
+        private _uniqueId;
         /** @hidden */
         _numBonesWithLinkedTransformNode: number;
         /**
@@ -19119,6 +19121,10 @@ declare module "babylonjs/Bones/skeleton" {
          */
         readonly isUsingTextureForMatrices: boolean;
         /**
+         * Gets the unique ID of this skeleton
+         */
+        readonly uniqueId: number;
+        /**
          * Creates a new skeleton
          * @param name defines the skeleton name
          * @param id defines the skeleton Id
@@ -19997,6 +20003,7 @@ declare module "babylonjs/Physics/IPhysicsEngine" {
         setBodyVelocityIterations?(impostor: PhysicsImpostor, velocityIterations: number): void;
         getBodyPositionIterations?(impostor: PhysicsImpostor): number;
         setBodyPositionIterations?(impostor: PhysicsImpostor, positionIterations: number): void;
+        appendAnchor?(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): void;
         sleepBody(impostor: PhysicsImpostor): void;
         wakeUpBody(impostor: PhysicsImpostor): void;
         raycast(from: Vector3, to: Vector3): PhysicsRaycastResult;
@@ -20581,6 +20588,16 @@ declare module "babylonjs/Physics/physicsImpostor" {
          */
         addJoint(otherImpostor: PhysicsImpostor, joint: PhysicsJoint): PhysicsImpostor;
         /**
+         * Add an anchor to a soft impostor
+         * @param otherImpostor rigid impostor as the anchor
+         * @param width ratio across width from 0 to 1
+         * @param height ratio up height from 0 to 1
+         * @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, no strech
+         * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
+         * @returns impostor the soft imposter
+         */
+        addAnchor(otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): PhysicsImpostor;
+        /**
          * Will keep this body still, in a sleep mode.
          * @returns the physics imposter
          */
@@ -24639,10 +24656,11 @@ declare module "babylonjs/Meshes/abstractMesh" {
         getBoundingInfo(): BoundingInfo;
         /**
          * Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
-         * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box
+         * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
+         * @param ignoreRotation ignore rotation when computing the scale (ie. object will be axis aligned). Default is false
          * @returns the current mesh
          */
-        normalizeToUnitCube(includeDescendants?: boolean): AbstractMesh;
+        normalizeToUnitCube(includeDescendants?: boolean, ignoreRotation?: boolean): AbstractMesh;
         /**
          * Overwrite the current bounding info
          * @param boundingInfo defines the new bounding info
@@ -25260,7 +25278,8 @@ declare module "babylonjs/node" {
          */
         isDisposed(): boolean;
         /**
-         * Gets or sets the parent of the node
+         * Gets or sets the parent of the node (without keeping the current position in the scene)
+         * @see https://doc.babylonjs.com/how_to/parenting
          */
         parent: Nullable<Node>;
         private addToSceneRootNodes;
@@ -27286,8 +27305,6 @@ declare module "babylonjs/Engines/engine" {
         canUseTimestampForTimerQuery: boolean;
         /** Function used to let the system compiles shaders in background */
         parallelShaderCompile: {
-            MAX_SHADER_COMPILER_THREADS_KHR: number;
-            maxShaderCompilerThreadsKHR: (thread: number) => void;
             COMPLETION_STATUS_KHR: number;
         };
     }
@@ -28039,6 +28056,21 @@ declare module "babylonjs/Engines/engine" {
          * Sets the current depth function to LESS
          */
         setDepthFunctionToLess(): void;
+        private _cachedStencilBuffer;
+        private _cachedStencilFunction;
+        private _cachedStencilMask;
+        private _cachedStencilOperationPass;
+        private _cachedStencilOperationFail;
+        private _cachedStencilOperationDepthFail;
+        private _cachedStencilReference;
+        /**
+         * Caches the the state of the stencil buffer
+         */
+        cacheStencilState(): void;
+        /**
+         * Restores the state of the stencil buffer
+         */
+        restoreStencilState(): void;
         /**
          * Sets the current depth function to LEQUAL
          */
@@ -33470,6 +33502,12 @@ declare module "babylonjs/scene" {
          */
         getAnimationGroupByName(name: string): Nullable<AnimationGroup>;
         /**
+         * Get a material using its unique id
+         * @param uniqueId defines the material's unique id
+         * @return the material or null if none found.
+         */
+        getMaterialByUniqueID(uniqueId: number): Nullable<Material>;
+        /**
          * get a material using its id
          * @param id defines the material's ID
          * @return the material or null if none found.
@@ -33579,6 +33617,12 @@ declare module "babylonjs/scene" {
          */
         getTransformNodeByID(id: string): Nullable<TransformNode>;
         /**
+         * Gets a transform node with its auto-generated unique id
+         * @param uniqueId efines the unique id to search for
+         * @return the found transform node or null if not found at all.
+         */
+        getTransformNodeByUniqueID(uniqueId: number): Nullable<TransformNode>;
+        /**
          * Gets a list of transform nodes using their id
          * @param id defines the id to search for
          * @returns a list of transform nodes
@@ -33633,6 +33677,12 @@ declare module "babylonjs/scene" {
          */
         getLastSkeletonByID(id: string): Nullable<Skeleton>;
         /**
+         * Gets a skeleton using a given auto generated unique id
+         * @param  uniqueId defines the unique id to search for
+         * @return the found skeleton or null if not found at all.
+         */
+        getSkeletonByUniqueId(uniqueId: number): Nullable<Skeleton>;
+        /**
          * Gets a skeleton using a given id (if many are found, this function will pick the first one)
          * @param id defines the id to search for
          * @return the found skeleton or null if not found at all.
@@ -45231,9 +45281,23 @@ declare module "babylonjs/Shaders/ShadersInclude/pbrUboDeclaration" {
         shader: string;
     };
 }
-declare module "babylonjs/Shaders/ShadersInclude/pbrFunctions" {
+declare module "babylonjs/Shaders/ShadersInclude/pbrFragmentExtraDeclaration" {
     /** @hidden */
-    export var pbrFunctions: {
+    export var pbrFragmentExtraDeclaration: {
+        name: string;
+        shader: string;
+    };
+}
+declare module "babylonjs/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration" {
+    /** @hidden */
+    export var pbrFragmentSamplersDeclaration: {
+        name: string;
+        shader: string;
+    };
+}
+declare module "babylonjs/Shaders/ShadersInclude/pbrHelperFunctions" {
+    /** @hidden */
+    export var pbrHelperFunctions: {
         name: string;
         shader: string;
     };
@@ -45245,23 +45309,37 @@ declare module "babylonjs/Shaders/ShadersInclude/harmonicsFunctions" {
         shader: string;
     };
 }
-declare module "babylonjs/Shaders/ShadersInclude/pbrPreLightingFunctions" {
+declare module "babylonjs/Shaders/ShadersInclude/pbrDirectLightingSetupFunctions" {
+    /** @hidden */
+    export var pbrDirectLightingSetupFunctions: {
+        name: string;
+        shader: string;
+    };
+}
+declare module "babylonjs/Shaders/ShadersInclude/pbrDirectLightingFalloffFunctions" {
+    /** @hidden */
+    export var pbrDirectLightingFalloffFunctions: {
+        name: string;
+        shader: string;
+    };
+}
+declare module "babylonjs/Shaders/ShadersInclude/pbrBRDFFunctions" {
     /** @hidden */
-    export var pbrPreLightingFunctions: {
+    export var pbrBRDFFunctions: {
         name: string;
         shader: string;
     };
 }
-declare module "babylonjs/Shaders/ShadersInclude/pbrFalloffLightingFunctions" {
+declare module "babylonjs/Shaders/ShadersInclude/pbrDirectLightingFunctions" {
     /** @hidden */
-    export var pbrFalloffLightingFunctions: {
+    export var pbrDirectLightingFunctions: {
         name: string;
         shader: string;
     };
 }
-declare module "babylonjs/Shaders/ShadersInclude/pbrLightingFunctions" {
+declare module "babylonjs/Shaders/ShadersInclude/pbrIBLFunctions" {
     /** @hidden */
-    export var pbrLightingFunctions: {
+    export var pbrIBLFunctions: {
         name: string;
         shader: string;
     };
@@ -45276,22 +45354,26 @@ declare module "babylonjs/Shaders/ShadersInclude/pbrDebug" {
 declare module "babylonjs/Shaders/pbr.fragment" {
     import "babylonjs/Shaders/ShadersInclude/pbrFragmentDeclaration";
     import "babylonjs/Shaders/ShadersInclude/pbrUboDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/pbrFragmentExtraDeclaration";
     import "babylonjs/Shaders/ShadersInclude/lightFragmentDeclaration";
     import "babylonjs/Shaders/ShadersInclude/lightUboDeclaration";
-    import "babylonjs/Shaders/ShadersInclude/reflectionFunction";
+    import "babylonjs/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration";
     import "babylonjs/Shaders/ShadersInclude/imageProcessingDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/clipPlaneFragmentDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/logDepthDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/fogFragmentDeclaration";
     import "babylonjs/Shaders/ShadersInclude/helperFunctions";
+    import "babylonjs/Shaders/ShadersInclude/pbrHelperFunctions";
     import "babylonjs/Shaders/ShadersInclude/imageProcessingFunctions";
     import "babylonjs/Shaders/ShadersInclude/shadowsFragmentFunctions";
-    import "babylonjs/Shaders/ShadersInclude/pbrFunctions";
     import "babylonjs/Shaders/ShadersInclude/harmonicsFunctions";
-    import "babylonjs/Shaders/ShadersInclude/pbrPreLightingFunctions";
-    import "babylonjs/Shaders/ShadersInclude/pbrFalloffLightingFunctions";
-    import "babylonjs/Shaders/ShadersInclude/pbrLightingFunctions";
+    import "babylonjs/Shaders/ShadersInclude/pbrDirectLightingSetupFunctions";
+    import "babylonjs/Shaders/ShadersInclude/pbrDirectLightingFalloffFunctions";
+    import "babylonjs/Shaders/ShadersInclude/pbrBRDFFunctions";
+    import "babylonjs/Shaders/ShadersInclude/pbrDirectLightingFunctions";
+    import "babylonjs/Shaders/ShadersInclude/pbrIBLFunctions";
     import "babylonjs/Shaders/ShadersInclude/bumpFragmentFunctions";
-    import "babylonjs/Shaders/ShadersInclude/clipPlaneFragmentDeclaration";
-    import "babylonjs/Shaders/ShadersInclude/logDepthDeclaration";
-    import "babylonjs/Shaders/ShadersInclude/fogFragmentDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/reflectionFunction";
     import "babylonjs/Shaders/ShadersInclude/clipPlaneFragment";
     import "babylonjs/Shaders/ShadersInclude/bumpFragment";
     import "babylonjs/Shaders/ShadersInclude/depthPrePass";
@@ -53138,6 +53220,16 @@ declare module "babylonjs/Physics/Plugins/ammoJSPlugin" {
          */
         setBodyPositionIterations(impostor: PhysicsImpostor, positionIterations: number): void;
         /**
+        * Append an anchor to a soft object
+        * @param impostor soft impostor to add anchor to
+        * @param otherImpostor rigid impostor as the anchor
+        * @param width ratio across width from 0 to 1
+        * @param height ratio up height from 0 to 1
+        * @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, no strech
+        * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
+        */
+        appendAnchor(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, width: number, height: number, influence?: number, noCollisionBetweenLinkedBodies?: boolean): void;
+        /**
          * Sleeps the physics body and stops it from being active
          * @param impostor impostor to sleep
          */
@@ -56154,6 +56246,10 @@ declare module "babylonjs/Rendering/outlineRenderer" {
      */
     export class OutlineRenderer implements ISceneComponent {
         /**
+         * Stencil value used to avoid outline being seen within the mesh when the mesh is transparent
+         */
+        private static _StencilReference;
+        /**
          * The name of the component. Each component must have a unique name.
          */
         name: string;
@@ -66169,6 +66265,7 @@ declare module BABYLON {
         /**
          * Defines the passed node as the parent of the current node.
          * The node will remain exactly where it is and its position / rotation will be updated accordingly
+         * @see https://doc.babylonjs.com/how_to/parenting
          * @param node the node ot set as the parent
          * @returns this TransformNode.
          */
@@ -77038,6 +77135,7 @@ declare module BABYLON {
         private _ranges;
         private _lastAbsoluteTransformsUpdateId;
         private _canUseTextureForBones;
+        private _uniqueId;
         /** @hidden */
         _numBonesWithLinkedTransformNode: number;
         /**
@@ -77069,6 +77167,10 @@ declare module BABYLON {
          */
         readonly isUsingTextureForMatrices: boolean;
         /**
+         * Gets the unique ID of this skeleton
+         */
+        readonly uniqueId: number;
+        /**
          * Creates a new skeleton
          * @param name defines the skeleton name
          * @param id defines the skeleton Id
@@ -77926,6 +78028,7 @@ declare module BABYLON {
         setBodyVelocityIterations?(impostor: PhysicsImpostor, velocityIterations: number): void;
         getBodyPositionIterations?(impostor: PhysicsImpostor): number;
         setBodyPositionIterations?(impostor: PhysicsImpostor, positionIterations: number): void;
+        appendAnchor?(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): void;
         sleepBody(impostor: PhysicsImpostor): void;
         wakeUpBody(impostor: PhysicsImpostor): void;
         raycast(from: Vector3, to: Vector3): PhysicsRaycastResult;
@@ -78502,6 +78605,16 @@ declare module BABYLON {
          */
         addJoint(otherImpostor: PhysicsImpostor, joint: PhysicsJoint): PhysicsImpostor;
         /**
+         * Add an anchor to a soft impostor
+         * @param otherImpostor rigid impostor as the anchor
+         * @param width ratio across width from 0 to 1
+         * @param height ratio up height from 0 to 1
+         * @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, no strech
+         * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
+         * @returns impostor the soft imposter
+         */
+        addAnchor(otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): PhysicsImpostor;
+        /**
          * Will keep this body still, in a sleep mode.
          * @returns the physics imposter
          */
@@ -82460,10 +82573,11 @@ declare module BABYLON {
         getBoundingInfo(): BoundingInfo;
         /**
          * Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
-         * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box
+         * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
+         * @param ignoreRotation ignore rotation when computing the scale (ie. object will be axis aligned). Default is false
          * @returns the current mesh
          */
-        normalizeToUnitCube(includeDescendants?: boolean): AbstractMesh;
+        normalizeToUnitCube(includeDescendants?: boolean, ignoreRotation?: boolean): AbstractMesh;
         /**
          * Overwrite the current bounding info
          * @param boundingInfo defines the new bounding info
@@ -83059,7 +83173,8 @@ declare module BABYLON {
          */
         isDisposed(): boolean;
         /**
-         * Gets or sets the parent of the node
+         * Gets or sets the parent of the node (without keeping the current position in the scene)
+         * @see https://doc.babylonjs.com/how_to/parenting
          */
         parent: Nullable<Node>;
         private addToSceneRootNodes;
@@ -85023,8 +85138,6 @@ declare module BABYLON {
         canUseTimestampForTimerQuery: boolean;
         /** Function used to let the system compiles shaders in background */
         parallelShaderCompile: {
-            MAX_SHADER_COMPILER_THREADS_KHR: number;
-            maxShaderCompilerThreadsKHR: (thread: number) => void;
             COMPLETION_STATUS_KHR: number;
         };
     }
@@ -85776,6 +85889,21 @@ declare module BABYLON {
          * Sets the current depth function to LESS
          */
         setDepthFunctionToLess(): void;
+        private _cachedStencilBuffer;
+        private _cachedStencilFunction;
+        private _cachedStencilMask;
+        private _cachedStencilOperationPass;
+        private _cachedStencilOperationFail;
+        private _cachedStencilOperationDepthFail;
+        private _cachedStencilReference;
+        /**
+         * Caches the the state of the stencil buffer
+         */
+        cacheStencilState(): void;
+        /**
+         * Restores the state of the stencil buffer
+         */
+        restoreStencilState(): void;
         /**
          * Sets the current depth function to LEQUAL
          */
@@ -91108,6 +91236,12 @@ declare module BABYLON {
          */
         getAnimationGroupByName(name: string): Nullable<AnimationGroup>;
         /**
+         * Get a material using its unique id
+         * @param uniqueId defines the material's unique id
+         * @return the material or null if none found.
+         */
+        getMaterialByUniqueID(uniqueId: number): Nullable<Material>;
+        /**
          * get a material using its id
          * @param id defines the material's ID
          * @return the material or null if none found.
@@ -91217,6 +91351,12 @@ declare module BABYLON {
          */
         getTransformNodeByID(id: string): Nullable<TransformNode>;
         /**
+         * Gets a transform node with its auto-generated unique id
+         * @param uniqueId efines the unique id to search for
+         * @return the found transform node or null if not found at all.
+         */
+        getTransformNodeByUniqueID(uniqueId: number): Nullable<TransformNode>;
+        /**
          * Gets a list of transform nodes using their id
          * @param id defines the id to search for
          * @returns a list of transform nodes
@@ -91271,6 +91411,12 @@ declare module BABYLON {
          */
         getLastSkeletonByID(id: string): Nullable<Skeleton>;
         /**
+         * Gets a skeleton using a given auto generated unique id
+         * @param  uniqueId defines the unique id to search for
+         * @return the found skeleton or null if not found at all.
+         */
+        getSkeletonByUniqueId(uniqueId: number): Nullable<Skeleton>;
+        /**
          * Gets a skeleton using a given id (if many are found, this function will pick the first one)
          * @param id defines the id to search for
          * @return the found skeleton or null if not found at all.
@@ -101983,7 +102129,21 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrFunctions: {
+    export var pbrFragmentExtraDeclaration: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrFragmentSamplersDeclaration: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrHelperFunctions: {
         name: string;
         shader: string;
     };
@@ -101997,21 +102157,35 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrPreLightingFunctions: {
+    export var pbrDirectLightingSetupFunctions: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrDirectLightingFalloffFunctions: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrBRDFFunctions: {
         name: string;
         shader: string;
     };
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrFalloffLightingFunctions: {
+    export var pbrDirectLightingFunctions: {
         name: string;
         shader: string;
     };
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrLightingFunctions: {
+    export var pbrIBLFunctions: {
         name: string;
         shader: string;
     };
@@ -109302,6 +109476,16 @@ declare module BABYLON {
          */
         setBodyPositionIterations(impostor: PhysicsImpostor, positionIterations: number): void;
         /**
+        * Append an anchor to a soft object
+        * @param impostor soft impostor to add anchor to
+        * @param otherImpostor rigid impostor as the anchor
+        * @param width ratio across width from 0 to 1
+        * @param height ratio up height from 0 to 1
+        * @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, no strech
+        * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
+        */
+        appendAnchor(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, width: number, height: number, influence?: number, noCollisionBetweenLinkedBodies?: boolean): void;
+        /**
          * Sleeps the physics body and stops it from being active
          * @param impostor impostor to sleep
          */
@@ -112004,6 +112188,10 @@ declare module BABYLON {
      */
     export class OutlineRenderer implements ISceneComponent {
         /**
+         * Stencil value used to avoid outline being seen within the mesh when the mesh is transparent
+         */
+        private static _StencilReference;
+        /**
          * The name of the component. Each component must have a unique name.
          */
         name: string;

+ 1 - 1
dist/preview release/gui/babylon.gui.js

@@ -9178,7 +9178,7 @@ var ScrollViewer = /** @class */ (function (_super) {
     /** @hidden */
     ScrollViewer.prototype._attachWheel = function () {
         var _this = this;
-        if (this._onPointerObserver) {
+        if (!this._host || this._onPointerObserver) {
             return;
         }
         var scene = this._host.getScene();

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/gui/babylon.gui.js.map


ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


ファイルの差分が大きいため隠しています
+ 6 - 6
dist/preview release/inspector/babylon.inspector.bundle.js


+ 105 - 2
dist/preview release/inspector/babylon.inspector.bundle.max.js

@@ -39207,6 +39207,7 @@ var StatisticsTabComponent = /** @class */ (function (_super) {
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_7__["BooleanLineComponent"], { label: "Vertex array object", value: caps.vertexArrayObject }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_7__["BooleanLineComponent"], { label: "Timer query", value: caps.timerQuery !== undefined }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_7__["BooleanLineComponent"], { label: "Stencil", value: engine.isStencilEnable }),
+                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_7__["BooleanLineComponent"], { label: "Parallel shader compilation", value: caps.parallelShaderCompile != null }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_6__["ValueLineComponent"], { label: "Max textures units", value: caps.maxTexturesImageUnits, fractionDigits: 0 }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_6__["ValueLineComponent"], { label: "Max textures size", value: caps.maxTextureSize, fractionDigits: 0 }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_6__["ValueLineComponent"], { label: "Max anisotropy", value: caps.maxAnisotropy, fractionDigits: 0 }),
@@ -39419,7 +39420,7 @@ var ToolsTabComponent = /** @class */ (function (_super) {
     ToolsTabComponent.prototype.captureScreenshot = function () {
         var scene = this.props.scene;
         if (scene.activeCamera) {
-            babylonjs_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_5__["Tools"].CreateScreenshotUsingRenderTarget(scene.getEngine(), scene.activeCamera, { precision: 1.0 }, undefined, undefined, 4, true);
+            babylonjs_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_5__["Tools"].CreateScreenshot(scene.getEngine(), scene.activeCamera, { precision: 1.0 });
         }
     };
     ToolsTabComponent.prototype.recordVideo = function () {
@@ -39477,6 +39478,12 @@ var ToolsTabComponent = /** @class */ (function (_super) {
             alert(error);
         });
     };
+    ToolsTabComponent.prototype.resetReplay = function () {
+        this.props.globalState.recorder.reset();
+    };
+    ToolsTabComponent.prototype.exportReplay = function () {
+        this.props.globalState.recorder.export();
+    };
     ToolsTabComponent.prototype.render = function () {
         var _this = this;
         var scene = this.props.scene;
@@ -39487,6 +39494,9 @@ var ToolsTabComponent = /** @class */ (function (_super) {
             react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { globalState: this.props.globalState, title: "CAPTURE" },
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__["ButtonLineComponent"], { label: "Screenshot", onClick: function () { return _this.captureScreenshot(); } }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__["ButtonLineComponent"], { label: this.state.tag, onClick: function () { return _this.recordVideo(); } })),
+            react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { globalState: this.props.globalState, title: "REPLAY" },
+                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__["ButtonLineComponent"], { label: "Generate replay code", onClick: function () { return _this.exportReplay(); } }),
+                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__["ButtonLineComponent"], { label: "Reset", onClick: function () { return _this.resetReplay(); } })),
             react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { globalState: this.props.globalState, title: "SCENE EXPORT" },
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__["ButtonLineComponent"], { label: "Export to GLB", onClick: function () { return _this.exportGLTF(); } }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__["ButtonLineComponent"], { label: "Export to Babylon", onClick: function () { return _this.exportBabylon(); } }),
@@ -39679,6 +39689,8 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlobalState", function() { return GlobalState; });
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _replayRecorder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./replayRecorder */ "./components/replayRecorder.ts");
+
 
 
 var GlobalState = /** @class */ (function () {
@@ -39690,9 +39702,17 @@ var GlobalState = /** @class */ (function () {
         this.glTFLoaderDefaults = { "validate": true };
         this.blockMutationUpdates = false;
         this.selectedLineContainerTitle = "";
+        this.recorder = new _replayRecorder__WEBPACK_IMPORTED_MODULE_1__["ReplayRecorder"]();
         // Light gizmos
         this.lightGizmos = [];
     }
+    GlobalState.prototype.init = function (propertyChangedObservable) {
+        var _this = this;
+        this.onPropertyChangedObservable = propertyChangedObservable;
+        propertyChangedObservable.add(function (event) {
+            _this.recorder.record(event);
+        });
+    };
     GlobalState.prototype.prepareGLTFPlugin = function (loader) {
         var _this = this;
         var loaderState = this.glTFLoaderDefaults;
@@ -39828,6 +39848,89 @@ var HeaderComponent = /** @class */ (function (_super) {
 
 /***/ }),
 
+/***/ "./components/replayRecorder.ts":
+/*!**************************************!*\
+  !*** ./components/replayRecorder.ts ***!
+  \**************************************/
+/*! exports provided: ReplayRecorder */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplayRecorder", function() { return ReplayRecorder; });
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_0__);
+
+var ReplayRecorder = /** @class */ (function () {
+    function ReplayRecorder() {
+    }
+    ReplayRecorder.prototype.reset = function () {
+        this._recordedCodeLines = [];
+        this._previousObject = null;
+        this._previousProperty = "";
+    };
+    ReplayRecorder.prototype.record = function (event) {
+        if (!this._recordedCodeLines) {
+            this._recordedCodeLines = [];
+        }
+        if (this._previousObject === event.object && this._previousProperty === event.property) {
+            this._recordedCodeLines.pop();
+        }
+        var value = event.value;
+        if (value.w) { // Quaternion
+            value = "new BABYLON.Quaternion(" + value.x + ", " + value.y + ", " + value.z + ", " + value.w + ")";
+        }
+        else if (value.z) { // Vector3
+            value = "new BABYLON.Vector3(" + value.x + ", " + value.y + ", " + value.z + ")";
+        }
+        else if (value.y) { // Vector2
+            value = "new BABYLON.Vector2(" + value.x + ", " + value.y + ")";
+        }
+        else if (value.a) { // Color4
+            value = "new BABYLON.Color4(" + value.r + ", " + value.g + ", " + value.b + ", " + value.a + ")";
+        }
+        else if (value.b) { // Color3
+            value = "new BABYLON.Color3(" + value.r + ", " + value.g + ", " + value.b + ")";
+        }
+        var target = event.object.getClassName().toLowerCase();
+        if (event.object.uniqueId) {
+            if (target.indexOf("camera")) {
+                target = "scene.getCameraByUniqueID(" + event.object.uniqueId + ")";
+            }
+            else if (target.indexOf("mesh")) {
+                target = "scene.getMeshByUniqueID(" + event.object.uniqueId + ")";
+            }
+            else if (target.indexOf("light")) {
+                target = "scene.getLightByUniqueID(" + event.object.uniqueId + ")";
+            }
+            else if (target === "transformnode") {
+                target = "scene.getTransformNodeByUniqueID(" + event.object.uniqueId + ")";
+            }
+            else if (target === "skeleton") {
+                target = "scene.getSkeletonByUniqueId(" + event.object.uniqueId + ")";
+            }
+            else if (target.indexOf("material")) {
+                target = "scene.getMaterialByUniqueID(" + event.object.uniqueId + ")";
+            }
+        }
+        this._recordedCodeLines.push(target + "." + event.property + " = " + value + ";");
+        this._previousObject = event.object;
+        this._previousProperty = event.property;
+    };
+    ReplayRecorder.prototype.export = function () {
+        var content = "// Code generated by babylon.js Inspector\r\n// Please keep in mind to define the 'scene' variable before using that code\r\n\r\n";
+        if (this._recordedCodeLines) {
+            content += this._recordedCodeLines.join("\r\n");
+        }
+        babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_0__["Tools"].Download(new Blob([content]), "pseudo-code.txt");
+    };
+    return ReplayRecorder;
+}());
+
+
+
+/***/ }),
+
 /***/ "./components/sceneExplorer/entities/animationGroupTreeItemComponent.tsx":
 /*!*******************************************************************************!*\
   !*** ./components/sceneExplorer/entities/animationGroupTreeItemComponent.tsx ***!
@@ -41828,7 +41931,7 @@ var Inspector = /** @class */ (function () {
         var options = tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"]({ original: true, popup: false, overlay: false, showExplorer: true, showInspector: true, embedMode: false, enableClose: true, handleResize: true, enablePopup: true }, userOptions);
         // Prepare state
         if (!this._GlobalState.onPropertyChangedObservable) {
-            this._GlobalState.onPropertyChangedObservable = this.OnPropertyChangedObservable;
+            this._GlobalState.init(this.OnPropertyChangedObservable);
         }
         if (!this._GlobalState.onSelectionChangedObservable) {
             this._GlobalState.onSelectionChangedObservable = this.OnSelectionChangeObservable;

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.max.js.map


+ 14 - 0
dist/preview release/inspector/babylon.inspector.d.ts

@@ -8,6 +8,16 @@ declare module INSPECTOR {
     }
 }
 declare module INSPECTOR {
+    export class ReplayRecorder {
+        private _recordedCodeLines;
+        private _previousObject;
+        private _previousProperty;
+        reset(): void;
+        record(event: PropertyChangedEvent): void;
+        export(): void;
+    }
+}
+declare module INSPECTOR {
     export class GlobalState {
         onSelectionChangedObservable: BABYLON.Observable<any>;
         onPropertyChangedObservable: BABYLON.Observable<PropertyChangedEvent>;
@@ -27,6 +37,8 @@ declare module INSPECTOR {
         };
         blockMutationUpdates: boolean;
         selectedLineContainerTitle: string;
+        recorder: ReplayRecorder;
+        init(propertyChangedObservable: BABYLON.Observable<PropertyChangedEvent>): void;
         prepareGLTFPlugin(loader: BABYLON.GLTFFileLoader): void;
         lightGizmos: Array<BABYLON.LightGizmo>;
         enableLightGizmo(light: BABYLON.Light, enable?: boolean): void;
@@ -1270,6 +1282,8 @@ declare module INSPECTOR {
         exportGLTF(): void;
         exportBabylon(): void;
         createEnvTexture(): void;
+        resetReplay(): void;
+        exportReplay(): void;
         render(): JSX.Element | null;
     }
 }

+ 30 - 0
dist/preview release/inspector/babylon.inspector.module.d.ts

@@ -7,6 +7,17 @@ declare module "babylonjs-inspector/components/propertyChangedEvent" {
         initialValue: any;
     }
 }
+declare module "babylonjs-inspector/components/replayRecorder" {
+    import { PropertyChangedEvent } from "babylonjs-inspector/components/propertyChangedEvent";
+    export class ReplayRecorder {
+        private _recordedCodeLines;
+        private _previousObject;
+        private _previousProperty;
+        reset(): void;
+        record(event: PropertyChangedEvent): void;
+        export(): void;
+    }
+}
 declare module "babylonjs-inspector/components/globalState" {
     import { GLTFFileLoader, IGLTFLoaderExtension } from "babylonjs-loaders/glTF/index";
     import { IGLTFValidationResults } from "babylonjs-gltf2interface";
@@ -17,6 +28,7 @@ declare module "babylonjs-inspector/components/globalState" {
     import { Light } from "babylonjs/Lights/light";
     import { LightGizmo } from "babylonjs/Gizmos/lightGizmo";
     import { PropertyChangedEvent } from "babylonjs-inspector/components/propertyChangedEvent";
+    import { ReplayRecorder } from "babylonjs-inspector/components/replayRecorder";
     export class GlobalState {
         onSelectionChangedObservable: Observable<any>;
         onPropertyChangedObservable: Observable<PropertyChangedEvent>;
@@ -36,6 +48,8 @@ declare module "babylonjs-inspector/components/globalState" {
         };
         blockMutationUpdates: boolean;
         selectedLineContainerTitle: string;
+        recorder: ReplayRecorder;
+        init(propertyChangedObservable: Observable<PropertyChangedEvent>): void;
         prepareGLTFPlugin(loader: GLTFFileLoader): void;
         lightGizmos: Array<LightGizmo>;
         enableLightGizmo(light: Light, enable?: boolean): void;
@@ -1657,6 +1671,8 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/toolsTabComponent
         exportGLTF(): void;
         exportBabylon(): void;
         createEnvTexture(): void;
+        resetReplay(): void;
+        exportReplay(): void;
         render(): JSX.Element | null;
     }
 }
@@ -2187,6 +2203,16 @@ declare module INSPECTOR {
     }
 }
 declare module INSPECTOR {
+    export class ReplayRecorder {
+        private _recordedCodeLines;
+        private _previousObject;
+        private _previousProperty;
+        reset(): void;
+        record(event: PropertyChangedEvent): void;
+        export(): void;
+    }
+}
+declare module INSPECTOR {
     export class GlobalState {
         onSelectionChangedObservable: BABYLON.Observable<any>;
         onPropertyChangedObservable: BABYLON.Observable<PropertyChangedEvent>;
@@ -2206,6 +2232,8 @@ declare module INSPECTOR {
         };
         blockMutationUpdates: boolean;
         selectedLineContainerTitle: string;
+        recorder: ReplayRecorder;
+        init(propertyChangedObservable: BABYLON.Observable<PropertyChangedEvent>): void;
         prepareGLTFPlugin(loader: BABYLON.GLTFFileLoader): void;
         lightGizmos: Array<BABYLON.LightGizmo>;
         enableLightGizmo(light: BABYLON.Light, enable?: boolean): void;
@@ -3449,6 +3477,8 @@ declare module INSPECTOR {
         exportGLTF(): void;
         exportBabylon(): void;
         createEnvTexture(): void;
+        resetReplay(): void;
+        exportReplay(): void;
         render(): JSX.Element | null;
     }
 }

+ 140 - 108
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -795,7 +795,7 @@ var MSFT_audio_emitter = /** @class */ (function () {
         }
         var promise;
         if (clip.uri) {
-            promise = this._loader.loadUriAsync(context, clip.uri);
+            promise = this._loader.loadUriAsync(context, clip, clip.uri);
         }
         else {
             var bufferView = _glTFLoader__WEBPACK_IMPORTED_MODULE_1__["ArrayItem"].Get(context + "/bufferView", this._loader.gltf.bufferViews, clip.bufferView);
@@ -1106,7 +1106,7 @@ var MSFT_lod = /** @class */ (function () {
         });
     };
     /** @hidden */
-    MSFT_lod.prototype._loadUriAsync = function (context, uri) {
+    MSFT_lod.prototype._loadUriAsync = function (context, property, uri) {
         var _this = this;
         // Defer the loading of uris if loading a material or node LOD.
         if (this._materialIndexLOD !== null) {
@@ -1114,7 +1114,7 @@ var MSFT_lod = /** @class */ (function () {
             var previousIndexLOD = this._materialIndexLOD - 1;
             this._materialSignalLODs[previousIndexLOD] = this._materialSignalLODs[previousIndexLOD] || new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Deferred"]();
             return this._materialSignalLODs[previousIndexLOD].promise.then(function () {
-                return _this._loader.loadUriAsync(context, uri);
+                return _this._loader.loadUriAsync(context, property, uri);
             });
         }
         else if (this._nodeIndexLOD !== null) {
@@ -1122,7 +1122,7 @@ var MSFT_lod = /** @class */ (function () {
             var previousIndexLOD = this._nodeIndexLOD - 1;
             this._nodeSignalLODs[previousIndexLOD] = this._nodeSignalLODs[previousIndexLOD] || new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Deferred"]();
             return this._nodeSignalLODs[this._nodeIndexLOD - 1].promise.then(function () {
-                return _this._loader.loadUriAsync(context, uri);
+                return _this._loader.loadUriAsync(context, property, uri);
             });
         }
         return null;
@@ -1451,6 +1451,36 @@ var GLTFLoader = /** @class */ (function () {
         enumerable: true,
         configurable: true
     });
+    Object.defineProperty(GLTFLoader.prototype, "gltf", {
+        /**
+         * The glTF object parsed from the JSON.
+         */
+        get: function () {
+            return this._gltf;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(GLTFLoader.prototype, "babylonScene", {
+        /**
+         * The Babylon scene when loading the asset.
+         */
+        get: function () {
+            return this._babylonScene;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(GLTFLoader.prototype, "rootBabylonMesh", {
+        /**
+         * The root Babylon mesh when loading the asset.
+         */
+        get: function () {
+            return this._rootBabylonMesh;
+        },
+        enumerable: true,
+        configurable: true
+    });
     /** @hidden */
     GLTFLoader.prototype.dispose = function () {
         if (this._disposed) {
@@ -1462,8 +1492,6 @@ var GLTFLoader = /** @class */ (function () {
             request.abort();
         }
         this._requests.length = 0;
-        delete this.gltf;
-        delete this.babylonScene;
         this._completePromises.length = 0;
         for (var name_1 in this._extensions) {
             var extension = this._extensions[name_1];
@@ -1472,6 +1500,8 @@ var GLTFLoader = /** @class */ (function () {
             }
         }
         this._extensions = {};
+        delete this._gltf;
+        delete this._babylonScene;
         delete this._rootBabylonMesh;
         delete this._progressCallback;
         this._parent._clear();
@@ -1480,7 +1510,7 @@ var GLTFLoader = /** @class */ (function () {
     GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress, fileName) {
         var _this = this;
         return Promise.resolve().then(function () {
-            _this.babylonScene = scene;
+            _this._babylonScene = scene;
             _this._rootUrl = rootUrl;
             _this._fileName = fileName || "scene";
             _this._progressCallback = onProgress;
@@ -1488,8 +1518,8 @@ var GLTFLoader = /** @class */ (function () {
             var nodes = null;
             if (meshesNames) {
                 var nodeMap_1 = {};
-                if (_this.gltf.nodes) {
-                    for (var _i = 0, _a = _this.gltf.nodes; _i < _a.length; _i++) {
+                if (_this._gltf.nodes) {
+                    for (var _i = 0, _a = _this._gltf.nodes; _i < _a.length; _i++) {
                         var node = _a[_i];
                         if (node.name) {
                             nodeMap_1[node.name] = node.index;
@@ -1519,7 +1549,7 @@ var GLTFLoader = /** @class */ (function () {
     GLTFLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress, fileName) {
         var _this = this;
         return Promise.resolve().then(function () {
-            _this.babylonScene = scene;
+            _this._babylonScene = scene;
             _this._rootUrl = rootUrl;
             _this._fileName = fileName || "scene";
             _this._progressCallback = onProgress;
@@ -1543,8 +1573,8 @@ var GLTFLoader = /** @class */ (function () {
             if (nodes) {
                 promises.push(_this.loadSceneAsync("/nodes", { nodes: nodes, index: -1 }));
             }
-            else if (_this.gltf.scene != undefined) {
-                var scene = ArrayItem.Get("/scene", _this.gltf.scenes, _this.gltf.scene);
+            else if (_this._gltf.scene != undefined) {
+                var scene = ArrayItem.Get("/scene", _this._gltf.scenes, _this._gltf.scene);
                 promises.push(_this.loadSceneAsync("/scenes/" + scene.index, scene));
             }
             if (_this._parent.compileMaterials) {
@@ -1591,10 +1621,10 @@ var GLTFLoader = /** @class */ (function () {
         });
     };
     GLTFLoader.prototype._loadData = function (data) {
-        this.gltf = data.json;
+        this._gltf = data.json;
         this._setupData();
         if (data.bin) {
-            var buffers = this.gltf.buffers;
+            var buffers = this._gltf.buffers;
             if (buffers && buffers[0] && !buffers[0].uri) {
                 var binaryBuffer = buffers[0];
                 if (binaryBuffer.byteLength < data.bin.byteLength - 3 || binaryBuffer.byteLength > data.bin.byteLength) {
@@ -1608,22 +1638,22 @@ var GLTFLoader = /** @class */ (function () {
         }
     };
     GLTFLoader.prototype._setupData = function () {
-        ArrayItem.Assign(this.gltf.accessors);
-        ArrayItem.Assign(this.gltf.animations);
-        ArrayItem.Assign(this.gltf.buffers);
-        ArrayItem.Assign(this.gltf.bufferViews);
-        ArrayItem.Assign(this.gltf.cameras);
-        ArrayItem.Assign(this.gltf.images);
-        ArrayItem.Assign(this.gltf.materials);
-        ArrayItem.Assign(this.gltf.meshes);
-        ArrayItem.Assign(this.gltf.nodes);
-        ArrayItem.Assign(this.gltf.samplers);
-        ArrayItem.Assign(this.gltf.scenes);
-        ArrayItem.Assign(this.gltf.skins);
-        ArrayItem.Assign(this.gltf.textures);
-        if (this.gltf.nodes) {
+        ArrayItem.Assign(this._gltf.accessors);
+        ArrayItem.Assign(this._gltf.animations);
+        ArrayItem.Assign(this._gltf.buffers);
+        ArrayItem.Assign(this._gltf.bufferViews);
+        ArrayItem.Assign(this._gltf.cameras);
+        ArrayItem.Assign(this._gltf.images);
+        ArrayItem.Assign(this._gltf.materials);
+        ArrayItem.Assign(this._gltf.meshes);
+        ArrayItem.Assign(this._gltf.nodes);
+        ArrayItem.Assign(this._gltf.samplers);
+        ArrayItem.Assign(this._gltf.scenes);
+        ArrayItem.Assign(this._gltf.skins);
+        ArrayItem.Assign(this._gltf.textures);
+        if (this._gltf.nodes) {
             var nodeParents = {};
-            for (var _i = 0, _a = this.gltf.nodes; _i < _a.length; _i++) {
+            for (var _i = 0, _a = this._gltf.nodes; _i < _a.length; _i++) {
                 var node = _a[_i];
                 if (node.children) {
                     for (var _b = 0, _c = node.children; _b < _c.length; _b++) {
@@ -1633,10 +1663,10 @@ var GLTFLoader = /** @class */ (function () {
                 }
             }
             var rootNode = this._createRootNode();
-            for (var _d = 0, _e = this.gltf.nodes; _d < _e.length; _d++) {
+            for (var _d = 0, _e = this._gltf.nodes; _d < _e.length; _d++) {
                 var node = _e[_d];
                 var parentIndex = nodeParents[node.index];
-                node.parent = parentIndex === undefined ? rootNode : this.gltf.nodes[parentIndex];
+                node.parent = parentIndex === undefined ? rootNode : this._gltf.nodes[parentIndex];
             }
         }
     };
@@ -1650,8 +1680,8 @@ var GLTFLoader = /** @class */ (function () {
         this._parent.onExtensionLoadedObservable.clear();
     };
     GLTFLoader.prototype._checkExtensions = function () {
-        if (this.gltf.extensionsRequired) {
-            for (var _i = 0, _a = this.gltf.extensionsRequired; _i < _a.length; _i++) {
+        if (this._gltf.extensionsRequired) {
+            for (var _i = 0, _a = this._gltf.extensionsRequired; _i < _a.length; _i++) {
                 var name_3 = _a[_i];
                 var extension = this._extensions[name_3];
                 if (!extension || !extension.enabled) {
@@ -1665,7 +1695,7 @@ var GLTFLoader = /** @class */ (function () {
         this.log(_glTFFileLoader__WEBPACK_IMPORTED_MODULE_1__["GLTFLoaderState"][this._state]);
     };
     GLTFLoader.prototype._createRootNode = function () {
-        this._rootBabylonMesh = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Mesh"]("__root__", this.babylonScene);
+        this._rootBabylonMesh = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Mesh"]("__root__", this._babylonScene);
         this._rootBabylonMesh.setEnabled(false);
         var rootNode = {
             _babylonTransformNode: this._rootBabylonMesh,
@@ -1673,7 +1703,7 @@ var GLTFLoader = /** @class */ (function () {
         };
         switch (this._parent.coordinateSystemMode) {
             case _glTFFileLoader__WEBPACK_IMPORTED_MODULE_1__["GLTFLoaderCoordinateSystemMode"].AUTO: {
-                if (!this.babylonScene.useRightHandedSystem) {
+                if (!this._babylonScene.useRightHandedSystem) {
                     rootNode.rotation = [0, 1, 0, 0];
                     rootNode.scale = [1, 1, -1];
                     GLTFLoader._LoadTransform(rootNode, this._rootBabylonMesh);
@@ -1681,7 +1711,7 @@ var GLTFLoader = /** @class */ (function () {
                 break;
             }
             case _glTFFileLoader__WEBPACK_IMPORTED_MODULE_1__["GLTFLoaderCoordinateSystemMode"].FORCE_RIGHT_HANDED: {
-                this.babylonScene.useRightHandedSystem = true;
+                this._babylonScene.useRightHandedSystem = true;
                 break;
             }
             default: {
@@ -1708,7 +1738,7 @@ var GLTFLoader = /** @class */ (function () {
         if (scene.nodes) {
             for (var _i = 0, _a = scene.nodes; _i < _a.length; _i++) {
                 var index = _a[_i];
-                var node = ArrayItem.Get(context + "/nodes/" + index, this.gltf.nodes, index);
+                var node = ArrayItem.Get(context + "/nodes/" + index, this._gltf.nodes, index);
                 promises.push(this.loadNodeAsync("/nodes/" + node.index, node, function (babylonMesh) {
                     babylonMesh.parent = _this._rootBabylonMesh;
                 }));
@@ -1716,8 +1746,8 @@ var GLTFLoader = /** @class */ (function () {
         }
         // Link all Babylon bones for each glTF node with the corresponding Babylon transform node.
         // A glTF joint is a pointer to a glTF node in the glTF node hierarchy similar to Unity3D.
-        if (this.gltf.nodes) {
-            for (var _b = 0, _c = this.gltf.nodes; _b < _c.length; _b++) {
+        if (this._gltf.nodes) {
+            for (var _b = 0, _c = this._gltf.nodes; _b < _c.length; _b++) {
                 var node = _c[_b];
                 if (node._babylonTransformNode && node._babylonBones) {
                     for (var _d = 0, _e = node._babylonBones; _d < _e.length; _d++) {
@@ -1743,7 +1773,7 @@ var GLTFLoader = /** @class */ (function () {
         var meshes = new Array();
         // Root mesh is always first.
         meshes.push(this._rootBabylonMesh);
-        var nodes = this.gltf.nodes;
+        var nodes = this._gltf.nodes;
         if (nodes) {
             for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {
                 var node = nodes_1[_i];
@@ -1756,7 +1786,7 @@ var GLTFLoader = /** @class */ (function () {
     };
     GLTFLoader.prototype._getSkeletons = function () {
         var skeletons = new Array();
-        var skins = this.gltf.skins;
+        var skins = this._gltf.skins;
         if (skins) {
             for (var _i = 0, skins_1 = skins; _i < skins_1.length; _i++) {
                 var skin = skins_1[_i];
@@ -1769,7 +1799,7 @@ var GLTFLoader = /** @class */ (function () {
     };
     GLTFLoader.prototype._getAnimationGroups = function () {
         var animationGroups = new Array();
-        var animations = this.gltf.animations;
+        var animations = this._gltf.animations;
         if (animations) {
             for (var _i = 0, animations_1 = animations; _i < animations_1.length; _i++) {
                 var animation = animations_1[_i];
@@ -1830,7 +1860,7 @@ var GLTFLoader = /** @class */ (function () {
             GLTFLoader.AddPointerMetadata(babylonTransformNode, context);
             GLTFLoader._LoadTransform(node, babylonTransformNode);
             if (node.camera != undefined) {
-                var camera = ArrayItem.Get(context + "/camera", _this.gltf.cameras, node.camera);
+                var camera = ArrayItem.Get(context + "/camera", _this._gltf.cameras, node.camera);
                 promises.push(_this.loadCameraAsync("/cameras/" + camera.index, camera, function (babylonCamera) {
                     babylonCamera.parent = babylonTransformNode;
                 }));
@@ -1838,7 +1868,7 @@ var GLTFLoader = /** @class */ (function () {
             if (node.children) {
                 for (var _i = 0, _a = node.children; _i < _a.length; _i++) {
                     var index = _a[_i];
-                    var childNode = ArrayItem.Get(context + "/children/" + index, _this.gltf.nodes, index);
+                    var childNode = ArrayItem.Get(context + "/children/" + index, _this._gltf.nodes, index);
                     promises.push(_this.loadNodeAsync("/nodes/" + childNode.index, childNode, function (childBabylonMesh) {
                         childBabylonMesh.parent = babylonTransformNode;
                     }));
@@ -1848,11 +1878,11 @@ var GLTFLoader = /** @class */ (function () {
         };
         if (node.mesh == undefined) {
             var nodeName = node.name || "node" + node.index;
-            node._babylonTransformNode = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["TransformNode"](nodeName, this.babylonScene);
+            node._babylonTransformNode = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["TransformNode"](nodeName, this._babylonScene);
             loadNode(node._babylonTransformNode);
         }
         else {
-            var mesh = ArrayItem.Get(context + "/mesh", this.gltf.meshes, node.mesh);
+            var mesh = ArrayItem.Get(context + "/mesh", this._gltf.meshes, node.mesh);
             promises.push(this._loadMeshAsync("/meshes/" + mesh.index, node, mesh, loadNode));
         }
         this.logClose();
@@ -1882,7 +1912,7 @@ var GLTFLoader = /** @class */ (function () {
             }));
         }
         else {
-            node._babylonTransformNode = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["TransformNode"](name, this.babylonScene);
+            node._babylonTransformNode = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["TransformNode"](name, this._babylonScene);
             node._primitiveBabylonMeshes = [];
             for (var _i = 0, primitives_1 = primitives; _i < primitives_1.length; _i++) {
                 var primitive = primitives_1[_i];
@@ -1893,7 +1923,7 @@ var GLTFLoader = /** @class */ (function () {
             }
         }
         if (node.skin != undefined) {
-            var skin = ArrayItem.Get(context + "/skin", this.gltf.skins, node.skin);
+            var skin = ArrayItem.Get(context + "/skin", this._gltf.skins, node.skin);
             promises.push(this._loadSkinAsync("/skins/" + skin.index, node, skin));
         }
         assign(node._babylonTransformNode);
@@ -1915,7 +1945,7 @@ var GLTFLoader = /** @class */ (function () {
         }
         else {
             var promises = new Array();
-            var babylonMesh_1 = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Mesh"](name, this.babylonScene);
+            var babylonMesh_1 = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Mesh"](name, this._babylonScene);
             this._createMorphTargets(context, node, mesh, primitive, babylonMesh_1);
             promises.push(this._loadVertexDataAsync(context, primitive, babylonMesh_1).then(function (babylonGeometry) {
                 return _this._loadMorphTargetsAsync(context, primitive, babylonMesh_1, babylonGeometry).then(function () {
@@ -1933,7 +1963,7 @@ var GLTFLoader = /** @class */ (function () {
                 babylonMesh_1.material = babylonMaterial;
             }
             else {
-                var material = ArrayItem.Get(context + "/material", this.gltf.materials, primitive.material);
+                var material = ArrayItem.Get(context + "/material", this._gltf.materials, primitive.material);
                 promises.push(this._loadMaterialAsync("/materials/" + material.index, material, babylonMesh_1, babylonDrawMode, function (babylonMaterial) {
                     babylonMesh_1.material = babylonMaterial;
                 }));
@@ -1966,12 +1996,12 @@ var GLTFLoader = /** @class */ (function () {
             throw new Error(context + ": Attributes are missing");
         }
         var promises = new Array();
-        var babylonGeometry = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Geometry"](babylonMesh.name, this.babylonScene);
+        var babylonGeometry = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Geometry"](babylonMesh.name, this._babylonScene);
         if (primitive.indices == undefined) {
             babylonMesh.isUnIndexed = true;
         }
         else {
-            var accessor = ArrayItem.Get(context + "/indices", this.gltf.accessors, primitive.indices);
+            var accessor = ArrayItem.Get(context + "/indices", this._gltf.accessors, primitive.indices);
             promises.push(this._loadIndicesAccessorAsync("/accessors/" + accessor.index, accessor).then(function (data) {
                 babylonGeometry.setIndices(data);
             }));
@@ -1984,7 +2014,7 @@ var GLTFLoader = /** @class */ (function () {
             if (babylonMesh._delayInfo.indexOf(kind) === -1) {
                 babylonMesh._delayInfo.push(kind);
             }
-            var accessor = ArrayItem.Get(context + "/attributes/" + attribute, _this.gltf.accessors, attributes[attribute]);
+            var accessor = ArrayItem.Get(context + "/attributes/" + attribute, _this._gltf.accessors, attributes[attribute]);
             promises.push(_this._loadVertexAccessorAsync("/accessors/" + accessor.index, accessor, kind).then(function (babylonVertexBuffer) {
                 babylonGeometry.setVerticesBuffer(babylonVertexBuffer, accessor.count);
             }));
@@ -2048,7 +2078,7 @@ var GLTFLoader = /** @class */ (function () {
             if (!babylonVertexBuffer) {
                 return;
             }
-            var accessor = ArrayItem.Get(context + "/" + attribute, _this.gltf.accessors, attributes[attribute]);
+            var accessor = ArrayItem.Get(context + "/" + attribute, _this._gltf.accessors, attributes[attribute]);
             promises.push(_this._loadFloatAccessorAsync("/accessors/" + accessor.index, accessor).then(function (data) {
                 setData(babylonVertexBuffer, data);
             }));
@@ -2119,7 +2149,7 @@ var GLTFLoader = /** @class */ (function () {
             return skin._data.promise;
         }
         var skeletonId = "skeleton" + skin.index;
-        var babylonSkeleton = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Skeleton"](skin.name || skeletonId, skeletonId, this.babylonScene);
+        var babylonSkeleton = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Skeleton"](skin.name || skeletonId, skeletonId, this._babylonScene);
         // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
         babylonSkeleton.overrideMesh = this._rootBabylonMesh;
         this._loadBones(context, skin, babylonSkeleton);
@@ -2137,7 +2167,7 @@ var GLTFLoader = /** @class */ (function () {
         var babylonBones = {};
         for (var _i = 0, _a = skin.joints; _i < _a.length; _i++) {
             var index = _a[_i];
-            var node = ArrayItem.Get(context + "/joints/" + index, this.gltf.nodes, index);
+            var node = ArrayItem.Get(context + "/joints/" + index, this._gltf.nodes, index);
             this._loadBone(node, skin, babylonSkeleton, babylonBones);
         }
     };
@@ -2161,7 +2191,7 @@ var GLTFLoader = /** @class */ (function () {
         if (skin.inverseBindMatrices == undefined) {
             return Promise.resolve(null);
         }
-        var accessor = ArrayItem.Get(context + "/inverseBindMatrices", this.gltf.accessors, skin.inverseBindMatrices);
+        var accessor = ArrayItem.Get(context + "/inverseBindMatrices", this._gltf.accessors, skin.inverseBindMatrices);
         return this._loadFloatAccessorAsync("/accessors/" + accessor.index, accessor);
     };
     GLTFLoader.prototype._updateBoneMatrices = function (babylonSkeleton, inverseBindMatricesData) {
@@ -2201,7 +2231,7 @@ var GLTFLoader = /** @class */ (function () {
         }
         var promises = new Array();
         this.logOpen(context + " " + (camera.name || ""));
-        var babylonCamera = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["FreeCamera"](camera.name || "camera" + camera.index, babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Zero(), this.babylonScene, false);
+        var babylonCamera = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["FreeCamera"](camera.name || "camera" + camera.index, babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Zero(), this._babylonScene, false);
         babylonCamera.rotation = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"](0, Math.PI, 0);
         switch (camera.type) {
             case "perspective" /* PERSPECTIVE */: {
@@ -2239,7 +2269,7 @@ var GLTFLoader = /** @class */ (function () {
         });
     };
     GLTFLoader.prototype._loadAnimationsAsync = function () {
-        var animations = this.gltf.animations;
+        var animations = this._gltf.animations;
         if (!animations) {
             return Promise.resolve();
         }
@@ -2261,7 +2291,7 @@ var GLTFLoader = /** @class */ (function () {
         if (promise) {
             return promise;
         }
-        var babylonAnimationGroup = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["AnimationGroup"](animation.name || "animation" + animation.index, this.babylonScene);
+        var babylonAnimationGroup = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["AnimationGroup"](animation.name || "animation" + animation.index, this._babylonScene);
         animation._babylonAnimationGroup = babylonAnimationGroup;
         var promises = new Array();
         ArrayItem.Assign(animation.channels);
@@ -2280,7 +2310,7 @@ var GLTFLoader = /** @class */ (function () {
         if (channel.target.node == undefined) {
             return Promise.resolve();
         }
-        var targetNode = ArrayItem.Get(context + "/target/node", this.gltf.nodes, channel.target.node);
+        var targetNode = ArrayItem.Get(context + "/target/node", this._gltf.nodes, channel.target.node);
         // Ignore animations that have no animation targets.
         if ((channel.target.path === "weights" /* WEIGHTS */ && !targetNode._numMorphTargets) ||
             (channel.target.path !== "weights" /* WEIGHTS */ && !targetNode._babylonTransformNode)) {
@@ -2430,8 +2460,8 @@ var GLTFLoader = /** @class */ (function () {
                 throw new Error(context + "/interpolation: Invalid value (" + sampler.interpolation + ")");
             }
         }
-        var inputAccessor = ArrayItem.Get(context + "/input", this.gltf.accessors, sampler.input);
-        var outputAccessor = ArrayItem.Get(context + "/output", this.gltf.accessors, sampler.output);
+        var inputAccessor = ArrayItem.Get(context + "/input", this._gltf.accessors, sampler.input);
+        var outputAccessor = ArrayItem.Get(context + "/output", this._gltf.accessors, sampler.output);
         sampler._data = Promise.all([
             this._loadFloatAccessorAsync("/accessors/" + inputAccessor.index, inputAccessor),
             this._loadFloatAccessorAsync("/accessors/" + outputAccessor.index, outputAccessor)
@@ -2452,7 +2482,7 @@ var GLTFLoader = /** @class */ (function () {
         if (!buffer.uri) {
             throw new Error(context + "/uri: Value is missing");
         }
-        buffer._data = this.loadUriAsync(context + "/uri", buffer.uri);
+        buffer._data = this.loadUriAsync(context + "/uri", buffer, buffer.uri);
         return buffer._data;
     };
     /**
@@ -2465,7 +2495,7 @@ var GLTFLoader = /** @class */ (function () {
         if (bufferView._data) {
             return bufferView._data;
         }
-        var buffer = ArrayItem.Get(context + "/buffer", this.gltf.buffers, bufferView.buffer);
+        var buffer = ArrayItem.Get(context + "/buffer", this._gltf.buffers, bufferView.buffer);
         bufferView._data = this._loadBufferAsync("/buffers/" + buffer.index, buffer).then(function (data) {
             try {
                 return new Uint8Array(data.buffer, data.byteOffset + (bufferView.byteOffset || 0), bufferView.byteLength);
@@ -2488,7 +2518,7 @@ var GLTFLoader = /** @class */ (function () {
         if (accessor._data) {
             return accessor._data;
         }
-        var bufferView = ArrayItem.Get(context + "/bufferView", this.gltf.bufferViews, accessor.bufferView);
+        var bufferView = ArrayItem.Get(context + "/bufferView", this._gltf.bufferViews, accessor.bufferView);
         accessor._data = this.loadBufferViewAsync("/bufferViews/" + bufferView.index, bufferView).then(function (data) {
             return GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, accessor.count);
         });
@@ -2509,7 +2539,7 @@ var GLTFLoader = /** @class */ (function () {
             accessor._data = Promise.resolve(new Float32Array(length));
         }
         else {
-            var bufferView = ArrayItem.Get(context + "/bufferView", this.gltf.bufferViews, accessor.bufferView);
+            var bufferView = ArrayItem.Get(context + "/bufferView", this._gltf.bufferViews, accessor.bufferView);
             accessor._data = this.loadBufferViewAsync("/bufferViews/" + bufferView.index, bufferView).then(function (data) {
                 return GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, length);
             });
@@ -2518,8 +2548,8 @@ var GLTFLoader = /** @class */ (function () {
             var sparse_1 = accessor.sparse;
             accessor._data = accessor._data.then(function (view) {
                 var data = view;
-                var indicesBufferView = ArrayItem.Get(context + "/sparse/indices/bufferView", _this.gltf.bufferViews, sparse_1.indices.bufferView);
-                var valuesBufferView = ArrayItem.Get(context + "/sparse/values/bufferView", _this.gltf.bufferViews, sparse_1.values.bufferView);
+                var indicesBufferView = ArrayItem.Get(context + "/sparse/indices/bufferView", _this._gltf.bufferViews, sparse_1.indices.bufferView);
+                var valuesBufferView = ArrayItem.Get(context + "/sparse/values/bufferView", _this._gltf.bufferViews, sparse_1.values.bufferView);
                 return Promise.all([
                     _this.loadBufferViewAsync("/bufferViews/" + indicesBufferView.index, indicesBufferView),
                     _this.loadBufferViewAsync("/bufferViews/" + valuesBufferView.index, valuesBufferView)
@@ -2546,7 +2576,7 @@ var GLTFLoader = /** @class */ (function () {
             return bufferView._babylonBuffer;
         }
         bufferView._babylonBuffer = this.loadBufferViewAsync("/bufferViews/" + bufferView.index, bufferView).then(function (data) {
-            return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Buffer"](_this.babylonScene.getEngine(), data, false);
+            return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Buffer"](_this._babylonScene.getEngine(), data, false);
         });
         return bufferView._babylonBuffer;
     };
@@ -2557,21 +2587,21 @@ var GLTFLoader = /** @class */ (function () {
         }
         if (accessor.sparse) {
             accessor._babylonVertexBuffer = this._loadFloatAccessorAsync("/accessors/" + accessor.index, accessor).then(function (data) {
-                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this.babylonScene.getEngine(), data, kind, false);
+                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this._babylonScene.getEngine(), data, kind, false);
             });
         }
         // HACK: If byte offset is not a multiple of component type byte length then load as a float array instead of using Babylon buffers.
         else if (accessor.byteOffset && accessor.byteOffset % babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"].GetTypeByteLength(accessor.componentType) !== 0) {
             babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Tools"].Warn("Accessor byte offset is not a multiple of component type byte length");
             accessor._babylonVertexBuffer = this._loadFloatAccessorAsync("/accessors/" + accessor.index, accessor).then(function (data) {
-                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this.babylonScene.getEngine(), data, kind, false);
+                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this._babylonScene.getEngine(), data, kind, false);
             });
         }
         else {
-            var bufferView_1 = ArrayItem.Get(context + "/bufferView", this.gltf.bufferViews, accessor.bufferView);
+            var bufferView_1 = ArrayItem.Get(context + "/bufferView", this._gltf.bufferViews, accessor.bufferView);
             accessor._babylonVertexBuffer = this._loadVertexBufferViewAsync(bufferView_1, kind).then(function (babylonBuffer) {
                 var size = GLTFLoader._GetNumComponents(context, accessor.type);
-                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this.babylonScene.getEngine(), babylonBuffer, kind, false, false, bufferView_1.byteStride, false, accessor.byteOffset, size, accessor.componentType, accessor.normalized, true);
+                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this._babylonScene.getEngine(), babylonBuffer, kind, false, false, bufferView_1.byteStride, false, accessor.byteOffset, size, accessor.componentType, accessor.normalized, true);
             });
         }
         return accessor._babylonVertexBuffer;
@@ -2644,8 +2674,8 @@ var GLTFLoader = /** @class */ (function () {
         });
     };
     GLTFLoader.prototype._createDefaultMaterial = function (name, babylonDrawMode) {
-        var babylonMaterial = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["PBRMaterial"](name, this.babylonScene);
-        babylonMaterial.sideOrientation = this.babylonScene.useRightHandedSystem ? babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Material"].CounterClockWiseSideOrientation : babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Material"].ClockWiseSideOrientation;
+        var babylonMaterial = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["PBRMaterial"](name, this._babylonScene);
+        babylonMaterial.sideOrientation = this._babylonScene.useRightHandedSystem ? babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Material"].CounterClockWiseSideOrientation : babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Material"].ClockWiseSideOrientation;
         babylonMaterial.fillMode = babylonDrawMode;
         babylonMaterial.enableSpecularAntiAliasing = true;
         babylonMaterial.useRadianceOverAlpha = !this._parent.transparencyAsCoverage;
@@ -2713,8 +2743,8 @@ var GLTFLoader = /** @class */ (function () {
                 texture.name = babylonMaterial.name + " (Normal)";
                 babylonMaterial.bumpTexture = texture;
             }));
-            babylonMaterial.invertNormalMapX = !this.babylonScene.useRightHandedSystem;
-            babylonMaterial.invertNormalMapY = this.babylonScene.useRightHandedSystem;
+            babylonMaterial.invertNormalMapX = !this._babylonScene.useRightHandedSystem;
+            babylonMaterial.invertNormalMapY = this._babylonScene.useRightHandedSystem;
             if (material.normalTexture.scale != undefined) {
                 babylonMaterial.bumpTexture.level = material.normalTexture.scale;
             }
@@ -2791,7 +2821,7 @@ var GLTFLoader = /** @class */ (function () {
             return extensionPromise;
         }
         this.logOpen("" + context);
-        var texture = ArrayItem.Get(context + "/index", this.gltf.textures, textureInfo.index);
+        var texture = ArrayItem.Get(context + "/index", this._gltf.textures, textureInfo.index);
         var promise = this._loadTextureAsync("/textures/" + textureInfo.index, texture, function (babylonTexture) {
             babylonTexture.coordinatesIndex = textureInfo.texCoord || 0;
             GLTFLoader.AddPointerMetadata(babylonTexture, context);
@@ -2806,21 +2836,21 @@ var GLTFLoader = /** @class */ (function () {
         if (assign === void 0) { assign = function () { }; }
         var promises = new Array();
         this.logOpen(context + " " + (texture.name || ""));
-        var sampler = (texture.sampler == undefined ? GLTFLoader._DefaultSampler : ArrayItem.Get(context + "/sampler", this.gltf.samplers, texture.sampler));
+        var sampler = (texture.sampler == undefined ? GLTFLoader._DefaultSampler : ArrayItem.Get(context + "/sampler", this._gltf.samplers, texture.sampler));
         var samplerData = this._loadSampler("/samplers/" + sampler.index, sampler);
-        var image = ArrayItem.Get(context + "/source", this.gltf.images, texture.source);
+        var image = ArrayItem.Get(context + "/source", this._gltf.images, texture.source);
         var url = null;
         if (image.uri) {
             if (babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Tools"].IsBase64(image.uri)) {
                 url = image.uri;
             }
-            else if (this.babylonScene.getEngine().textureFormatInUse) {
+            else if (this._babylonScene.getEngine().textureFormatInUse) {
                 // If an image uri and a texture format is set like (eg. KTX) load from url instead of blob to support texture format and fallback
                 url = this._rootUrl + image.uri;
             }
         }
         var deferred = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Deferred"]();
-        var babylonTexture = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Texture"](url, this.babylonScene, samplerData.noMipMaps, false, samplerData.samplingMode, function () {
+        var babylonTexture = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Texture"](url, this._babylonScene, samplerData.noMipMaps, false, samplerData.samplingMode, function () {
             if (!_this._disposed) {
                 deferred.resolve();
             }
@@ -2866,10 +2896,10 @@ var GLTFLoader = /** @class */ (function () {
         if (!image._data) {
             this.logOpen(context + " " + (image.name || ""));
             if (image.uri) {
-                image._data = this.loadUriAsync(context + "/uri", image.uri);
+                image._data = this.loadUriAsync(context + "/uri", image, image.uri);
             }
             else {
-                var bufferView = ArrayItem.Get(context + "/bufferView", this.gltf.bufferViews, image.bufferView);
+                var bufferView = ArrayItem.Get(context + "/bufferView", this._gltf.bufferViews, image.bufferView);
                 image._data = this.loadBufferViewAsync("/bufferViews/" + bufferView.index, bufferView);
             }
             this.logClose();
@@ -2879,12 +2909,13 @@ var GLTFLoader = /** @class */ (function () {
     /**
      * Loads a glTF uri.
      * @param context The context when loading the asset
+     * @param property The glTF property associated with the uri
      * @param uri The base64 or relative uri
      * @returns A promise that resolves with the loaded data when the load is complete
      */
-    GLTFLoader.prototype.loadUriAsync = function (context, uri) {
+    GLTFLoader.prototype.loadUriAsync = function (context, property, uri) {
         var _this = this;
-        var extensionPromise = this._extensionsLoadUriAsync(context, uri);
+        var extensionPromise = this._extensionsLoadUriAsync(context, property, uri);
         if (extensionPromise) {
             return extensionPromise;
         }
@@ -2922,7 +2953,7 @@ var GLTFLoader = /** @class */ (function () {
                                 }
                             }
                         }
-                    }, _this.babylonScene.offlineProvider, true, function (request, exception) {
+                    }, _this._babylonScene.offlineProvider, true, function (request, exception) {
                         if (!_this._disposed) {
                             reject(new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["LoadFileError"](context + ": Failed to load '" + uri + "'" + (request ? ": " + request.status + " " + request.statusText : ""), request));
                         }
@@ -3059,8 +3090,8 @@ var GLTFLoader = /** @class */ (function () {
         var _this = this;
         this._parent._startPerformanceCounter("Compile materials");
         var promises = new Array();
-        if (this.gltf.materials) {
-            for (var _i = 0, _a = this.gltf.materials; _i < _a.length; _i++) {
+        if (this._gltf.materials) {
+            for (var _i = 0, _a = this._gltf.materials; _i < _a.length; _i++) {
                 var material = _a[_i];
                 if (material._data) {
                     for (var babylonDrawMode in material._data) {
@@ -3087,7 +3118,7 @@ var GLTFLoader = /** @class */ (function () {
         var _this = this;
         this._parent._startPerformanceCounter("Compile shadow generators");
         var promises = new Array();
-        var lights = this.babylonScene.lights;
+        var lights = this._babylonScene.lights;
         for (var _i = 0, lights_1 = lights; _i < lights_1.length; _i++) {
             var light = lights_1[_i];
             var generator = light.getShadowGenerator();
@@ -3108,16 +3139,17 @@ var GLTFLoader = /** @class */ (function () {
             }
         }
     };
-    GLTFLoader.prototype._applyExtensions = function (property, actionAsync) {
+    GLTFLoader.prototype._applyExtensions = function (property, functionName, actionAsync) {
         for (var _i = 0, _a = GLTFLoader._ExtensionNames; _i < _a.length; _i++) {
             var name_5 = _a[_i];
             var extension = this._extensions[name_5];
             if (extension.enabled) {
+                var id = name_5 + "." + functionName;
                 var loaderProperty = property;
-                loaderProperty._activeLoaderExtensions = loaderProperty._activeLoaderExtensions || {};
-                var activeLoaderExtensions = loaderProperty._activeLoaderExtensions;
-                if (!activeLoaderExtensions[name_5]) {
-                    activeLoaderExtensions[name_5] = true;
+                loaderProperty._activeLoaderExtensionFunctions = loaderProperty._activeLoaderExtensionFunctions || {};
+                var activeLoaderExtensionFunctions = loaderProperty._activeLoaderExtensionFunctions;
+                if (!activeLoaderExtensionFunctions[id]) {
+                    activeLoaderExtensionFunctions[id] = true;
                     try {
                         var result = actionAsync(extension);
                         if (result) {
@@ -3125,7 +3157,7 @@ var GLTFLoader = /** @class */ (function () {
                         }
                     }
                     finally {
-                        delete activeLoaderExtensions[name_5];
+                        delete activeLoaderExtensionFunctions[id];
                     }
                 }
             }
@@ -3139,34 +3171,34 @@ var GLTFLoader = /** @class */ (function () {
         this._forEachExtensions(function (extension) { return extension.onReady && extension.onReady(); });
     };
     GLTFLoader.prototype._extensionsLoadSceneAsync = function (context, scene) {
-        return this._applyExtensions(scene, function (extension) { return extension.loadSceneAsync && extension.loadSceneAsync(context, scene); });
+        return this._applyExtensions(scene, "loadScene", function (extension) { return extension.loadSceneAsync && extension.loadSceneAsync(context, scene); });
     };
     GLTFLoader.prototype._extensionsLoadNodeAsync = function (context, node, assign) {
-        return this._applyExtensions(node, function (extension) { return extension.loadNodeAsync && extension.loadNodeAsync(context, node, assign); });
+        return this._applyExtensions(node, "loadNode", function (extension) { return extension.loadNodeAsync && extension.loadNodeAsync(context, node, assign); });
     };
     GLTFLoader.prototype._extensionsLoadCameraAsync = function (context, camera, assign) {
-        return this._applyExtensions(camera, function (extension) { return extension.loadCameraAsync && extension.loadCameraAsync(context, camera, assign); });
+        return this._applyExtensions(camera, "loadCamera", function (extension) { return extension.loadCameraAsync && extension.loadCameraAsync(context, camera, assign); });
     };
     GLTFLoader.prototype._extensionsLoadVertexDataAsync = function (context, primitive, babylonMesh) {
-        return this._applyExtensions(primitive, function (extension) { return extension._loadVertexDataAsync && extension._loadVertexDataAsync(context, primitive, babylonMesh); });
+        return this._applyExtensions(primitive, "loadVertexData", function (extension) { return extension._loadVertexDataAsync && extension._loadVertexDataAsync(context, primitive, babylonMesh); });
     };
     GLTFLoader.prototype._extensionsLoadMaterialAsync = function (context, material, babylonMesh, babylonDrawMode, assign) {
-        return this._applyExtensions(material, function (extension) { return extension._loadMaterialAsync && extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign); });
+        return this._applyExtensions(material, "loadMaterial", function (extension) { return extension._loadMaterialAsync && extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign); });
     };
     GLTFLoader.prototype._extensionsCreateMaterial = function (context, material, babylonDrawMode) {
-        return this._applyExtensions({}, function (extension) { return extension.createMaterial && extension.createMaterial(context, material, babylonDrawMode); });
+        return this._applyExtensions(material, "createMaterial", function (extension) { return extension.createMaterial && extension.createMaterial(context, material, babylonDrawMode); });
     };
     GLTFLoader.prototype._extensionsLoadMaterialPropertiesAsync = function (context, material, babylonMaterial) {
-        return this._applyExtensions(material, function (extension) { return extension.loadMaterialPropertiesAsync && extension.loadMaterialPropertiesAsync(context, material, babylonMaterial); });
+        return this._applyExtensions(material, "loadMaterialProperties", function (extension) { return extension.loadMaterialPropertiesAsync && extension.loadMaterialPropertiesAsync(context, material, babylonMaterial); });
     };
     GLTFLoader.prototype._extensionsLoadTextureInfoAsync = function (context, textureInfo, assign) {
-        return this._applyExtensions(textureInfo, function (extension) { return extension.loadTextureInfoAsync && extension.loadTextureInfoAsync(context, textureInfo, assign); });
+        return this._applyExtensions(textureInfo, "loadTextureInfo", function (extension) { return extension.loadTextureInfoAsync && extension.loadTextureInfoAsync(context, textureInfo, assign); });
     };
     GLTFLoader.prototype._extensionsLoadAnimationAsync = function (context, animation) {
-        return this._applyExtensions(animation, function (extension) { return extension.loadAnimationAsync && extension.loadAnimationAsync(context, animation); });
+        return this._applyExtensions(animation, "loadAnimation", function (extension) { return extension.loadAnimationAsync && extension.loadAnimationAsync(context, animation); });
     };
-    GLTFLoader.prototype._extensionsLoadUriAsync = function (context, uri) {
-        return this._applyExtensions({}, function (extension) { return extension._loadUriAsync && extension._loadUriAsync(context, uri); });
+    GLTFLoader.prototype._extensionsLoadUriAsync = function (context, property, uri) {
+        return this._applyExtensions(property, "loadUri", function (extension) { return extension._loadUriAsync && extension._loadUriAsync(context, property, uri); });
     };
     /**
      * Helper method called by a loader extension to load an glTF extension.

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.js.map


ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 140 - 108
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -3344,7 +3344,7 @@ var MSFT_audio_emitter = /** @class */ (function () {
         }
         var promise;
         if (clip.uri) {
-            promise = this._loader.loadUriAsync(context, clip.uri);
+            promise = this._loader.loadUriAsync(context, clip, clip.uri);
         }
         else {
             var bufferView = _glTFLoader__WEBPACK_IMPORTED_MODULE_1__["ArrayItem"].Get(context + "/bufferView", this._loader.gltf.bufferViews, clip.bufferView);
@@ -3655,7 +3655,7 @@ var MSFT_lod = /** @class */ (function () {
         });
     };
     /** @hidden */
-    MSFT_lod.prototype._loadUriAsync = function (context, uri) {
+    MSFT_lod.prototype._loadUriAsync = function (context, property, uri) {
         var _this = this;
         // Defer the loading of uris if loading a material or node LOD.
         if (this._materialIndexLOD !== null) {
@@ -3663,7 +3663,7 @@ var MSFT_lod = /** @class */ (function () {
             var previousIndexLOD = this._materialIndexLOD - 1;
             this._materialSignalLODs[previousIndexLOD] = this._materialSignalLODs[previousIndexLOD] || new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Deferred"]();
             return this._materialSignalLODs[previousIndexLOD].promise.then(function () {
-                return _this._loader.loadUriAsync(context, uri);
+                return _this._loader.loadUriAsync(context, property, uri);
             });
         }
         else if (this._nodeIndexLOD !== null) {
@@ -3671,7 +3671,7 @@ var MSFT_lod = /** @class */ (function () {
             var previousIndexLOD = this._nodeIndexLOD - 1;
             this._nodeSignalLODs[previousIndexLOD] = this._nodeSignalLODs[previousIndexLOD] || new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Deferred"]();
             return this._nodeSignalLODs[this._nodeIndexLOD - 1].promise.then(function () {
-                return _this._loader.loadUriAsync(context, uri);
+                return _this._loader.loadUriAsync(context, property, uri);
             });
         }
         return null;
@@ -4000,6 +4000,36 @@ var GLTFLoader = /** @class */ (function () {
         enumerable: true,
         configurable: true
     });
+    Object.defineProperty(GLTFLoader.prototype, "gltf", {
+        /**
+         * The glTF object parsed from the JSON.
+         */
+        get: function () {
+            return this._gltf;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(GLTFLoader.prototype, "babylonScene", {
+        /**
+         * The Babylon scene when loading the asset.
+         */
+        get: function () {
+            return this._babylonScene;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(GLTFLoader.prototype, "rootBabylonMesh", {
+        /**
+         * The root Babylon mesh when loading the asset.
+         */
+        get: function () {
+            return this._rootBabylonMesh;
+        },
+        enumerable: true,
+        configurable: true
+    });
     /** @hidden */
     GLTFLoader.prototype.dispose = function () {
         if (this._disposed) {
@@ -4011,8 +4041,6 @@ var GLTFLoader = /** @class */ (function () {
             request.abort();
         }
         this._requests.length = 0;
-        delete this.gltf;
-        delete this.babylonScene;
         this._completePromises.length = 0;
         for (var name_1 in this._extensions) {
             var extension = this._extensions[name_1];
@@ -4021,6 +4049,8 @@ var GLTFLoader = /** @class */ (function () {
             }
         }
         this._extensions = {};
+        delete this._gltf;
+        delete this._babylonScene;
         delete this._rootBabylonMesh;
         delete this._progressCallback;
         this._parent._clear();
@@ -4029,7 +4059,7 @@ var GLTFLoader = /** @class */ (function () {
     GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress, fileName) {
         var _this = this;
         return Promise.resolve().then(function () {
-            _this.babylonScene = scene;
+            _this._babylonScene = scene;
             _this._rootUrl = rootUrl;
             _this._fileName = fileName || "scene";
             _this._progressCallback = onProgress;
@@ -4037,8 +4067,8 @@ var GLTFLoader = /** @class */ (function () {
             var nodes = null;
             if (meshesNames) {
                 var nodeMap_1 = {};
-                if (_this.gltf.nodes) {
-                    for (var _i = 0, _a = _this.gltf.nodes; _i < _a.length; _i++) {
+                if (_this._gltf.nodes) {
+                    for (var _i = 0, _a = _this._gltf.nodes; _i < _a.length; _i++) {
                         var node = _a[_i];
                         if (node.name) {
                             nodeMap_1[node.name] = node.index;
@@ -4068,7 +4098,7 @@ var GLTFLoader = /** @class */ (function () {
     GLTFLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress, fileName) {
         var _this = this;
         return Promise.resolve().then(function () {
-            _this.babylonScene = scene;
+            _this._babylonScene = scene;
             _this._rootUrl = rootUrl;
             _this._fileName = fileName || "scene";
             _this._progressCallback = onProgress;
@@ -4092,8 +4122,8 @@ var GLTFLoader = /** @class */ (function () {
             if (nodes) {
                 promises.push(_this.loadSceneAsync("/nodes", { nodes: nodes, index: -1 }));
             }
-            else if (_this.gltf.scene != undefined) {
-                var scene = ArrayItem.Get("/scene", _this.gltf.scenes, _this.gltf.scene);
+            else if (_this._gltf.scene != undefined) {
+                var scene = ArrayItem.Get("/scene", _this._gltf.scenes, _this._gltf.scene);
                 promises.push(_this.loadSceneAsync("/scenes/" + scene.index, scene));
             }
             if (_this._parent.compileMaterials) {
@@ -4140,10 +4170,10 @@ var GLTFLoader = /** @class */ (function () {
         });
     };
     GLTFLoader.prototype._loadData = function (data) {
-        this.gltf = data.json;
+        this._gltf = data.json;
         this._setupData();
         if (data.bin) {
-            var buffers = this.gltf.buffers;
+            var buffers = this._gltf.buffers;
             if (buffers && buffers[0] && !buffers[0].uri) {
                 var binaryBuffer = buffers[0];
                 if (binaryBuffer.byteLength < data.bin.byteLength - 3 || binaryBuffer.byteLength > data.bin.byteLength) {
@@ -4157,22 +4187,22 @@ var GLTFLoader = /** @class */ (function () {
         }
     };
     GLTFLoader.prototype._setupData = function () {
-        ArrayItem.Assign(this.gltf.accessors);
-        ArrayItem.Assign(this.gltf.animations);
-        ArrayItem.Assign(this.gltf.buffers);
-        ArrayItem.Assign(this.gltf.bufferViews);
-        ArrayItem.Assign(this.gltf.cameras);
-        ArrayItem.Assign(this.gltf.images);
-        ArrayItem.Assign(this.gltf.materials);
-        ArrayItem.Assign(this.gltf.meshes);
-        ArrayItem.Assign(this.gltf.nodes);
-        ArrayItem.Assign(this.gltf.samplers);
-        ArrayItem.Assign(this.gltf.scenes);
-        ArrayItem.Assign(this.gltf.skins);
-        ArrayItem.Assign(this.gltf.textures);
-        if (this.gltf.nodes) {
+        ArrayItem.Assign(this._gltf.accessors);
+        ArrayItem.Assign(this._gltf.animations);
+        ArrayItem.Assign(this._gltf.buffers);
+        ArrayItem.Assign(this._gltf.bufferViews);
+        ArrayItem.Assign(this._gltf.cameras);
+        ArrayItem.Assign(this._gltf.images);
+        ArrayItem.Assign(this._gltf.materials);
+        ArrayItem.Assign(this._gltf.meshes);
+        ArrayItem.Assign(this._gltf.nodes);
+        ArrayItem.Assign(this._gltf.samplers);
+        ArrayItem.Assign(this._gltf.scenes);
+        ArrayItem.Assign(this._gltf.skins);
+        ArrayItem.Assign(this._gltf.textures);
+        if (this._gltf.nodes) {
             var nodeParents = {};
-            for (var _i = 0, _a = this.gltf.nodes; _i < _a.length; _i++) {
+            for (var _i = 0, _a = this._gltf.nodes; _i < _a.length; _i++) {
                 var node = _a[_i];
                 if (node.children) {
                     for (var _b = 0, _c = node.children; _b < _c.length; _b++) {
@@ -4182,10 +4212,10 @@ var GLTFLoader = /** @class */ (function () {
                 }
             }
             var rootNode = this._createRootNode();
-            for (var _d = 0, _e = this.gltf.nodes; _d < _e.length; _d++) {
+            for (var _d = 0, _e = this._gltf.nodes; _d < _e.length; _d++) {
                 var node = _e[_d];
                 var parentIndex = nodeParents[node.index];
-                node.parent = parentIndex === undefined ? rootNode : this.gltf.nodes[parentIndex];
+                node.parent = parentIndex === undefined ? rootNode : this._gltf.nodes[parentIndex];
             }
         }
     };
@@ -4199,8 +4229,8 @@ var GLTFLoader = /** @class */ (function () {
         this._parent.onExtensionLoadedObservable.clear();
     };
     GLTFLoader.prototype._checkExtensions = function () {
-        if (this.gltf.extensionsRequired) {
-            for (var _i = 0, _a = this.gltf.extensionsRequired; _i < _a.length; _i++) {
+        if (this._gltf.extensionsRequired) {
+            for (var _i = 0, _a = this._gltf.extensionsRequired; _i < _a.length; _i++) {
                 var name_3 = _a[_i];
                 var extension = this._extensions[name_3];
                 if (!extension || !extension.enabled) {
@@ -4214,7 +4244,7 @@ var GLTFLoader = /** @class */ (function () {
         this.log(_glTFFileLoader__WEBPACK_IMPORTED_MODULE_1__["GLTFLoaderState"][this._state]);
     };
     GLTFLoader.prototype._createRootNode = function () {
-        this._rootBabylonMesh = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Mesh"]("__root__", this.babylonScene);
+        this._rootBabylonMesh = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Mesh"]("__root__", this._babylonScene);
         this._rootBabylonMesh.setEnabled(false);
         var rootNode = {
             _babylonTransformNode: this._rootBabylonMesh,
@@ -4222,7 +4252,7 @@ var GLTFLoader = /** @class */ (function () {
         };
         switch (this._parent.coordinateSystemMode) {
             case _glTFFileLoader__WEBPACK_IMPORTED_MODULE_1__["GLTFLoaderCoordinateSystemMode"].AUTO: {
-                if (!this.babylonScene.useRightHandedSystem) {
+                if (!this._babylonScene.useRightHandedSystem) {
                     rootNode.rotation = [0, 1, 0, 0];
                     rootNode.scale = [1, 1, -1];
                     GLTFLoader._LoadTransform(rootNode, this._rootBabylonMesh);
@@ -4230,7 +4260,7 @@ var GLTFLoader = /** @class */ (function () {
                 break;
             }
             case _glTFFileLoader__WEBPACK_IMPORTED_MODULE_1__["GLTFLoaderCoordinateSystemMode"].FORCE_RIGHT_HANDED: {
-                this.babylonScene.useRightHandedSystem = true;
+                this._babylonScene.useRightHandedSystem = true;
                 break;
             }
             default: {
@@ -4257,7 +4287,7 @@ var GLTFLoader = /** @class */ (function () {
         if (scene.nodes) {
             for (var _i = 0, _a = scene.nodes; _i < _a.length; _i++) {
                 var index = _a[_i];
-                var node = ArrayItem.Get(context + "/nodes/" + index, this.gltf.nodes, index);
+                var node = ArrayItem.Get(context + "/nodes/" + index, this._gltf.nodes, index);
                 promises.push(this.loadNodeAsync("/nodes/" + node.index, node, function (babylonMesh) {
                     babylonMesh.parent = _this._rootBabylonMesh;
                 }));
@@ -4265,8 +4295,8 @@ var GLTFLoader = /** @class */ (function () {
         }
         // Link all Babylon bones for each glTF node with the corresponding Babylon transform node.
         // A glTF joint is a pointer to a glTF node in the glTF node hierarchy similar to Unity3D.
-        if (this.gltf.nodes) {
-            for (var _b = 0, _c = this.gltf.nodes; _b < _c.length; _b++) {
+        if (this._gltf.nodes) {
+            for (var _b = 0, _c = this._gltf.nodes; _b < _c.length; _b++) {
                 var node = _c[_b];
                 if (node._babylonTransformNode && node._babylonBones) {
                     for (var _d = 0, _e = node._babylonBones; _d < _e.length; _d++) {
@@ -4292,7 +4322,7 @@ var GLTFLoader = /** @class */ (function () {
         var meshes = new Array();
         // Root mesh is always first.
         meshes.push(this._rootBabylonMesh);
-        var nodes = this.gltf.nodes;
+        var nodes = this._gltf.nodes;
         if (nodes) {
             for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {
                 var node = nodes_1[_i];
@@ -4305,7 +4335,7 @@ var GLTFLoader = /** @class */ (function () {
     };
     GLTFLoader.prototype._getSkeletons = function () {
         var skeletons = new Array();
-        var skins = this.gltf.skins;
+        var skins = this._gltf.skins;
         if (skins) {
             for (var _i = 0, skins_1 = skins; _i < skins_1.length; _i++) {
                 var skin = skins_1[_i];
@@ -4318,7 +4348,7 @@ var GLTFLoader = /** @class */ (function () {
     };
     GLTFLoader.prototype._getAnimationGroups = function () {
         var animationGroups = new Array();
-        var animations = this.gltf.animations;
+        var animations = this._gltf.animations;
         if (animations) {
             for (var _i = 0, animations_1 = animations; _i < animations_1.length; _i++) {
                 var animation = animations_1[_i];
@@ -4379,7 +4409,7 @@ var GLTFLoader = /** @class */ (function () {
             GLTFLoader.AddPointerMetadata(babylonTransformNode, context);
             GLTFLoader._LoadTransform(node, babylonTransformNode);
             if (node.camera != undefined) {
-                var camera = ArrayItem.Get(context + "/camera", _this.gltf.cameras, node.camera);
+                var camera = ArrayItem.Get(context + "/camera", _this._gltf.cameras, node.camera);
                 promises.push(_this.loadCameraAsync("/cameras/" + camera.index, camera, function (babylonCamera) {
                     babylonCamera.parent = babylonTransformNode;
                 }));
@@ -4387,7 +4417,7 @@ var GLTFLoader = /** @class */ (function () {
             if (node.children) {
                 for (var _i = 0, _a = node.children; _i < _a.length; _i++) {
                     var index = _a[_i];
-                    var childNode = ArrayItem.Get(context + "/children/" + index, _this.gltf.nodes, index);
+                    var childNode = ArrayItem.Get(context + "/children/" + index, _this._gltf.nodes, index);
                     promises.push(_this.loadNodeAsync("/nodes/" + childNode.index, childNode, function (childBabylonMesh) {
                         childBabylonMesh.parent = babylonTransformNode;
                     }));
@@ -4397,11 +4427,11 @@ var GLTFLoader = /** @class */ (function () {
         };
         if (node.mesh == undefined) {
             var nodeName = node.name || "node" + node.index;
-            node._babylonTransformNode = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["TransformNode"](nodeName, this.babylonScene);
+            node._babylonTransformNode = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["TransformNode"](nodeName, this._babylonScene);
             loadNode(node._babylonTransformNode);
         }
         else {
-            var mesh = ArrayItem.Get(context + "/mesh", this.gltf.meshes, node.mesh);
+            var mesh = ArrayItem.Get(context + "/mesh", this._gltf.meshes, node.mesh);
             promises.push(this._loadMeshAsync("/meshes/" + mesh.index, node, mesh, loadNode));
         }
         this.logClose();
@@ -4431,7 +4461,7 @@ var GLTFLoader = /** @class */ (function () {
             }));
         }
         else {
-            node._babylonTransformNode = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["TransformNode"](name, this.babylonScene);
+            node._babylonTransformNode = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["TransformNode"](name, this._babylonScene);
             node._primitiveBabylonMeshes = [];
             for (var _i = 0, primitives_1 = primitives; _i < primitives_1.length; _i++) {
                 var primitive = primitives_1[_i];
@@ -4442,7 +4472,7 @@ var GLTFLoader = /** @class */ (function () {
             }
         }
         if (node.skin != undefined) {
-            var skin = ArrayItem.Get(context + "/skin", this.gltf.skins, node.skin);
+            var skin = ArrayItem.Get(context + "/skin", this._gltf.skins, node.skin);
             promises.push(this._loadSkinAsync("/skins/" + skin.index, node, skin));
         }
         assign(node._babylonTransformNode);
@@ -4464,7 +4494,7 @@ var GLTFLoader = /** @class */ (function () {
         }
         else {
             var promises = new Array();
-            var babylonMesh_1 = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Mesh"](name, this.babylonScene);
+            var babylonMesh_1 = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Mesh"](name, this._babylonScene);
             this._createMorphTargets(context, node, mesh, primitive, babylonMesh_1);
             promises.push(this._loadVertexDataAsync(context, primitive, babylonMesh_1).then(function (babylonGeometry) {
                 return _this._loadMorphTargetsAsync(context, primitive, babylonMesh_1, babylonGeometry).then(function () {
@@ -4482,7 +4512,7 @@ var GLTFLoader = /** @class */ (function () {
                 babylonMesh_1.material = babylonMaterial;
             }
             else {
-                var material = ArrayItem.Get(context + "/material", this.gltf.materials, primitive.material);
+                var material = ArrayItem.Get(context + "/material", this._gltf.materials, primitive.material);
                 promises.push(this._loadMaterialAsync("/materials/" + material.index, material, babylonMesh_1, babylonDrawMode, function (babylonMaterial) {
                     babylonMesh_1.material = babylonMaterial;
                 }));
@@ -4515,12 +4545,12 @@ var GLTFLoader = /** @class */ (function () {
             throw new Error(context + ": Attributes are missing");
         }
         var promises = new Array();
-        var babylonGeometry = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Geometry"](babylonMesh.name, this.babylonScene);
+        var babylonGeometry = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Geometry"](babylonMesh.name, this._babylonScene);
         if (primitive.indices == undefined) {
             babylonMesh.isUnIndexed = true;
         }
         else {
-            var accessor = ArrayItem.Get(context + "/indices", this.gltf.accessors, primitive.indices);
+            var accessor = ArrayItem.Get(context + "/indices", this._gltf.accessors, primitive.indices);
             promises.push(this._loadIndicesAccessorAsync("/accessors/" + accessor.index, accessor).then(function (data) {
                 babylonGeometry.setIndices(data);
             }));
@@ -4533,7 +4563,7 @@ var GLTFLoader = /** @class */ (function () {
             if (babylonMesh._delayInfo.indexOf(kind) === -1) {
                 babylonMesh._delayInfo.push(kind);
             }
-            var accessor = ArrayItem.Get(context + "/attributes/" + attribute, _this.gltf.accessors, attributes[attribute]);
+            var accessor = ArrayItem.Get(context + "/attributes/" + attribute, _this._gltf.accessors, attributes[attribute]);
             promises.push(_this._loadVertexAccessorAsync("/accessors/" + accessor.index, accessor, kind).then(function (babylonVertexBuffer) {
                 babylonGeometry.setVerticesBuffer(babylonVertexBuffer, accessor.count);
             }));
@@ -4597,7 +4627,7 @@ var GLTFLoader = /** @class */ (function () {
             if (!babylonVertexBuffer) {
                 return;
             }
-            var accessor = ArrayItem.Get(context + "/" + attribute, _this.gltf.accessors, attributes[attribute]);
+            var accessor = ArrayItem.Get(context + "/" + attribute, _this._gltf.accessors, attributes[attribute]);
             promises.push(_this._loadFloatAccessorAsync("/accessors/" + accessor.index, accessor).then(function (data) {
                 setData(babylonVertexBuffer, data);
             }));
@@ -4668,7 +4698,7 @@ var GLTFLoader = /** @class */ (function () {
             return skin._data.promise;
         }
         var skeletonId = "skeleton" + skin.index;
-        var babylonSkeleton = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Skeleton"](skin.name || skeletonId, skeletonId, this.babylonScene);
+        var babylonSkeleton = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Skeleton"](skin.name || skeletonId, skeletonId, this._babylonScene);
         // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
         babylonSkeleton.overrideMesh = this._rootBabylonMesh;
         this._loadBones(context, skin, babylonSkeleton);
@@ -4686,7 +4716,7 @@ var GLTFLoader = /** @class */ (function () {
         var babylonBones = {};
         for (var _i = 0, _a = skin.joints; _i < _a.length; _i++) {
             var index = _a[_i];
-            var node = ArrayItem.Get(context + "/joints/" + index, this.gltf.nodes, index);
+            var node = ArrayItem.Get(context + "/joints/" + index, this._gltf.nodes, index);
             this._loadBone(node, skin, babylonSkeleton, babylonBones);
         }
     };
@@ -4710,7 +4740,7 @@ var GLTFLoader = /** @class */ (function () {
         if (skin.inverseBindMatrices == undefined) {
             return Promise.resolve(null);
         }
-        var accessor = ArrayItem.Get(context + "/inverseBindMatrices", this.gltf.accessors, skin.inverseBindMatrices);
+        var accessor = ArrayItem.Get(context + "/inverseBindMatrices", this._gltf.accessors, skin.inverseBindMatrices);
         return this._loadFloatAccessorAsync("/accessors/" + accessor.index, accessor);
     };
     GLTFLoader.prototype._updateBoneMatrices = function (babylonSkeleton, inverseBindMatricesData) {
@@ -4750,7 +4780,7 @@ var GLTFLoader = /** @class */ (function () {
         }
         var promises = new Array();
         this.logOpen(context + " " + (camera.name || ""));
-        var babylonCamera = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["FreeCamera"](camera.name || "camera" + camera.index, babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Zero(), this.babylonScene, false);
+        var babylonCamera = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["FreeCamera"](camera.name || "camera" + camera.index, babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Zero(), this._babylonScene, false);
         babylonCamera.rotation = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"](0, Math.PI, 0);
         switch (camera.type) {
             case "perspective" /* PERSPECTIVE */: {
@@ -4788,7 +4818,7 @@ var GLTFLoader = /** @class */ (function () {
         });
     };
     GLTFLoader.prototype._loadAnimationsAsync = function () {
-        var animations = this.gltf.animations;
+        var animations = this._gltf.animations;
         if (!animations) {
             return Promise.resolve();
         }
@@ -4810,7 +4840,7 @@ var GLTFLoader = /** @class */ (function () {
         if (promise) {
             return promise;
         }
-        var babylonAnimationGroup = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["AnimationGroup"](animation.name || "animation" + animation.index, this.babylonScene);
+        var babylonAnimationGroup = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["AnimationGroup"](animation.name || "animation" + animation.index, this._babylonScene);
         animation._babylonAnimationGroup = babylonAnimationGroup;
         var promises = new Array();
         ArrayItem.Assign(animation.channels);
@@ -4829,7 +4859,7 @@ var GLTFLoader = /** @class */ (function () {
         if (channel.target.node == undefined) {
             return Promise.resolve();
         }
-        var targetNode = ArrayItem.Get(context + "/target/node", this.gltf.nodes, channel.target.node);
+        var targetNode = ArrayItem.Get(context + "/target/node", this._gltf.nodes, channel.target.node);
         // Ignore animations that have no animation targets.
         if ((channel.target.path === "weights" /* WEIGHTS */ && !targetNode._numMorphTargets) ||
             (channel.target.path !== "weights" /* WEIGHTS */ && !targetNode._babylonTransformNode)) {
@@ -4979,8 +5009,8 @@ var GLTFLoader = /** @class */ (function () {
                 throw new Error(context + "/interpolation: Invalid value (" + sampler.interpolation + ")");
             }
         }
-        var inputAccessor = ArrayItem.Get(context + "/input", this.gltf.accessors, sampler.input);
-        var outputAccessor = ArrayItem.Get(context + "/output", this.gltf.accessors, sampler.output);
+        var inputAccessor = ArrayItem.Get(context + "/input", this._gltf.accessors, sampler.input);
+        var outputAccessor = ArrayItem.Get(context + "/output", this._gltf.accessors, sampler.output);
         sampler._data = Promise.all([
             this._loadFloatAccessorAsync("/accessors/" + inputAccessor.index, inputAccessor),
             this._loadFloatAccessorAsync("/accessors/" + outputAccessor.index, outputAccessor)
@@ -5001,7 +5031,7 @@ var GLTFLoader = /** @class */ (function () {
         if (!buffer.uri) {
             throw new Error(context + "/uri: Value is missing");
         }
-        buffer._data = this.loadUriAsync(context + "/uri", buffer.uri);
+        buffer._data = this.loadUriAsync(context + "/uri", buffer, buffer.uri);
         return buffer._data;
     };
     /**
@@ -5014,7 +5044,7 @@ var GLTFLoader = /** @class */ (function () {
         if (bufferView._data) {
             return bufferView._data;
         }
-        var buffer = ArrayItem.Get(context + "/buffer", this.gltf.buffers, bufferView.buffer);
+        var buffer = ArrayItem.Get(context + "/buffer", this._gltf.buffers, bufferView.buffer);
         bufferView._data = this._loadBufferAsync("/buffers/" + buffer.index, buffer).then(function (data) {
             try {
                 return new Uint8Array(data.buffer, data.byteOffset + (bufferView.byteOffset || 0), bufferView.byteLength);
@@ -5037,7 +5067,7 @@ var GLTFLoader = /** @class */ (function () {
         if (accessor._data) {
             return accessor._data;
         }
-        var bufferView = ArrayItem.Get(context + "/bufferView", this.gltf.bufferViews, accessor.bufferView);
+        var bufferView = ArrayItem.Get(context + "/bufferView", this._gltf.bufferViews, accessor.bufferView);
         accessor._data = this.loadBufferViewAsync("/bufferViews/" + bufferView.index, bufferView).then(function (data) {
             return GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, accessor.count);
         });
@@ -5058,7 +5088,7 @@ var GLTFLoader = /** @class */ (function () {
             accessor._data = Promise.resolve(new Float32Array(length));
         }
         else {
-            var bufferView = ArrayItem.Get(context + "/bufferView", this.gltf.bufferViews, accessor.bufferView);
+            var bufferView = ArrayItem.Get(context + "/bufferView", this._gltf.bufferViews, accessor.bufferView);
             accessor._data = this.loadBufferViewAsync("/bufferViews/" + bufferView.index, bufferView).then(function (data) {
                 return GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, length);
             });
@@ -5067,8 +5097,8 @@ var GLTFLoader = /** @class */ (function () {
             var sparse_1 = accessor.sparse;
             accessor._data = accessor._data.then(function (view) {
                 var data = view;
-                var indicesBufferView = ArrayItem.Get(context + "/sparse/indices/bufferView", _this.gltf.bufferViews, sparse_1.indices.bufferView);
-                var valuesBufferView = ArrayItem.Get(context + "/sparse/values/bufferView", _this.gltf.bufferViews, sparse_1.values.bufferView);
+                var indicesBufferView = ArrayItem.Get(context + "/sparse/indices/bufferView", _this._gltf.bufferViews, sparse_1.indices.bufferView);
+                var valuesBufferView = ArrayItem.Get(context + "/sparse/values/bufferView", _this._gltf.bufferViews, sparse_1.values.bufferView);
                 return Promise.all([
                     _this.loadBufferViewAsync("/bufferViews/" + indicesBufferView.index, indicesBufferView),
                     _this.loadBufferViewAsync("/bufferViews/" + valuesBufferView.index, valuesBufferView)
@@ -5095,7 +5125,7 @@ var GLTFLoader = /** @class */ (function () {
             return bufferView._babylonBuffer;
         }
         bufferView._babylonBuffer = this.loadBufferViewAsync("/bufferViews/" + bufferView.index, bufferView).then(function (data) {
-            return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Buffer"](_this.babylonScene.getEngine(), data, false);
+            return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Buffer"](_this._babylonScene.getEngine(), data, false);
         });
         return bufferView._babylonBuffer;
     };
@@ -5106,21 +5136,21 @@ var GLTFLoader = /** @class */ (function () {
         }
         if (accessor.sparse) {
             accessor._babylonVertexBuffer = this._loadFloatAccessorAsync("/accessors/" + accessor.index, accessor).then(function (data) {
-                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this.babylonScene.getEngine(), data, kind, false);
+                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this._babylonScene.getEngine(), data, kind, false);
             });
         }
         // HACK: If byte offset is not a multiple of component type byte length then load as a float array instead of using Babylon buffers.
         else if (accessor.byteOffset && accessor.byteOffset % babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"].GetTypeByteLength(accessor.componentType) !== 0) {
             babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Tools"].Warn("Accessor byte offset is not a multiple of component type byte length");
             accessor._babylonVertexBuffer = this._loadFloatAccessorAsync("/accessors/" + accessor.index, accessor).then(function (data) {
-                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this.babylonScene.getEngine(), data, kind, false);
+                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this._babylonScene.getEngine(), data, kind, false);
             });
         }
         else {
-            var bufferView_1 = ArrayItem.Get(context + "/bufferView", this.gltf.bufferViews, accessor.bufferView);
+            var bufferView_1 = ArrayItem.Get(context + "/bufferView", this._gltf.bufferViews, accessor.bufferView);
             accessor._babylonVertexBuffer = this._loadVertexBufferViewAsync(bufferView_1, kind).then(function (babylonBuffer) {
                 var size = GLTFLoader._GetNumComponents(context, accessor.type);
-                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this.babylonScene.getEngine(), babylonBuffer, kind, false, false, bufferView_1.byteStride, false, accessor.byteOffset, size, accessor.componentType, accessor.normalized, true);
+                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this._babylonScene.getEngine(), babylonBuffer, kind, false, false, bufferView_1.byteStride, false, accessor.byteOffset, size, accessor.componentType, accessor.normalized, true);
             });
         }
         return accessor._babylonVertexBuffer;
@@ -5193,8 +5223,8 @@ var GLTFLoader = /** @class */ (function () {
         });
     };
     GLTFLoader.prototype._createDefaultMaterial = function (name, babylonDrawMode) {
-        var babylonMaterial = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["PBRMaterial"](name, this.babylonScene);
-        babylonMaterial.sideOrientation = this.babylonScene.useRightHandedSystem ? babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Material"].CounterClockWiseSideOrientation : babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Material"].ClockWiseSideOrientation;
+        var babylonMaterial = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["PBRMaterial"](name, this._babylonScene);
+        babylonMaterial.sideOrientation = this._babylonScene.useRightHandedSystem ? babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Material"].CounterClockWiseSideOrientation : babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Material"].ClockWiseSideOrientation;
         babylonMaterial.fillMode = babylonDrawMode;
         babylonMaterial.enableSpecularAntiAliasing = true;
         babylonMaterial.useRadianceOverAlpha = !this._parent.transparencyAsCoverage;
@@ -5262,8 +5292,8 @@ var GLTFLoader = /** @class */ (function () {
                 texture.name = babylonMaterial.name + " (Normal)";
                 babylonMaterial.bumpTexture = texture;
             }));
-            babylonMaterial.invertNormalMapX = !this.babylonScene.useRightHandedSystem;
-            babylonMaterial.invertNormalMapY = this.babylonScene.useRightHandedSystem;
+            babylonMaterial.invertNormalMapX = !this._babylonScene.useRightHandedSystem;
+            babylonMaterial.invertNormalMapY = this._babylonScene.useRightHandedSystem;
             if (material.normalTexture.scale != undefined) {
                 babylonMaterial.bumpTexture.level = material.normalTexture.scale;
             }
@@ -5340,7 +5370,7 @@ var GLTFLoader = /** @class */ (function () {
             return extensionPromise;
         }
         this.logOpen("" + context);
-        var texture = ArrayItem.Get(context + "/index", this.gltf.textures, textureInfo.index);
+        var texture = ArrayItem.Get(context + "/index", this._gltf.textures, textureInfo.index);
         var promise = this._loadTextureAsync("/textures/" + textureInfo.index, texture, function (babylonTexture) {
             babylonTexture.coordinatesIndex = textureInfo.texCoord || 0;
             GLTFLoader.AddPointerMetadata(babylonTexture, context);
@@ -5355,21 +5385,21 @@ var GLTFLoader = /** @class */ (function () {
         if (assign === void 0) { assign = function () { }; }
         var promises = new Array();
         this.logOpen(context + " " + (texture.name || ""));
-        var sampler = (texture.sampler == undefined ? GLTFLoader._DefaultSampler : ArrayItem.Get(context + "/sampler", this.gltf.samplers, texture.sampler));
+        var sampler = (texture.sampler == undefined ? GLTFLoader._DefaultSampler : ArrayItem.Get(context + "/sampler", this._gltf.samplers, texture.sampler));
         var samplerData = this._loadSampler("/samplers/" + sampler.index, sampler);
-        var image = ArrayItem.Get(context + "/source", this.gltf.images, texture.source);
+        var image = ArrayItem.Get(context + "/source", this._gltf.images, texture.source);
         var url = null;
         if (image.uri) {
             if (babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Tools"].IsBase64(image.uri)) {
                 url = image.uri;
             }
-            else if (this.babylonScene.getEngine().textureFormatInUse) {
+            else if (this._babylonScene.getEngine().textureFormatInUse) {
                 // If an image uri and a texture format is set like (eg. KTX) load from url instead of blob to support texture format and fallback
                 url = this._rootUrl + image.uri;
             }
         }
         var deferred = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Deferred"]();
-        var babylonTexture = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Texture"](url, this.babylonScene, samplerData.noMipMaps, false, samplerData.samplingMode, function () {
+        var babylonTexture = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Texture"](url, this._babylonScene, samplerData.noMipMaps, false, samplerData.samplingMode, function () {
             if (!_this._disposed) {
                 deferred.resolve();
             }
@@ -5415,10 +5445,10 @@ var GLTFLoader = /** @class */ (function () {
         if (!image._data) {
             this.logOpen(context + " " + (image.name || ""));
             if (image.uri) {
-                image._data = this.loadUriAsync(context + "/uri", image.uri);
+                image._data = this.loadUriAsync(context + "/uri", image, image.uri);
             }
             else {
-                var bufferView = ArrayItem.Get(context + "/bufferView", this.gltf.bufferViews, image.bufferView);
+                var bufferView = ArrayItem.Get(context + "/bufferView", this._gltf.bufferViews, image.bufferView);
                 image._data = this.loadBufferViewAsync("/bufferViews/" + bufferView.index, bufferView);
             }
             this.logClose();
@@ -5428,12 +5458,13 @@ var GLTFLoader = /** @class */ (function () {
     /**
      * Loads a glTF uri.
      * @param context The context when loading the asset
+     * @param property The glTF property associated with the uri
      * @param uri The base64 or relative uri
      * @returns A promise that resolves with the loaded data when the load is complete
      */
-    GLTFLoader.prototype.loadUriAsync = function (context, uri) {
+    GLTFLoader.prototype.loadUriAsync = function (context, property, uri) {
         var _this = this;
-        var extensionPromise = this._extensionsLoadUriAsync(context, uri);
+        var extensionPromise = this._extensionsLoadUriAsync(context, property, uri);
         if (extensionPromise) {
             return extensionPromise;
         }
@@ -5471,7 +5502,7 @@ var GLTFLoader = /** @class */ (function () {
                                 }
                             }
                         }
-                    }, _this.babylonScene.offlineProvider, true, function (request, exception) {
+                    }, _this._babylonScene.offlineProvider, true, function (request, exception) {
                         if (!_this._disposed) {
                             reject(new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["LoadFileError"](context + ": Failed to load '" + uri + "'" + (request ? ": " + request.status + " " + request.statusText : ""), request));
                         }
@@ -5608,8 +5639,8 @@ var GLTFLoader = /** @class */ (function () {
         var _this = this;
         this._parent._startPerformanceCounter("Compile materials");
         var promises = new Array();
-        if (this.gltf.materials) {
-            for (var _i = 0, _a = this.gltf.materials; _i < _a.length; _i++) {
+        if (this._gltf.materials) {
+            for (var _i = 0, _a = this._gltf.materials; _i < _a.length; _i++) {
                 var material = _a[_i];
                 if (material._data) {
                     for (var babylonDrawMode in material._data) {
@@ -5636,7 +5667,7 @@ var GLTFLoader = /** @class */ (function () {
         var _this = this;
         this._parent._startPerformanceCounter("Compile shadow generators");
         var promises = new Array();
-        var lights = this.babylonScene.lights;
+        var lights = this._babylonScene.lights;
         for (var _i = 0, lights_1 = lights; _i < lights_1.length; _i++) {
             var light = lights_1[_i];
             var generator = light.getShadowGenerator();
@@ -5657,16 +5688,17 @@ var GLTFLoader = /** @class */ (function () {
             }
         }
     };
-    GLTFLoader.prototype._applyExtensions = function (property, actionAsync) {
+    GLTFLoader.prototype._applyExtensions = function (property, functionName, actionAsync) {
         for (var _i = 0, _a = GLTFLoader._ExtensionNames; _i < _a.length; _i++) {
             var name_5 = _a[_i];
             var extension = this._extensions[name_5];
             if (extension.enabled) {
+                var id = name_5 + "." + functionName;
                 var loaderProperty = property;
-                loaderProperty._activeLoaderExtensions = loaderProperty._activeLoaderExtensions || {};
-                var activeLoaderExtensions = loaderProperty._activeLoaderExtensions;
-                if (!activeLoaderExtensions[name_5]) {
-                    activeLoaderExtensions[name_5] = true;
+                loaderProperty._activeLoaderExtensionFunctions = loaderProperty._activeLoaderExtensionFunctions || {};
+                var activeLoaderExtensionFunctions = loaderProperty._activeLoaderExtensionFunctions;
+                if (!activeLoaderExtensionFunctions[id]) {
+                    activeLoaderExtensionFunctions[id] = true;
                     try {
                         var result = actionAsync(extension);
                         if (result) {
@@ -5674,7 +5706,7 @@ var GLTFLoader = /** @class */ (function () {
                         }
                     }
                     finally {
-                        delete activeLoaderExtensions[name_5];
+                        delete activeLoaderExtensionFunctions[id];
                     }
                 }
             }
@@ -5688,34 +5720,34 @@ var GLTFLoader = /** @class */ (function () {
         this._forEachExtensions(function (extension) { return extension.onReady && extension.onReady(); });
     };
     GLTFLoader.prototype._extensionsLoadSceneAsync = function (context, scene) {
-        return this._applyExtensions(scene, function (extension) { return extension.loadSceneAsync && extension.loadSceneAsync(context, scene); });
+        return this._applyExtensions(scene, "loadScene", function (extension) { return extension.loadSceneAsync && extension.loadSceneAsync(context, scene); });
     };
     GLTFLoader.prototype._extensionsLoadNodeAsync = function (context, node, assign) {
-        return this._applyExtensions(node, function (extension) { return extension.loadNodeAsync && extension.loadNodeAsync(context, node, assign); });
+        return this._applyExtensions(node, "loadNode", function (extension) { return extension.loadNodeAsync && extension.loadNodeAsync(context, node, assign); });
     };
     GLTFLoader.prototype._extensionsLoadCameraAsync = function (context, camera, assign) {
-        return this._applyExtensions(camera, function (extension) { return extension.loadCameraAsync && extension.loadCameraAsync(context, camera, assign); });
+        return this._applyExtensions(camera, "loadCamera", function (extension) { return extension.loadCameraAsync && extension.loadCameraAsync(context, camera, assign); });
     };
     GLTFLoader.prototype._extensionsLoadVertexDataAsync = function (context, primitive, babylonMesh) {
-        return this._applyExtensions(primitive, function (extension) { return extension._loadVertexDataAsync && extension._loadVertexDataAsync(context, primitive, babylonMesh); });
+        return this._applyExtensions(primitive, "loadVertexData", function (extension) { return extension._loadVertexDataAsync && extension._loadVertexDataAsync(context, primitive, babylonMesh); });
     };
     GLTFLoader.prototype._extensionsLoadMaterialAsync = function (context, material, babylonMesh, babylonDrawMode, assign) {
-        return this._applyExtensions(material, function (extension) { return extension._loadMaterialAsync && extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign); });
+        return this._applyExtensions(material, "loadMaterial", function (extension) { return extension._loadMaterialAsync && extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign); });
     };
     GLTFLoader.prototype._extensionsCreateMaterial = function (context, material, babylonDrawMode) {
-        return this._applyExtensions({}, function (extension) { return extension.createMaterial && extension.createMaterial(context, material, babylonDrawMode); });
+        return this._applyExtensions(material, "createMaterial", function (extension) { return extension.createMaterial && extension.createMaterial(context, material, babylonDrawMode); });
     };
     GLTFLoader.prototype._extensionsLoadMaterialPropertiesAsync = function (context, material, babylonMaterial) {
-        return this._applyExtensions(material, function (extension) { return extension.loadMaterialPropertiesAsync && extension.loadMaterialPropertiesAsync(context, material, babylonMaterial); });
+        return this._applyExtensions(material, "loadMaterialProperties", function (extension) { return extension.loadMaterialPropertiesAsync && extension.loadMaterialPropertiesAsync(context, material, babylonMaterial); });
     };
     GLTFLoader.prototype._extensionsLoadTextureInfoAsync = function (context, textureInfo, assign) {
-        return this._applyExtensions(textureInfo, function (extension) { return extension.loadTextureInfoAsync && extension.loadTextureInfoAsync(context, textureInfo, assign); });
+        return this._applyExtensions(textureInfo, "loadTextureInfo", function (extension) { return extension.loadTextureInfoAsync && extension.loadTextureInfoAsync(context, textureInfo, assign); });
     };
     GLTFLoader.prototype._extensionsLoadAnimationAsync = function (context, animation) {
-        return this._applyExtensions(animation, function (extension) { return extension.loadAnimationAsync && extension.loadAnimationAsync(context, animation); });
+        return this._applyExtensions(animation, "loadAnimation", function (extension) { return extension.loadAnimationAsync && extension.loadAnimationAsync(context, animation); });
     };
-    GLTFLoader.prototype._extensionsLoadUriAsync = function (context, uri) {
-        return this._applyExtensions({}, function (extension) { return extension._loadUriAsync && extension._loadUriAsync(context, uri); });
+    GLTFLoader.prototype._extensionsLoadUriAsync = function (context, property, uri) {
+        return this._applyExtensions(property, "loadUri", function (extension) { return extension._loadUriAsync && extension._loadUriAsync(context, property, uri); });
     };
     /**
      * Helper method called by a loader extension to load an glTF extension.

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.js.map


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/preview release/loaders/babylon.glTFFileLoader.min.js


+ 19 - 7
dist/preview release/loaders/babylonjs.loaders.d.ts

@@ -1221,10 +1221,11 @@ declare module BABYLON.GLTF2 {
         /**
          * Define this method to modify the default behavior when loading uris.
          * @param context The context when loading the asset
+         * @param property The glTF property associated with the uri
          * @param uri The uri to load
          * @returns A promise that resolves with the loaded data when the load is complete or null if not handled
          */
-        _loadUriAsync?(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
+        _loadUriAsync?(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>>;
     }
 }
 declare module BABYLON.GLTF2 {
@@ -1250,10 +1251,6 @@ declare module BABYLON.GLTF2 {
      * The glTF 2.0 loader
      */
     export class GLTFLoader implements IGLTFLoader {
-        /** The glTF object parsed from the JSON. */
-        gltf: IGLTF;
-        /** The Babylon scene when loading the asset. */
-        babylonScene: Scene;
         /** @hidden */
         _completePromises: Promise<any>[];
         private _disposed;
@@ -1263,6 +1260,8 @@ declare module BABYLON.GLTF2 {
         private _rootUrl;
         private _fileName;
         private _uniqueRootUrl;
+        private _gltf;
+        private _babylonScene;
         private _rootBabylonMesh;
         private _defaultBabylonMaterialData;
         private _progressCallback?;
@@ -1286,6 +1285,18 @@ declare module BABYLON.GLTF2 {
          * Gets the loader state.
          */
         readonly state: Nullable<GLTFLoaderState>;
+        /**
+         * The glTF object parsed from the JSON.
+         */
+        readonly gltf: IGLTF;
+        /**
+         * The Babylon scene when loading the asset.
+         */
+        readonly babylonScene: Scene;
+        /**
+         * The root Babylon mesh when loading the asset.
+         */
+        readonly rootBabylonMesh: Mesh;
         /** @hidden */
         constructor(parent: GLTFFileLoader);
         /** @hidden */
@@ -1425,10 +1436,11 @@ declare module BABYLON.GLTF2 {
         /**
          * Loads a glTF uri.
          * @param context The context when loading the asset
+         * @param property The glTF property associated with the uri
          * @param uri The base64 or relative uri
          * @returns A promise that resolves with the loaded data when the load is complete
          */
-        loadUriAsync(context: string, uri: string): Promise<ArrayBufferView>;
+        loadUriAsync(context: string, property: IProperty, uri: string): Promise<ArrayBufferView>;
         private _onProgress;
         /**
          * Adds a JSON pointer to the metadata of the Babylon object at `<object>.metadata.gltf.pointers`.
@@ -1695,7 +1707,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
         /** @hidden */
         _loadMaterialAsync(context: string, material: IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
         /** @hidden */
-        _loadUriAsync(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
+        _loadUriAsync(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>>;
         /**
          * Gets an array of LOD properties from lowest to highest.
          */

+ 140 - 108
dist/preview release/loaders/babylonjs.loaders.js

@@ -4660,7 +4660,7 @@ var MSFT_audio_emitter = /** @class */ (function () {
         }
         var promise;
         if (clip.uri) {
-            promise = this._loader.loadUriAsync(context, clip.uri);
+            promise = this._loader.loadUriAsync(context, clip, clip.uri);
         }
         else {
             var bufferView = _glTFLoader__WEBPACK_IMPORTED_MODULE_1__["ArrayItem"].Get(context + "/bufferView", this._loader.gltf.bufferViews, clip.bufferView);
@@ -4971,7 +4971,7 @@ var MSFT_lod = /** @class */ (function () {
         });
     };
     /** @hidden */
-    MSFT_lod.prototype._loadUriAsync = function (context, uri) {
+    MSFT_lod.prototype._loadUriAsync = function (context, property, uri) {
         var _this = this;
         // Defer the loading of uris if loading a material or node LOD.
         if (this._materialIndexLOD !== null) {
@@ -4979,7 +4979,7 @@ var MSFT_lod = /** @class */ (function () {
             var previousIndexLOD = this._materialIndexLOD - 1;
             this._materialSignalLODs[previousIndexLOD] = this._materialSignalLODs[previousIndexLOD] || new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Deferred"]();
             return this._materialSignalLODs[previousIndexLOD].promise.then(function () {
-                return _this._loader.loadUriAsync(context, uri);
+                return _this._loader.loadUriAsync(context, property, uri);
             });
         }
         else if (this._nodeIndexLOD !== null) {
@@ -4987,7 +4987,7 @@ var MSFT_lod = /** @class */ (function () {
             var previousIndexLOD = this._nodeIndexLOD - 1;
             this._nodeSignalLODs[previousIndexLOD] = this._nodeSignalLODs[previousIndexLOD] || new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Deferred"]();
             return this._nodeSignalLODs[this._nodeIndexLOD - 1].promise.then(function () {
-                return _this._loader.loadUriAsync(context, uri);
+                return _this._loader.loadUriAsync(context, property, uri);
             });
         }
         return null;
@@ -5316,6 +5316,36 @@ var GLTFLoader = /** @class */ (function () {
         enumerable: true,
         configurable: true
     });
+    Object.defineProperty(GLTFLoader.prototype, "gltf", {
+        /**
+         * The glTF object parsed from the JSON.
+         */
+        get: function () {
+            return this._gltf;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(GLTFLoader.prototype, "babylonScene", {
+        /**
+         * The Babylon scene when loading the asset.
+         */
+        get: function () {
+            return this._babylonScene;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(GLTFLoader.prototype, "rootBabylonMesh", {
+        /**
+         * The root Babylon mesh when loading the asset.
+         */
+        get: function () {
+            return this._rootBabylonMesh;
+        },
+        enumerable: true,
+        configurable: true
+    });
     /** @hidden */
     GLTFLoader.prototype.dispose = function () {
         if (this._disposed) {
@@ -5327,8 +5357,6 @@ var GLTFLoader = /** @class */ (function () {
             request.abort();
         }
         this._requests.length = 0;
-        delete this.gltf;
-        delete this.babylonScene;
         this._completePromises.length = 0;
         for (var name_1 in this._extensions) {
             var extension = this._extensions[name_1];
@@ -5337,6 +5365,8 @@ var GLTFLoader = /** @class */ (function () {
             }
         }
         this._extensions = {};
+        delete this._gltf;
+        delete this._babylonScene;
         delete this._rootBabylonMesh;
         delete this._progressCallback;
         this._parent._clear();
@@ -5345,7 +5375,7 @@ var GLTFLoader = /** @class */ (function () {
     GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress, fileName) {
         var _this = this;
         return Promise.resolve().then(function () {
-            _this.babylonScene = scene;
+            _this._babylonScene = scene;
             _this._rootUrl = rootUrl;
             _this._fileName = fileName || "scene";
             _this._progressCallback = onProgress;
@@ -5353,8 +5383,8 @@ var GLTFLoader = /** @class */ (function () {
             var nodes = null;
             if (meshesNames) {
                 var nodeMap_1 = {};
-                if (_this.gltf.nodes) {
-                    for (var _i = 0, _a = _this.gltf.nodes; _i < _a.length; _i++) {
+                if (_this._gltf.nodes) {
+                    for (var _i = 0, _a = _this._gltf.nodes; _i < _a.length; _i++) {
                         var node = _a[_i];
                         if (node.name) {
                             nodeMap_1[node.name] = node.index;
@@ -5384,7 +5414,7 @@ var GLTFLoader = /** @class */ (function () {
     GLTFLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress, fileName) {
         var _this = this;
         return Promise.resolve().then(function () {
-            _this.babylonScene = scene;
+            _this._babylonScene = scene;
             _this._rootUrl = rootUrl;
             _this._fileName = fileName || "scene";
             _this._progressCallback = onProgress;
@@ -5408,8 +5438,8 @@ var GLTFLoader = /** @class */ (function () {
             if (nodes) {
                 promises.push(_this.loadSceneAsync("/nodes", { nodes: nodes, index: -1 }));
             }
-            else if (_this.gltf.scene != undefined) {
-                var scene = ArrayItem.Get("/scene", _this.gltf.scenes, _this.gltf.scene);
+            else if (_this._gltf.scene != undefined) {
+                var scene = ArrayItem.Get("/scene", _this._gltf.scenes, _this._gltf.scene);
                 promises.push(_this.loadSceneAsync("/scenes/" + scene.index, scene));
             }
             if (_this._parent.compileMaterials) {
@@ -5456,10 +5486,10 @@ var GLTFLoader = /** @class */ (function () {
         });
     };
     GLTFLoader.prototype._loadData = function (data) {
-        this.gltf = data.json;
+        this._gltf = data.json;
         this._setupData();
         if (data.bin) {
-            var buffers = this.gltf.buffers;
+            var buffers = this._gltf.buffers;
             if (buffers && buffers[0] && !buffers[0].uri) {
                 var binaryBuffer = buffers[0];
                 if (binaryBuffer.byteLength < data.bin.byteLength - 3 || binaryBuffer.byteLength > data.bin.byteLength) {
@@ -5473,22 +5503,22 @@ var GLTFLoader = /** @class */ (function () {
         }
     };
     GLTFLoader.prototype._setupData = function () {
-        ArrayItem.Assign(this.gltf.accessors);
-        ArrayItem.Assign(this.gltf.animations);
-        ArrayItem.Assign(this.gltf.buffers);
-        ArrayItem.Assign(this.gltf.bufferViews);
-        ArrayItem.Assign(this.gltf.cameras);
-        ArrayItem.Assign(this.gltf.images);
-        ArrayItem.Assign(this.gltf.materials);
-        ArrayItem.Assign(this.gltf.meshes);
-        ArrayItem.Assign(this.gltf.nodes);
-        ArrayItem.Assign(this.gltf.samplers);
-        ArrayItem.Assign(this.gltf.scenes);
-        ArrayItem.Assign(this.gltf.skins);
-        ArrayItem.Assign(this.gltf.textures);
-        if (this.gltf.nodes) {
+        ArrayItem.Assign(this._gltf.accessors);
+        ArrayItem.Assign(this._gltf.animations);
+        ArrayItem.Assign(this._gltf.buffers);
+        ArrayItem.Assign(this._gltf.bufferViews);
+        ArrayItem.Assign(this._gltf.cameras);
+        ArrayItem.Assign(this._gltf.images);
+        ArrayItem.Assign(this._gltf.materials);
+        ArrayItem.Assign(this._gltf.meshes);
+        ArrayItem.Assign(this._gltf.nodes);
+        ArrayItem.Assign(this._gltf.samplers);
+        ArrayItem.Assign(this._gltf.scenes);
+        ArrayItem.Assign(this._gltf.skins);
+        ArrayItem.Assign(this._gltf.textures);
+        if (this._gltf.nodes) {
             var nodeParents = {};
-            for (var _i = 0, _a = this.gltf.nodes; _i < _a.length; _i++) {
+            for (var _i = 0, _a = this._gltf.nodes; _i < _a.length; _i++) {
                 var node = _a[_i];
                 if (node.children) {
                     for (var _b = 0, _c = node.children; _b < _c.length; _b++) {
@@ -5498,10 +5528,10 @@ var GLTFLoader = /** @class */ (function () {
                 }
             }
             var rootNode = this._createRootNode();
-            for (var _d = 0, _e = this.gltf.nodes; _d < _e.length; _d++) {
+            for (var _d = 0, _e = this._gltf.nodes; _d < _e.length; _d++) {
                 var node = _e[_d];
                 var parentIndex = nodeParents[node.index];
-                node.parent = parentIndex === undefined ? rootNode : this.gltf.nodes[parentIndex];
+                node.parent = parentIndex === undefined ? rootNode : this._gltf.nodes[parentIndex];
             }
         }
     };
@@ -5515,8 +5545,8 @@ var GLTFLoader = /** @class */ (function () {
         this._parent.onExtensionLoadedObservable.clear();
     };
     GLTFLoader.prototype._checkExtensions = function () {
-        if (this.gltf.extensionsRequired) {
-            for (var _i = 0, _a = this.gltf.extensionsRequired; _i < _a.length; _i++) {
+        if (this._gltf.extensionsRequired) {
+            for (var _i = 0, _a = this._gltf.extensionsRequired; _i < _a.length; _i++) {
                 var name_3 = _a[_i];
                 var extension = this._extensions[name_3];
                 if (!extension || !extension.enabled) {
@@ -5530,7 +5560,7 @@ var GLTFLoader = /** @class */ (function () {
         this.log(_glTFFileLoader__WEBPACK_IMPORTED_MODULE_1__["GLTFLoaderState"][this._state]);
     };
     GLTFLoader.prototype._createRootNode = function () {
-        this._rootBabylonMesh = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Mesh"]("__root__", this.babylonScene);
+        this._rootBabylonMesh = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Mesh"]("__root__", this._babylonScene);
         this._rootBabylonMesh.setEnabled(false);
         var rootNode = {
             _babylonTransformNode: this._rootBabylonMesh,
@@ -5538,7 +5568,7 @@ var GLTFLoader = /** @class */ (function () {
         };
         switch (this._parent.coordinateSystemMode) {
             case _glTFFileLoader__WEBPACK_IMPORTED_MODULE_1__["GLTFLoaderCoordinateSystemMode"].AUTO: {
-                if (!this.babylonScene.useRightHandedSystem) {
+                if (!this._babylonScene.useRightHandedSystem) {
                     rootNode.rotation = [0, 1, 0, 0];
                     rootNode.scale = [1, 1, -1];
                     GLTFLoader._LoadTransform(rootNode, this._rootBabylonMesh);
@@ -5546,7 +5576,7 @@ var GLTFLoader = /** @class */ (function () {
                 break;
             }
             case _glTFFileLoader__WEBPACK_IMPORTED_MODULE_1__["GLTFLoaderCoordinateSystemMode"].FORCE_RIGHT_HANDED: {
-                this.babylonScene.useRightHandedSystem = true;
+                this._babylonScene.useRightHandedSystem = true;
                 break;
             }
             default: {
@@ -5573,7 +5603,7 @@ var GLTFLoader = /** @class */ (function () {
         if (scene.nodes) {
             for (var _i = 0, _a = scene.nodes; _i < _a.length; _i++) {
                 var index = _a[_i];
-                var node = ArrayItem.Get(context + "/nodes/" + index, this.gltf.nodes, index);
+                var node = ArrayItem.Get(context + "/nodes/" + index, this._gltf.nodes, index);
                 promises.push(this.loadNodeAsync("/nodes/" + node.index, node, function (babylonMesh) {
                     babylonMesh.parent = _this._rootBabylonMesh;
                 }));
@@ -5581,8 +5611,8 @@ var GLTFLoader = /** @class */ (function () {
         }
         // Link all Babylon bones for each glTF node with the corresponding Babylon transform node.
         // A glTF joint is a pointer to a glTF node in the glTF node hierarchy similar to Unity3D.
-        if (this.gltf.nodes) {
-            for (var _b = 0, _c = this.gltf.nodes; _b < _c.length; _b++) {
+        if (this._gltf.nodes) {
+            for (var _b = 0, _c = this._gltf.nodes; _b < _c.length; _b++) {
                 var node = _c[_b];
                 if (node._babylonTransformNode && node._babylonBones) {
                     for (var _d = 0, _e = node._babylonBones; _d < _e.length; _d++) {
@@ -5608,7 +5638,7 @@ var GLTFLoader = /** @class */ (function () {
         var meshes = new Array();
         // Root mesh is always first.
         meshes.push(this._rootBabylonMesh);
-        var nodes = this.gltf.nodes;
+        var nodes = this._gltf.nodes;
         if (nodes) {
             for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {
                 var node = nodes_1[_i];
@@ -5621,7 +5651,7 @@ var GLTFLoader = /** @class */ (function () {
     };
     GLTFLoader.prototype._getSkeletons = function () {
         var skeletons = new Array();
-        var skins = this.gltf.skins;
+        var skins = this._gltf.skins;
         if (skins) {
             for (var _i = 0, skins_1 = skins; _i < skins_1.length; _i++) {
                 var skin = skins_1[_i];
@@ -5634,7 +5664,7 @@ var GLTFLoader = /** @class */ (function () {
     };
     GLTFLoader.prototype._getAnimationGroups = function () {
         var animationGroups = new Array();
-        var animations = this.gltf.animations;
+        var animations = this._gltf.animations;
         if (animations) {
             for (var _i = 0, animations_1 = animations; _i < animations_1.length; _i++) {
                 var animation = animations_1[_i];
@@ -5695,7 +5725,7 @@ var GLTFLoader = /** @class */ (function () {
             GLTFLoader.AddPointerMetadata(babylonTransformNode, context);
             GLTFLoader._LoadTransform(node, babylonTransformNode);
             if (node.camera != undefined) {
-                var camera = ArrayItem.Get(context + "/camera", _this.gltf.cameras, node.camera);
+                var camera = ArrayItem.Get(context + "/camera", _this._gltf.cameras, node.camera);
                 promises.push(_this.loadCameraAsync("/cameras/" + camera.index, camera, function (babylonCamera) {
                     babylonCamera.parent = babylonTransformNode;
                 }));
@@ -5703,7 +5733,7 @@ var GLTFLoader = /** @class */ (function () {
             if (node.children) {
                 for (var _i = 0, _a = node.children; _i < _a.length; _i++) {
                     var index = _a[_i];
-                    var childNode = ArrayItem.Get(context + "/children/" + index, _this.gltf.nodes, index);
+                    var childNode = ArrayItem.Get(context + "/children/" + index, _this._gltf.nodes, index);
                     promises.push(_this.loadNodeAsync("/nodes/" + childNode.index, childNode, function (childBabylonMesh) {
                         childBabylonMesh.parent = babylonTransformNode;
                     }));
@@ -5713,11 +5743,11 @@ var GLTFLoader = /** @class */ (function () {
         };
         if (node.mesh == undefined) {
             var nodeName = node.name || "node" + node.index;
-            node._babylonTransformNode = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["TransformNode"](nodeName, this.babylonScene);
+            node._babylonTransformNode = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["TransformNode"](nodeName, this._babylonScene);
             loadNode(node._babylonTransformNode);
         }
         else {
-            var mesh = ArrayItem.Get(context + "/mesh", this.gltf.meshes, node.mesh);
+            var mesh = ArrayItem.Get(context + "/mesh", this._gltf.meshes, node.mesh);
             promises.push(this._loadMeshAsync("/meshes/" + mesh.index, node, mesh, loadNode));
         }
         this.logClose();
@@ -5747,7 +5777,7 @@ var GLTFLoader = /** @class */ (function () {
             }));
         }
         else {
-            node._babylonTransformNode = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["TransformNode"](name, this.babylonScene);
+            node._babylonTransformNode = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["TransformNode"](name, this._babylonScene);
             node._primitiveBabylonMeshes = [];
             for (var _i = 0, primitives_1 = primitives; _i < primitives_1.length; _i++) {
                 var primitive = primitives_1[_i];
@@ -5758,7 +5788,7 @@ var GLTFLoader = /** @class */ (function () {
             }
         }
         if (node.skin != undefined) {
-            var skin = ArrayItem.Get(context + "/skin", this.gltf.skins, node.skin);
+            var skin = ArrayItem.Get(context + "/skin", this._gltf.skins, node.skin);
             promises.push(this._loadSkinAsync("/skins/" + skin.index, node, skin));
         }
         assign(node._babylonTransformNode);
@@ -5780,7 +5810,7 @@ var GLTFLoader = /** @class */ (function () {
         }
         else {
             var promises = new Array();
-            var babylonMesh_1 = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Mesh"](name, this.babylonScene);
+            var babylonMesh_1 = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Mesh"](name, this._babylonScene);
             this._createMorphTargets(context, node, mesh, primitive, babylonMesh_1);
             promises.push(this._loadVertexDataAsync(context, primitive, babylonMesh_1).then(function (babylonGeometry) {
                 return _this._loadMorphTargetsAsync(context, primitive, babylonMesh_1, babylonGeometry).then(function () {
@@ -5798,7 +5828,7 @@ var GLTFLoader = /** @class */ (function () {
                 babylonMesh_1.material = babylonMaterial;
             }
             else {
-                var material = ArrayItem.Get(context + "/material", this.gltf.materials, primitive.material);
+                var material = ArrayItem.Get(context + "/material", this._gltf.materials, primitive.material);
                 promises.push(this._loadMaterialAsync("/materials/" + material.index, material, babylonMesh_1, babylonDrawMode, function (babylonMaterial) {
                     babylonMesh_1.material = babylonMaterial;
                 }));
@@ -5831,12 +5861,12 @@ var GLTFLoader = /** @class */ (function () {
             throw new Error(context + ": Attributes are missing");
         }
         var promises = new Array();
-        var babylonGeometry = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Geometry"](babylonMesh.name, this.babylonScene);
+        var babylonGeometry = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Geometry"](babylonMesh.name, this._babylonScene);
         if (primitive.indices == undefined) {
             babylonMesh.isUnIndexed = true;
         }
         else {
-            var accessor = ArrayItem.Get(context + "/indices", this.gltf.accessors, primitive.indices);
+            var accessor = ArrayItem.Get(context + "/indices", this._gltf.accessors, primitive.indices);
             promises.push(this._loadIndicesAccessorAsync("/accessors/" + accessor.index, accessor).then(function (data) {
                 babylonGeometry.setIndices(data);
             }));
@@ -5849,7 +5879,7 @@ var GLTFLoader = /** @class */ (function () {
             if (babylonMesh._delayInfo.indexOf(kind) === -1) {
                 babylonMesh._delayInfo.push(kind);
             }
-            var accessor = ArrayItem.Get(context + "/attributes/" + attribute, _this.gltf.accessors, attributes[attribute]);
+            var accessor = ArrayItem.Get(context + "/attributes/" + attribute, _this._gltf.accessors, attributes[attribute]);
             promises.push(_this._loadVertexAccessorAsync("/accessors/" + accessor.index, accessor, kind).then(function (babylonVertexBuffer) {
                 babylonGeometry.setVerticesBuffer(babylonVertexBuffer, accessor.count);
             }));
@@ -5913,7 +5943,7 @@ var GLTFLoader = /** @class */ (function () {
             if (!babylonVertexBuffer) {
                 return;
             }
-            var accessor = ArrayItem.Get(context + "/" + attribute, _this.gltf.accessors, attributes[attribute]);
+            var accessor = ArrayItem.Get(context + "/" + attribute, _this._gltf.accessors, attributes[attribute]);
             promises.push(_this._loadFloatAccessorAsync("/accessors/" + accessor.index, accessor).then(function (data) {
                 setData(babylonVertexBuffer, data);
             }));
@@ -5984,7 +6014,7 @@ var GLTFLoader = /** @class */ (function () {
             return skin._data.promise;
         }
         var skeletonId = "skeleton" + skin.index;
-        var babylonSkeleton = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Skeleton"](skin.name || skeletonId, skeletonId, this.babylonScene);
+        var babylonSkeleton = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Skeleton"](skin.name || skeletonId, skeletonId, this._babylonScene);
         // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
         babylonSkeleton.overrideMesh = this._rootBabylonMesh;
         this._loadBones(context, skin, babylonSkeleton);
@@ -6002,7 +6032,7 @@ var GLTFLoader = /** @class */ (function () {
         var babylonBones = {};
         for (var _i = 0, _a = skin.joints; _i < _a.length; _i++) {
             var index = _a[_i];
-            var node = ArrayItem.Get(context + "/joints/" + index, this.gltf.nodes, index);
+            var node = ArrayItem.Get(context + "/joints/" + index, this._gltf.nodes, index);
             this._loadBone(node, skin, babylonSkeleton, babylonBones);
         }
     };
@@ -6026,7 +6056,7 @@ var GLTFLoader = /** @class */ (function () {
         if (skin.inverseBindMatrices == undefined) {
             return Promise.resolve(null);
         }
-        var accessor = ArrayItem.Get(context + "/inverseBindMatrices", this.gltf.accessors, skin.inverseBindMatrices);
+        var accessor = ArrayItem.Get(context + "/inverseBindMatrices", this._gltf.accessors, skin.inverseBindMatrices);
         return this._loadFloatAccessorAsync("/accessors/" + accessor.index, accessor);
     };
     GLTFLoader.prototype._updateBoneMatrices = function (babylonSkeleton, inverseBindMatricesData) {
@@ -6066,7 +6096,7 @@ var GLTFLoader = /** @class */ (function () {
         }
         var promises = new Array();
         this.logOpen(context + " " + (camera.name || ""));
-        var babylonCamera = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["FreeCamera"](camera.name || "camera" + camera.index, babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Zero(), this.babylonScene, false);
+        var babylonCamera = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["FreeCamera"](camera.name || "camera" + camera.index, babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Zero(), this._babylonScene, false);
         babylonCamera.rotation = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"](0, Math.PI, 0);
         switch (camera.type) {
             case "perspective" /* PERSPECTIVE */: {
@@ -6104,7 +6134,7 @@ var GLTFLoader = /** @class */ (function () {
         });
     };
     GLTFLoader.prototype._loadAnimationsAsync = function () {
-        var animations = this.gltf.animations;
+        var animations = this._gltf.animations;
         if (!animations) {
             return Promise.resolve();
         }
@@ -6126,7 +6156,7 @@ var GLTFLoader = /** @class */ (function () {
         if (promise) {
             return promise;
         }
-        var babylonAnimationGroup = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["AnimationGroup"](animation.name || "animation" + animation.index, this.babylonScene);
+        var babylonAnimationGroup = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["AnimationGroup"](animation.name || "animation" + animation.index, this._babylonScene);
         animation._babylonAnimationGroup = babylonAnimationGroup;
         var promises = new Array();
         ArrayItem.Assign(animation.channels);
@@ -6145,7 +6175,7 @@ var GLTFLoader = /** @class */ (function () {
         if (channel.target.node == undefined) {
             return Promise.resolve();
         }
-        var targetNode = ArrayItem.Get(context + "/target/node", this.gltf.nodes, channel.target.node);
+        var targetNode = ArrayItem.Get(context + "/target/node", this._gltf.nodes, channel.target.node);
         // Ignore animations that have no animation targets.
         if ((channel.target.path === "weights" /* WEIGHTS */ && !targetNode._numMorphTargets) ||
             (channel.target.path !== "weights" /* WEIGHTS */ && !targetNode._babylonTransformNode)) {
@@ -6295,8 +6325,8 @@ var GLTFLoader = /** @class */ (function () {
                 throw new Error(context + "/interpolation: Invalid value (" + sampler.interpolation + ")");
             }
         }
-        var inputAccessor = ArrayItem.Get(context + "/input", this.gltf.accessors, sampler.input);
-        var outputAccessor = ArrayItem.Get(context + "/output", this.gltf.accessors, sampler.output);
+        var inputAccessor = ArrayItem.Get(context + "/input", this._gltf.accessors, sampler.input);
+        var outputAccessor = ArrayItem.Get(context + "/output", this._gltf.accessors, sampler.output);
         sampler._data = Promise.all([
             this._loadFloatAccessorAsync("/accessors/" + inputAccessor.index, inputAccessor),
             this._loadFloatAccessorAsync("/accessors/" + outputAccessor.index, outputAccessor)
@@ -6317,7 +6347,7 @@ var GLTFLoader = /** @class */ (function () {
         if (!buffer.uri) {
             throw new Error(context + "/uri: Value is missing");
         }
-        buffer._data = this.loadUriAsync(context + "/uri", buffer.uri);
+        buffer._data = this.loadUriAsync(context + "/uri", buffer, buffer.uri);
         return buffer._data;
     };
     /**
@@ -6330,7 +6360,7 @@ var GLTFLoader = /** @class */ (function () {
         if (bufferView._data) {
             return bufferView._data;
         }
-        var buffer = ArrayItem.Get(context + "/buffer", this.gltf.buffers, bufferView.buffer);
+        var buffer = ArrayItem.Get(context + "/buffer", this._gltf.buffers, bufferView.buffer);
         bufferView._data = this._loadBufferAsync("/buffers/" + buffer.index, buffer).then(function (data) {
             try {
                 return new Uint8Array(data.buffer, data.byteOffset + (bufferView.byteOffset || 0), bufferView.byteLength);
@@ -6353,7 +6383,7 @@ var GLTFLoader = /** @class */ (function () {
         if (accessor._data) {
             return accessor._data;
         }
-        var bufferView = ArrayItem.Get(context + "/bufferView", this.gltf.bufferViews, accessor.bufferView);
+        var bufferView = ArrayItem.Get(context + "/bufferView", this._gltf.bufferViews, accessor.bufferView);
         accessor._data = this.loadBufferViewAsync("/bufferViews/" + bufferView.index, bufferView).then(function (data) {
             return GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, accessor.count);
         });
@@ -6374,7 +6404,7 @@ var GLTFLoader = /** @class */ (function () {
             accessor._data = Promise.resolve(new Float32Array(length));
         }
         else {
-            var bufferView = ArrayItem.Get(context + "/bufferView", this.gltf.bufferViews, accessor.bufferView);
+            var bufferView = ArrayItem.Get(context + "/bufferView", this._gltf.bufferViews, accessor.bufferView);
             accessor._data = this.loadBufferViewAsync("/bufferViews/" + bufferView.index, bufferView).then(function (data) {
                 return GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, length);
             });
@@ -6383,8 +6413,8 @@ var GLTFLoader = /** @class */ (function () {
             var sparse_1 = accessor.sparse;
             accessor._data = accessor._data.then(function (view) {
                 var data = view;
-                var indicesBufferView = ArrayItem.Get(context + "/sparse/indices/bufferView", _this.gltf.bufferViews, sparse_1.indices.bufferView);
-                var valuesBufferView = ArrayItem.Get(context + "/sparse/values/bufferView", _this.gltf.bufferViews, sparse_1.values.bufferView);
+                var indicesBufferView = ArrayItem.Get(context + "/sparse/indices/bufferView", _this._gltf.bufferViews, sparse_1.indices.bufferView);
+                var valuesBufferView = ArrayItem.Get(context + "/sparse/values/bufferView", _this._gltf.bufferViews, sparse_1.values.bufferView);
                 return Promise.all([
                     _this.loadBufferViewAsync("/bufferViews/" + indicesBufferView.index, indicesBufferView),
                     _this.loadBufferViewAsync("/bufferViews/" + valuesBufferView.index, valuesBufferView)
@@ -6411,7 +6441,7 @@ var GLTFLoader = /** @class */ (function () {
             return bufferView._babylonBuffer;
         }
         bufferView._babylonBuffer = this.loadBufferViewAsync("/bufferViews/" + bufferView.index, bufferView).then(function (data) {
-            return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Buffer"](_this.babylonScene.getEngine(), data, false);
+            return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Buffer"](_this._babylonScene.getEngine(), data, false);
         });
         return bufferView._babylonBuffer;
     };
@@ -6422,21 +6452,21 @@ var GLTFLoader = /** @class */ (function () {
         }
         if (accessor.sparse) {
             accessor._babylonVertexBuffer = this._loadFloatAccessorAsync("/accessors/" + accessor.index, accessor).then(function (data) {
-                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this.babylonScene.getEngine(), data, kind, false);
+                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this._babylonScene.getEngine(), data, kind, false);
             });
         }
         // HACK: If byte offset is not a multiple of component type byte length then load as a float array instead of using Babylon buffers.
         else if (accessor.byteOffset && accessor.byteOffset % babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"].GetTypeByteLength(accessor.componentType) !== 0) {
             babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Tools"].Warn("Accessor byte offset is not a multiple of component type byte length");
             accessor._babylonVertexBuffer = this._loadFloatAccessorAsync("/accessors/" + accessor.index, accessor).then(function (data) {
-                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this.babylonScene.getEngine(), data, kind, false);
+                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this._babylonScene.getEngine(), data, kind, false);
             });
         }
         else {
-            var bufferView_1 = ArrayItem.Get(context + "/bufferView", this.gltf.bufferViews, accessor.bufferView);
+            var bufferView_1 = ArrayItem.Get(context + "/bufferView", this._gltf.bufferViews, accessor.bufferView);
             accessor._babylonVertexBuffer = this._loadVertexBufferViewAsync(bufferView_1, kind).then(function (babylonBuffer) {
                 var size = GLTFLoader._GetNumComponents(context, accessor.type);
-                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this.babylonScene.getEngine(), babylonBuffer, kind, false, false, bufferView_1.byteStride, false, accessor.byteOffset, size, accessor.componentType, accessor.normalized, true);
+                return new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["VertexBuffer"](_this._babylonScene.getEngine(), babylonBuffer, kind, false, false, bufferView_1.byteStride, false, accessor.byteOffset, size, accessor.componentType, accessor.normalized, true);
             });
         }
         return accessor._babylonVertexBuffer;
@@ -6509,8 +6539,8 @@ var GLTFLoader = /** @class */ (function () {
         });
     };
     GLTFLoader.prototype._createDefaultMaterial = function (name, babylonDrawMode) {
-        var babylonMaterial = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["PBRMaterial"](name, this.babylonScene);
-        babylonMaterial.sideOrientation = this.babylonScene.useRightHandedSystem ? babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Material"].CounterClockWiseSideOrientation : babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Material"].ClockWiseSideOrientation;
+        var babylonMaterial = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["PBRMaterial"](name, this._babylonScene);
+        babylonMaterial.sideOrientation = this._babylonScene.useRightHandedSystem ? babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Material"].CounterClockWiseSideOrientation : babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Material"].ClockWiseSideOrientation;
         babylonMaterial.fillMode = babylonDrawMode;
         babylonMaterial.enableSpecularAntiAliasing = true;
         babylonMaterial.useRadianceOverAlpha = !this._parent.transparencyAsCoverage;
@@ -6578,8 +6608,8 @@ var GLTFLoader = /** @class */ (function () {
                 texture.name = babylonMaterial.name + " (Normal)";
                 babylonMaterial.bumpTexture = texture;
             }));
-            babylonMaterial.invertNormalMapX = !this.babylonScene.useRightHandedSystem;
-            babylonMaterial.invertNormalMapY = this.babylonScene.useRightHandedSystem;
+            babylonMaterial.invertNormalMapX = !this._babylonScene.useRightHandedSystem;
+            babylonMaterial.invertNormalMapY = this._babylonScene.useRightHandedSystem;
             if (material.normalTexture.scale != undefined) {
                 babylonMaterial.bumpTexture.level = material.normalTexture.scale;
             }
@@ -6656,7 +6686,7 @@ var GLTFLoader = /** @class */ (function () {
             return extensionPromise;
         }
         this.logOpen("" + context);
-        var texture = ArrayItem.Get(context + "/index", this.gltf.textures, textureInfo.index);
+        var texture = ArrayItem.Get(context + "/index", this._gltf.textures, textureInfo.index);
         var promise = this._loadTextureAsync("/textures/" + textureInfo.index, texture, function (babylonTexture) {
             babylonTexture.coordinatesIndex = textureInfo.texCoord || 0;
             GLTFLoader.AddPointerMetadata(babylonTexture, context);
@@ -6671,21 +6701,21 @@ var GLTFLoader = /** @class */ (function () {
         if (assign === void 0) { assign = function () { }; }
         var promises = new Array();
         this.logOpen(context + " " + (texture.name || ""));
-        var sampler = (texture.sampler == undefined ? GLTFLoader._DefaultSampler : ArrayItem.Get(context + "/sampler", this.gltf.samplers, texture.sampler));
+        var sampler = (texture.sampler == undefined ? GLTFLoader._DefaultSampler : ArrayItem.Get(context + "/sampler", this._gltf.samplers, texture.sampler));
         var samplerData = this._loadSampler("/samplers/" + sampler.index, sampler);
-        var image = ArrayItem.Get(context + "/source", this.gltf.images, texture.source);
+        var image = ArrayItem.Get(context + "/source", this._gltf.images, texture.source);
         var url = null;
         if (image.uri) {
             if (babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Tools"].IsBase64(image.uri)) {
                 url = image.uri;
             }
-            else if (this.babylonScene.getEngine().textureFormatInUse) {
+            else if (this._babylonScene.getEngine().textureFormatInUse) {
                 // If an image uri and a texture format is set like (eg. KTX) load from url instead of blob to support texture format and fallback
                 url = this._rootUrl + image.uri;
             }
         }
         var deferred = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Deferred"]();
-        var babylonTexture = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Texture"](url, this.babylonScene, samplerData.noMipMaps, false, samplerData.samplingMode, function () {
+        var babylonTexture = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Texture"](url, this._babylonScene, samplerData.noMipMaps, false, samplerData.samplingMode, function () {
             if (!_this._disposed) {
                 deferred.resolve();
             }
@@ -6731,10 +6761,10 @@ var GLTFLoader = /** @class */ (function () {
         if (!image._data) {
             this.logOpen(context + " " + (image.name || ""));
             if (image.uri) {
-                image._data = this.loadUriAsync(context + "/uri", image.uri);
+                image._data = this.loadUriAsync(context + "/uri", image, image.uri);
             }
             else {
-                var bufferView = ArrayItem.Get(context + "/bufferView", this.gltf.bufferViews, image.bufferView);
+                var bufferView = ArrayItem.Get(context + "/bufferView", this._gltf.bufferViews, image.bufferView);
                 image._data = this.loadBufferViewAsync("/bufferViews/" + bufferView.index, bufferView);
             }
             this.logClose();
@@ -6744,12 +6774,13 @@ var GLTFLoader = /** @class */ (function () {
     /**
      * Loads a glTF uri.
      * @param context The context when loading the asset
+     * @param property The glTF property associated with the uri
      * @param uri The base64 or relative uri
      * @returns A promise that resolves with the loaded data when the load is complete
      */
-    GLTFLoader.prototype.loadUriAsync = function (context, uri) {
+    GLTFLoader.prototype.loadUriAsync = function (context, property, uri) {
         var _this = this;
-        var extensionPromise = this._extensionsLoadUriAsync(context, uri);
+        var extensionPromise = this._extensionsLoadUriAsync(context, property, uri);
         if (extensionPromise) {
             return extensionPromise;
         }
@@ -6787,7 +6818,7 @@ var GLTFLoader = /** @class */ (function () {
                                 }
                             }
                         }
-                    }, _this.babylonScene.offlineProvider, true, function (request, exception) {
+                    }, _this._babylonScene.offlineProvider, true, function (request, exception) {
                         if (!_this._disposed) {
                             reject(new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["LoadFileError"](context + ": Failed to load '" + uri + "'" + (request ? ": " + request.status + " " + request.statusText : ""), request));
                         }
@@ -6924,8 +6955,8 @@ var GLTFLoader = /** @class */ (function () {
         var _this = this;
         this._parent._startPerformanceCounter("Compile materials");
         var promises = new Array();
-        if (this.gltf.materials) {
-            for (var _i = 0, _a = this.gltf.materials; _i < _a.length; _i++) {
+        if (this._gltf.materials) {
+            for (var _i = 0, _a = this._gltf.materials; _i < _a.length; _i++) {
                 var material = _a[_i];
                 if (material._data) {
                     for (var babylonDrawMode in material._data) {
@@ -6952,7 +6983,7 @@ var GLTFLoader = /** @class */ (function () {
         var _this = this;
         this._parent._startPerformanceCounter("Compile shadow generators");
         var promises = new Array();
-        var lights = this.babylonScene.lights;
+        var lights = this._babylonScene.lights;
         for (var _i = 0, lights_1 = lights; _i < lights_1.length; _i++) {
             var light = lights_1[_i];
             var generator = light.getShadowGenerator();
@@ -6973,16 +7004,17 @@ var GLTFLoader = /** @class */ (function () {
             }
         }
     };
-    GLTFLoader.prototype._applyExtensions = function (property, actionAsync) {
+    GLTFLoader.prototype._applyExtensions = function (property, functionName, actionAsync) {
         for (var _i = 0, _a = GLTFLoader._ExtensionNames; _i < _a.length; _i++) {
             var name_5 = _a[_i];
             var extension = this._extensions[name_5];
             if (extension.enabled) {
+                var id = name_5 + "." + functionName;
                 var loaderProperty = property;
-                loaderProperty._activeLoaderExtensions = loaderProperty._activeLoaderExtensions || {};
-                var activeLoaderExtensions = loaderProperty._activeLoaderExtensions;
-                if (!activeLoaderExtensions[name_5]) {
-                    activeLoaderExtensions[name_5] = true;
+                loaderProperty._activeLoaderExtensionFunctions = loaderProperty._activeLoaderExtensionFunctions || {};
+                var activeLoaderExtensionFunctions = loaderProperty._activeLoaderExtensionFunctions;
+                if (!activeLoaderExtensionFunctions[id]) {
+                    activeLoaderExtensionFunctions[id] = true;
                     try {
                         var result = actionAsync(extension);
                         if (result) {
@@ -6990,7 +7022,7 @@ var GLTFLoader = /** @class */ (function () {
                         }
                     }
                     finally {
-                        delete activeLoaderExtensions[name_5];
+                        delete activeLoaderExtensionFunctions[id];
                     }
                 }
             }
@@ -7004,34 +7036,34 @@ var GLTFLoader = /** @class */ (function () {
         this._forEachExtensions(function (extension) { return extension.onReady && extension.onReady(); });
     };
     GLTFLoader.prototype._extensionsLoadSceneAsync = function (context, scene) {
-        return this._applyExtensions(scene, function (extension) { return extension.loadSceneAsync && extension.loadSceneAsync(context, scene); });
+        return this._applyExtensions(scene, "loadScene", function (extension) { return extension.loadSceneAsync && extension.loadSceneAsync(context, scene); });
     };
     GLTFLoader.prototype._extensionsLoadNodeAsync = function (context, node, assign) {
-        return this._applyExtensions(node, function (extension) { return extension.loadNodeAsync && extension.loadNodeAsync(context, node, assign); });
+        return this._applyExtensions(node, "loadNode", function (extension) { return extension.loadNodeAsync && extension.loadNodeAsync(context, node, assign); });
     };
     GLTFLoader.prototype._extensionsLoadCameraAsync = function (context, camera, assign) {
-        return this._applyExtensions(camera, function (extension) { return extension.loadCameraAsync && extension.loadCameraAsync(context, camera, assign); });
+        return this._applyExtensions(camera, "loadCamera", function (extension) { return extension.loadCameraAsync && extension.loadCameraAsync(context, camera, assign); });
     };
     GLTFLoader.prototype._extensionsLoadVertexDataAsync = function (context, primitive, babylonMesh) {
-        return this._applyExtensions(primitive, function (extension) { return extension._loadVertexDataAsync && extension._loadVertexDataAsync(context, primitive, babylonMesh); });
+        return this._applyExtensions(primitive, "loadVertexData", function (extension) { return extension._loadVertexDataAsync && extension._loadVertexDataAsync(context, primitive, babylonMesh); });
     };
     GLTFLoader.prototype._extensionsLoadMaterialAsync = function (context, material, babylonMesh, babylonDrawMode, assign) {
-        return this._applyExtensions(material, function (extension) { return extension._loadMaterialAsync && extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign); });
+        return this._applyExtensions(material, "loadMaterial", function (extension) { return extension._loadMaterialAsync && extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign); });
     };
     GLTFLoader.prototype._extensionsCreateMaterial = function (context, material, babylonDrawMode) {
-        return this._applyExtensions({}, function (extension) { return extension.createMaterial && extension.createMaterial(context, material, babylonDrawMode); });
+        return this._applyExtensions(material, "createMaterial", function (extension) { return extension.createMaterial && extension.createMaterial(context, material, babylonDrawMode); });
     };
     GLTFLoader.prototype._extensionsLoadMaterialPropertiesAsync = function (context, material, babylonMaterial) {
-        return this._applyExtensions(material, function (extension) { return extension.loadMaterialPropertiesAsync && extension.loadMaterialPropertiesAsync(context, material, babylonMaterial); });
+        return this._applyExtensions(material, "loadMaterialProperties", function (extension) { return extension.loadMaterialPropertiesAsync && extension.loadMaterialPropertiesAsync(context, material, babylonMaterial); });
     };
     GLTFLoader.prototype._extensionsLoadTextureInfoAsync = function (context, textureInfo, assign) {
-        return this._applyExtensions(textureInfo, function (extension) { return extension.loadTextureInfoAsync && extension.loadTextureInfoAsync(context, textureInfo, assign); });
+        return this._applyExtensions(textureInfo, "loadTextureInfo", function (extension) { return extension.loadTextureInfoAsync && extension.loadTextureInfoAsync(context, textureInfo, assign); });
     };
     GLTFLoader.prototype._extensionsLoadAnimationAsync = function (context, animation) {
-        return this._applyExtensions(animation, function (extension) { return extension.loadAnimationAsync && extension.loadAnimationAsync(context, animation); });
+        return this._applyExtensions(animation, "loadAnimation", function (extension) { return extension.loadAnimationAsync && extension.loadAnimationAsync(context, animation); });
     };
-    GLTFLoader.prototype._extensionsLoadUriAsync = function (context, uri) {
-        return this._applyExtensions({}, function (extension) { return extension._loadUriAsync && extension._loadUriAsync(context, uri); });
+    GLTFLoader.prototype._extensionsLoadUriAsync = function (context, property, uri) {
+        return this._applyExtensions(property, "loadUri", function (extension) { return extension._loadUriAsync && extension._loadUriAsync(context, property, uri); });
     };
     /**
      * Helper method called by a loader extension to load an glTF extension.

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.js.map


ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.min.js


+ 40 - 14
dist/preview release/loaders/babylonjs.loaders.module.d.ts

@@ -1205,6 +1205,7 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoaderExtension" {
     import { IDisposable } from "babylonjs/scene";
     import { IScene, INode, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
     import { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from "babylonjs-loaders/glTF/glTFFileLoader";
+    import { IProperty } from 'babylonjs-gltf2interface';
     /**
      * Interface for a glTF loader extension.
      */
@@ -1289,10 +1290,11 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoaderExtension" {
         /**
          * Define this method to modify the default behavior when loading uris.
          * @param context The context when loading the asset
+         * @param property The glTF property associated with the uri
          * @param uri The uri to load
          * @returns A promise that resolves with the loaded data when the load is complete or null if not handled
          */
-        _loadUriAsync?(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
+        _loadUriAsync?(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>>;
     }
 }
 declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
@@ -1334,10 +1336,6 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
      * The glTF 2.0 loader
      */
     export class GLTFLoader implements IGLTFLoader {
-        /** The glTF object parsed from the JSON. */
-        gltf: IGLTF;
-        /** The Babylon scene when loading the asset. */
-        babylonScene: Scene;
         /** @hidden */
         _completePromises: Promise<any>[];
         private _disposed;
@@ -1347,6 +1345,8 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
         private _rootUrl;
         private _fileName;
         private _uniqueRootUrl;
+        private _gltf;
+        private _babylonScene;
         private _rootBabylonMesh;
         private _defaultBabylonMaterialData;
         private _progressCallback?;
@@ -1370,6 +1370,18 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
          * Gets the loader state.
          */
         readonly state: Nullable<GLTFLoaderState>;
+        /**
+         * The glTF object parsed from the JSON.
+         */
+        readonly gltf: IGLTF;
+        /**
+         * The Babylon scene when loading the asset.
+         */
+        readonly babylonScene: Scene;
+        /**
+         * The root Babylon mesh when loading the asset.
+         */
+        readonly rootBabylonMesh: Mesh;
         /** @hidden */
         constructor(parent: GLTFFileLoader);
         /** @hidden */
@@ -1509,10 +1521,11 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
         /**
          * Loads a glTF uri.
          * @param context The context when loading the asset
+         * @param property The glTF property associated with the uri
          * @param uri The base64 or relative uri
          * @returns A promise that resolves with the loaded data when the load is complete
          */
-        loadUriAsync(context: string, uri: string): Promise<ArrayBufferView>;
+        loadUriAsync(context: string, property: IProperty, uri: string): Promise<ArrayBufferView>;
         private _onProgress;
         /**
          * Adds a JSON pointer to the metadata of the Babylon object at `<object>.metadata.gltf.pointers`.
@@ -1781,6 +1794,7 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/MSFT_lod" {
     import { INode, IMaterial } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
     import { IGLTFLoaderExtension } from "babylonjs-loaders/glTF/2.0/glTFLoaderExtension";
     import { GLTFLoader } from "babylonjs-loaders/glTF/2.0/glTFLoader";
+    import { IProperty } from 'babylonjs-gltf2interface';
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_lod)
      */
@@ -1823,7 +1837,7 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/MSFT_lod" {
         /** @hidden */
         _loadMaterialAsync(context: string, material: IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
         /** @hidden */
-        _loadUriAsync(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
+        _loadUriAsync(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>>;
         /**
          * Gets an array of LOD properties from lowest to highest.
          */
@@ -3446,10 +3460,11 @@ declare module BABYLON.GLTF2 {
         /**
          * Define this method to modify the default behavior when loading uris.
          * @param context The context when loading the asset
+         * @param property The glTF property associated with the uri
          * @param uri The uri to load
          * @returns A promise that resolves with the loaded data when the load is complete or null if not handled
          */
-        _loadUriAsync?(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
+        _loadUriAsync?(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>>;
     }
 }
 declare module BABYLON.GLTF2 {
@@ -3475,10 +3490,6 @@ declare module BABYLON.GLTF2 {
      * The glTF 2.0 loader
      */
     export class GLTFLoader implements IGLTFLoader {
-        /** The glTF object parsed from the JSON. */
-        gltf: IGLTF;
-        /** The Babylon scene when loading the asset. */
-        babylonScene: Scene;
         /** @hidden */
         _completePromises: Promise<any>[];
         private _disposed;
@@ -3488,6 +3499,8 @@ declare module BABYLON.GLTF2 {
         private _rootUrl;
         private _fileName;
         private _uniqueRootUrl;
+        private _gltf;
+        private _babylonScene;
         private _rootBabylonMesh;
         private _defaultBabylonMaterialData;
         private _progressCallback?;
@@ -3511,6 +3524,18 @@ declare module BABYLON.GLTF2 {
          * Gets the loader state.
          */
         readonly state: Nullable<GLTFLoaderState>;
+        /**
+         * The glTF object parsed from the JSON.
+         */
+        readonly gltf: IGLTF;
+        /**
+         * The Babylon scene when loading the asset.
+         */
+        readonly babylonScene: Scene;
+        /**
+         * The root Babylon mesh when loading the asset.
+         */
+        readonly rootBabylonMesh: Mesh;
         /** @hidden */
         constructor(parent: GLTFFileLoader);
         /** @hidden */
@@ -3650,10 +3675,11 @@ declare module BABYLON.GLTF2 {
         /**
          * Loads a glTF uri.
          * @param context The context when loading the asset
+         * @param property The glTF property associated with the uri
          * @param uri The base64 or relative uri
          * @returns A promise that resolves with the loaded data when the load is complete
          */
-        loadUriAsync(context: string, uri: string): Promise<ArrayBufferView>;
+        loadUriAsync(context: string, property: IProperty, uri: string): Promise<ArrayBufferView>;
         private _onProgress;
         /**
          * Adds a JSON pointer to the metadata of the Babylon object at `<object>.metadata.gltf.pointers`.
@@ -3920,7 +3946,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
         /** @hidden */
         _loadMaterialAsync(context: string, material: IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
         /** @hidden */
-        _loadUriAsync(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
+        _loadUriAsync(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>>;
         /**
          * Gets an array of LOD properties from lowest to highest.
          */

+ 6 - 6
dist/preview release/materialsLibrary/babylon.cellMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -355,7 +355,7 @@ module.exports = g;
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cellPixelShader", function() { return cellPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -388,7 +388,7 @@ var cellPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cellVertexShader", function() { return cellVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -422,7 +422,7 @@ var cellVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellMaterial", function() { return CellMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _cell_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cell.fragment */ "./cell/cell.fragment.ts");
 /* harmony import */ var _cell_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cell.vertex */ "./cell/cell.vertex.ts");
@@ -762,14 +762,14 @@ if (typeof globalObject !== "undefined") {
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.cellMaterial.js.map


+ 4 - 4
dist/preview release/materialsLibrary/babylon.customMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -358,7 +358,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShaderSpecialParts", function() { return ShaderSpecialParts; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomMaterial", function() { return CustomMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__);
 
 
@@ -596,14 +596,14 @@ if (typeof globalObject !== "undefined") {
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.customMaterial.js.map


+ 6 - 6
dist/preview release/materialsLibrary/babylon.fireMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -355,7 +355,7 @@ module.exports = g;
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firePixelShader", function() { return firePixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -382,7 +382,7 @@ var firePixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fireVertexShader", function() { return fireVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -413,7 +413,7 @@ var fireVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FireMaterial", function() { return FireMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _fire_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fire.fragment */ "./fire/fire.fragment.ts");
 /* harmony import */ var _fire_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fire.vertex */ "./fire/fire.vertex.ts");
@@ -793,14 +793,14 @@ if (typeof globalObject !== "undefined") {
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.fireMaterial.js.map


+ 6 - 6
dist/preview release/materialsLibrary/babylon.furMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -355,7 +355,7 @@ module.exports = g;
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "furPixelShader", function() { return furPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -388,7 +388,7 @@ var furPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "furVertexShader", function() { return furVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -422,7 +422,7 @@ var furVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FurMaterial", function() { return FurMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _fur_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fur.fragment */ "./fur/fur.fragment.ts");
 /* harmony import */ var _fur_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fur.vertex */ "./fur/fur.vertex.ts");
@@ -951,14 +951,14 @@ if (typeof globalObject !== "undefined") {
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.furMaterial.js.map


+ 6 - 6
dist/preview release/materialsLibrary/babylon.gradientMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -355,7 +355,7 @@ module.exports = g;
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gradientPixelShader", function() { return gradientPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -388,7 +388,7 @@ var gradientPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gradientVertexShader", function() { return gradientVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -422,7 +422,7 @@ var gradientVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GradientMaterial", function() { return GradientMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _gradient_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gradient.fragment */ "./gradient/gradient.fragment.ts");
 /* harmony import */ var _gradient_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./gradient.vertex */ "./gradient/gradient.vertex.ts");
@@ -731,14 +731,14 @@ if (typeof globalObject !== "undefined") {
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.gradientMaterial.js.map


+ 6 - 6
dist/preview release/materialsLibrary/babylon.gridMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -355,7 +355,7 @@ module.exports = g;
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gridPixelShader", function() { return gridPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -379,7 +379,7 @@ var gridPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gridVertexShader", function() { return gridVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -404,7 +404,7 @@ var gridVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridMaterial", function() { return GridMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _grid_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./grid.fragment */ "./grid/grid.fragment.ts");
 /* harmony import */ var _grid_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./grid.vertex */ "./grid/grid.vertex.ts");
@@ -698,14 +698,14 @@ if (typeof globalObject !== "undefined") {
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.gridMaterial.js.map


+ 6 - 6
dist/preview release/materialsLibrary/babylon.lavaMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -372,7 +372,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lavaPixelShader", function() { return lavaPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -405,7 +405,7 @@ var lavaPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lavaVertexShader", function() { return lavaVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -439,7 +439,7 @@ var lavaVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LavaMaterial", function() { return LavaMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _lava_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lava.fragment */ "./lava/lava.fragment.ts");
 /* harmony import */ var _lava_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lava.vertex */ "./lava/lava.vertex.ts");
@@ -850,14 +850,14 @@ if (typeof globalObject !== "undefined") {
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.lavaMaterial.js.map


+ 6 - 6
dist/preview release/materialsLibrary/babylon.mixMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -401,7 +401,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixPixelShader", function() { return mixPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -434,7 +434,7 @@ var mixPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixVertexShader", function() { return mixVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -468,7 +468,7 @@ var mixVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MixMaterial", function() { return MixMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _mix_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mix.fragment */ "./mix/mix.fragment.ts");
 /* harmony import */ var _mix_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mix.vertex */ "./mix/mix.vertex.ts");
@@ -955,14 +955,14 @@ babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredT
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.mixMaterial.js.map


+ 6 - 6
dist/preview release/materialsLibrary/babylon.normalMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -401,7 +401,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalPixelShader", function() { return normalPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -434,7 +434,7 @@ var normalPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalVertexShader", function() { return normalVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -468,7 +468,7 @@ var normalVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NormalMaterial", function() { return NormalMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _normal_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./normal.fragment */ "./normal/normal.fragment.ts");
 /* harmony import */ var _normal_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./normal.vertex */ "./normal/normal.vertex.ts");
@@ -795,14 +795,14 @@ babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredT
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.normalMaterial.js.map


+ 6 - 6
dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -401,7 +401,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shadowOnlyPixelShader", function() { return shadowOnlyPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -433,7 +433,7 @@ var shadowOnlyPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shadowOnlyVertexShader", function() { return shadowOnlyVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -467,7 +467,7 @@ var shadowOnlyVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShadowOnlyMaterial", function() { return ShadowOnlyMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _shadowOnly_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shadowOnly.fragment */ "./shadowOnly/shadowOnly.fragment.ts");
 /* harmony import */ var _shadowOnly_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shadowOnly.vertex */ "./shadowOnly/shadowOnly.vertex.ts");
@@ -686,14 +686,14 @@ babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredT
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.js.map


+ 6 - 6
dist/preview release/materialsLibrary/babylon.simpleMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -401,7 +401,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "simplePixelShader", function() { return simplePixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -434,7 +434,7 @@ var simplePixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "simpleVertexShader", function() { return simpleVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -468,7 +468,7 @@ var simpleVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleMaterial", function() { return SimpleMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _simple_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./simple.fragment */ "./simple/simple.fragment.ts");
 /* harmony import */ var _simple_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./simple.vertex */ "./simple/simple.vertex.ts");
@@ -753,14 +753,14 @@ babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredT
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.simpleMaterial.js.map


+ 6 - 6
dist/preview release/materialsLibrary/babylon.skyMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -401,7 +401,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skyPixelShader", function() { return skyPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -427,7 +427,7 @@ var skyPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skyVertexShader", function() { return skyVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -454,7 +454,7 @@ var skyVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkyMaterial", function() { return SkyMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _sky_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./sky.fragment */ "./sky/sky.fragment.ts");
 /* harmony import */ var _sky_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./sky.vertex */ "./sky/sky.vertex.ts");
@@ -785,14 +785,14 @@ babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredT
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.skyMaterial.js.map


+ 6 - 6
dist/preview release/materialsLibrary/babylon.terrainMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -401,7 +401,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "terrainPixelShader", function() { return terrainPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -434,7 +434,7 @@ var terrainPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "terrainVertexShader", function() { return terrainVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -468,7 +468,7 @@ var terrainVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TerrainMaterial", function() { return TerrainMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _terrain_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./terrain.fragment */ "./terrain/terrain.fragment.ts");
 /* harmony import */ var _terrain_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./terrain.vertex */ "./terrain/terrain.vertex.ts");
@@ -883,14 +883,14 @@ babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredT
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.terrainMaterial.js.map


+ 6 - 6
dist/preview release/materialsLibrary/babylon.triPlanarMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -402,7 +402,7 @@ __webpack_require__.r(__webpack_exports__);
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TriPlanarMaterial", function() { return TriPlanarMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _triplanar_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./triplanar.fragment */ "./triPlanar/triplanar.fragment.ts");
 /* harmony import */ var _triplanar_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./triplanar.vertex */ "./triPlanar/triplanar.vertex.ts");
@@ -807,7 +807,7 @@ babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredT
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "triplanarPixelShader", function() { return triplanarPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -840,7 +840,7 @@ var triplanarPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "triplanarVertexShader", function() { return triplanarVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -863,14 +863,14 @@ var triplanarVertexShader = { name: name, shader: shader };
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.triPlanarMaterial.js.map


+ 6 - 6
dist/preview release/materialsLibrary/babylon.waterMaterial.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -401,7 +401,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "waterPixelShader", function() { return waterPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -435,7 +435,7 @@ var waterPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "waterVertexShader", function() { return waterVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -471,7 +471,7 @@ var waterVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WaterMaterial", function() { return WaterMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _water_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./water.fragment */ "./water/water.fragment.ts");
 /* harmony import */ var _water_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./water.vertex */ "./water/water.vertex.ts");
@@ -1114,14 +1114,14 @@ babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredT
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylon.waterMaterial.js.map


+ 46 - 46
dist/preview release/materialsLibrary/babylonjs.materials.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-materials"] = factory(require("babylonjs"));
 	else
 		root["MATERIALS"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -355,7 +355,7 @@ module.exports = g;
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cellPixelShader", function() { return cellPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -388,7 +388,7 @@ var cellPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cellVertexShader", function() { return cellVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -422,7 +422,7 @@ var cellVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellMaterial", function() { return CellMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _cell_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cell.fragment */ "./cell/cell.fragment.ts");
 /* harmony import */ var _cell_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cell.vertex */ "./cell/cell.vertex.ts");
@@ -746,7 +746,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShaderSpecialParts", function() { return ShaderSpecialParts; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomMaterial", function() { return CustomMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__);
 
 
@@ -961,7 +961,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firePixelShader", function() { return firePixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -988,7 +988,7 @@ var firePixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fireVertexShader", function() { return fireVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -1019,7 +1019,7 @@ var fireVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FireMaterial", function() { return FireMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _fire_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fire.fragment */ "./fire/fire.fragment.ts");
 /* harmony import */ var _fire_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fire.vertex */ "./fire/fire.vertex.ts");
@@ -1380,7 +1380,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "furPixelShader", function() { return furPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -1413,7 +1413,7 @@ var furPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "furVertexShader", function() { return furVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -1447,7 +1447,7 @@ var furVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FurMaterial", function() { return FurMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _fur_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fur.fragment */ "./fur/fur.fragment.ts");
 /* harmony import */ var _fur_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fur.vertex */ "./fur/fur.vertex.ts");
@@ -1957,7 +1957,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gradientPixelShader", function() { return gradientPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -1990,7 +1990,7 @@ var gradientPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gradientVertexShader", function() { return gradientVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -2024,7 +2024,7 @@ var gradientVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GradientMaterial", function() { return GradientMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _gradient_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gradient.fragment */ "./gradient/gradient.fragment.ts");
 /* harmony import */ var _gradient_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./gradient.vertex */ "./gradient/gradient.vertex.ts");
@@ -2314,7 +2314,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gridPixelShader", function() { return gridPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -2338,7 +2338,7 @@ var gridPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gridVertexShader", function() { return gridVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -2363,7 +2363,7 @@ var gridVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridMaterial", function() { return GridMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _grid_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./grid.fragment */ "./grid/grid.fragment.ts");
 /* harmony import */ var _grid_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./grid.vertex */ "./grid/grid.vertex.ts");
@@ -2732,7 +2732,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lavaPixelShader", function() { return lavaPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -2765,7 +2765,7 @@ var lavaPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lavaVertexShader", function() { return lavaVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -2799,7 +2799,7 @@ var lavaVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LavaMaterial", function() { return LavaMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _lava_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lava.fragment */ "./lava/lava.fragment.ts");
 /* harmony import */ var _lava_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lava.vertex */ "./lava/lava.vertex.ts");
@@ -3272,7 +3272,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixPixelShader", function() { return mixPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -3305,7 +3305,7 @@ var mixPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixVertexShader", function() { return mixVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -3339,7 +3339,7 @@ var mixVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MixMaterial", function() { return MixMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _mix_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mix.fragment */ "./mix/mix.fragment.ts");
 /* harmony import */ var _mix_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mix.vertex */ "./mix/mix.vertex.ts");
@@ -3853,7 +3853,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalPixelShader", function() { return normalPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -3886,7 +3886,7 @@ var normalPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalVertexShader", function() { return normalVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -3920,7 +3920,7 @@ var normalVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NormalMaterial", function() { return NormalMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _normal_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./normal.fragment */ "./normal/normal.fragment.ts");
 /* harmony import */ var _normal_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./normal.vertex */ "./normal/normal.vertex.ts");
@@ -4274,7 +4274,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shadowOnlyPixelShader", function() { return shadowOnlyPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -4306,7 +4306,7 @@ var shadowOnlyPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shadowOnlyVertexShader", function() { return shadowOnlyVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -4340,7 +4340,7 @@ var shadowOnlyVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShadowOnlyMaterial", function() { return ShadowOnlyMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _shadowOnly_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shadowOnly.fragment */ "./shadowOnly/shadowOnly.fragment.ts");
 /* harmony import */ var _shadowOnly_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shadowOnly.vertex */ "./shadowOnly/shadowOnly.vertex.ts");
@@ -4586,7 +4586,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "simplePixelShader", function() { return simplePixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -4619,7 +4619,7 @@ var simplePixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "simpleVertexShader", function() { return simpleVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -4653,7 +4653,7 @@ var simpleVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleMaterial", function() { return SimpleMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _simple_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./simple.fragment */ "./simple/simple.fragment.ts");
 /* harmony import */ var _simple_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./simple.vertex */ "./simple/simple.vertex.ts");
@@ -4965,7 +4965,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skyPixelShader", function() { return skyPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -4991,7 +4991,7 @@ var skyPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skyVertexShader", function() { return skyVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -5018,7 +5018,7 @@ var skyVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkyMaterial", function() { return SkyMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _sky_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./sky.fragment */ "./sky/sky.fragment.ts");
 /* harmony import */ var _sky_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./sky.vertex */ "./sky/sky.vertex.ts");
@@ -5376,7 +5376,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "terrainPixelShader", function() { return terrainPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -5409,7 +5409,7 @@ var terrainPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "terrainVertexShader", function() { return terrainVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -5443,7 +5443,7 @@ var terrainVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TerrainMaterial", function() { return TerrainMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _terrain_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./terrain.fragment */ "./terrain/terrain.fragment.ts");
 /* harmony import */ var _terrain_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./terrain.vertex */ "./terrain/terrain.vertex.ts");
@@ -5886,7 +5886,7 @@ __webpack_require__.r(__webpack_exports__);
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TriPlanarMaterial", function() { return TriPlanarMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _triplanar_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./triplanar.fragment */ "./triPlanar/triplanar.fragment.ts");
 /* harmony import */ var _triplanar_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./triplanar.vertex */ "./triPlanar/triplanar.vertex.ts");
@@ -6291,7 +6291,7 @@ babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredT
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "triplanarPixelShader", function() { return triplanarPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -6324,7 +6324,7 @@ var triplanarPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "triplanarVertexShader", function() { return triplanarVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -6374,7 +6374,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "waterPixelShader", function() { return waterPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -6408,7 +6408,7 @@ var waterPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "waterVertexShader", function() { return waterVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -6444,7 +6444,7 @@ var waterVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WaterMaterial", function() { return WaterMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Materials/effect");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _water_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./water.fragment */ "./water/water.fragment.ts");
 /* harmony import */ var _water_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./water.vertex */ "./water/water.vertex.ts");
@@ -7087,14 +7087,14 @@ babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredT
 
 /***/ }),
 
-/***/ "babylonjs/Materials/effect":
+/***/ "babylonjs/Misc/decorators":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Materials_effect__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
 
 /***/ })
 

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/preview release/materialsLibrary/babylonjs.materials.js.map


+ 1 - 1
dist/preview release/packagesSizeBaseLine.json

@@ -1 +1 @@
-{"engineOnly":306558,"sceneOnly":508477,"minGridMaterial":631963,"minStandardMaterial":754882}
+{"engineOnly":307274,"sceneOnly":510028,"minGridMaterial":633514,"minStandardMaterial":756625}

+ 218 - 30
dist/preview release/viewer/babylon.module.d.ts

@@ -7790,6 +7790,7 @@ declare module "babylonjs/Meshes/transformNode" {
         /**
          * Defines the passed node as the parent of the current node.
          * The node will remain exactly where it is and its position / rotation will be updated accordingly
+         * @see https://doc.babylonjs.com/how_to/parenting
          * @param node the node ot set as the parent
          * @returns this TransformNode.
          */
@@ -19088,6 +19089,7 @@ declare module "babylonjs/Bones/skeleton" {
         private _ranges;
         private _lastAbsoluteTransformsUpdateId;
         private _canUseTextureForBones;
+        private _uniqueId;
         /** @hidden */
         _numBonesWithLinkedTransformNode: number;
         /**
@@ -19119,6 +19121,10 @@ declare module "babylonjs/Bones/skeleton" {
          */
         readonly isUsingTextureForMatrices: boolean;
         /**
+         * Gets the unique ID of this skeleton
+         */
+        readonly uniqueId: number;
+        /**
          * Creates a new skeleton
          * @param name defines the skeleton name
          * @param id defines the skeleton Id
@@ -19997,6 +20003,7 @@ declare module "babylonjs/Physics/IPhysicsEngine" {
         setBodyVelocityIterations?(impostor: PhysicsImpostor, velocityIterations: number): void;
         getBodyPositionIterations?(impostor: PhysicsImpostor): number;
         setBodyPositionIterations?(impostor: PhysicsImpostor, positionIterations: number): void;
+        appendAnchor?(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): void;
         sleepBody(impostor: PhysicsImpostor): void;
         wakeUpBody(impostor: PhysicsImpostor): void;
         raycast(from: Vector3, to: Vector3): PhysicsRaycastResult;
@@ -20581,6 +20588,16 @@ declare module "babylonjs/Physics/physicsImpostor" {
          */
         addJoint(otherImpostor: PhysicsImpostor, joint: PhysicsJoint): PhysicsImpostor;
         /**
+         * Add an anchor to a soft impostor
+         * @param otherImpostor rigid impostor as the anchor
+         * @param width ratio across width from 0 to 1
+         * @param height ratio up height from 0 to 1
+         * @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, no strech
+         * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
+         * @returns impostor the soft imposter
+         */
+        addAnchor(otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): PhysicsImpostor;
+        /**
          * Will keep this body still, in a sleep mode.
          * @returns the physics imposter
          */
@@ -24639,10 +24656,11 @@ declare module "babylonjs/Meshes/abstractMesh" {
         getBoundingInfo(): BoundingInfo;
         /**
          * Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
-         * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box
+         * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
+         * @param ignoreRotation ignore rotation when computing the scale (ie. object will be axis aligned). Default is false
          * @returns the current mesh
          */
-        normalizeToUnitCube(includeDescendants?: boolean): AbstractMesh;
+        normalizeToUnitCube(includeDescendants?: boolean, ignoreRotation?: boolean): AbstractMesh;
         /**
          * Overwrite the current bounding info
          * @param boundingInfo defines the new bounding info
@@ -25260,7 +25278,8 @@ declare module "babylonjs/node" {
          */
         isDisposed(): boolean;
         /**
-         * Gets or sets the parent of the node
+         * Gets or sets the parent of the node (without keeping the current position in the scene)
+         * @see https://doc.babylonjs.com/how_to/parenting
          */
         parent: Nullable<Node>;
         private addToSceneRootNodes;
@@ -27286,8 +27305,6 @@ declare module "babylonjs/Engines/engine" {
         canUseTimestampForTimerQuery: boolean;
         /** Function used to let the system compiles shaders in background */
         parallelShaderCompile: {
-            MAX_SHADER_COMPILER_THREADS_KHR: number;
-            maxShaderCompilerThreadsKHR: (thread: number) => void;
             COMPLETION_STATUS_KHR: number;
         };
     }
@@ -28039,6 +28056,21 @@ declare module "babylonjs/Engines/engine" {
          * Sets the current depth function to LESS
          */
         setDepthFunctionToLess(): void;
+        private _cachedStencilBuffer;
+        private _cachedStencilFunction;
+        private _cachedStencilMask;
+        private _cachedStencilOperationPass;
+        private _cachedStencilOperationFail;
+        private _cachedStencilOperationDepthFail;
+        private _cachedStencilReference;
+        /**
+         * Caches the the state of the stencil buffer
+         */
+        cacheStencilState(): void;
+        /**
+         * Restores the state of the stencil buffer
+         */
+        restoreStencilState(): void;
         /**
          * Sets the current depth function to LEQUAL
          */
@@ -33470,6 +33502,12 @@ declare module "babylonjs/scene" {
          */
         getAnimationGroupByName(name: string): Nullable<AnimationGroup>;
         /**
+         * Get a material using its unique id
+         * @param uniqueId defines the material's unique id
+         * @return the material or null if none found.
+         */
+        getMaterialByUniqueID(uniqueId: number): Nullable<Material>;
+        /**
          * get a material using its id
          * @param id defines the material's ID
          * @return the material or null if none found.
@@ -33579,6 +33617,12 @@ declare module "babylonjs/scene" {
          */
         getTransformNodeByID(id: string): Nullable<TransformNode>;
         /**
+         * Gets a transform node with its auto-generated unique id
+         * @param uniqueId efines the unique id to search for
+         * @return the found transform node or null if not found at all.
+         */
+        getTransformNodeByUniqueID(uniqueId: number): Nullable<TransformNode>;
+        /**
          * Gets a list of transform nodes using their id
          * @param id defines the id to search for
          * @returns a list of transform nodes
@@ -33633,6 +33677,12 @@ declare module "babylonjs/scene" {
          */
         getLastSkeletonByID(id: string): Nullable<Skeleton>;
         /**
+         * Gets a skeleton using a given auto generated unique id
+         * @param  uniqueId defines the unique id to search for
+         * @return the found skeleton or null if not found at all.
+         */
+        getSkeletonByUniqueId(uniqueId: number): Nullable<Skeleton>;
+        /**
          * Gets a skeleton using a given id (if many are found, this function will pick the first one)
          * @param id defines the id to search for
          * @return the found skeleton or null if not found at all.
@@ -45231,9 +45281,23 @@ declare module "babylonjs/Shaders/ShadersInclude/pbrUboDeclaration" {
         shader: string;
     };
 }
-declare module "babylonjs/Shaders/ShadersInclude/pbrFunctions" {
+declare module "babylonjs/Shaders/ShadersInclude/pbrFragmentExtraDeclaration" {
     /** @hidden */
-    export var pbrFunctions: {
+    export var pbrFragmentExtraDeclaration: {
+        name: string;
+        shader: string;
+    };
+}
+declare module "babylonjs/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration" {
+    /** @hidden */
+    export var pbrFragmentSamplersDeclaration: {
+        name: string;
+        shader: string;
+    };
+}
+declare module "babylonjs/Shaders/ShadersInclude/pbrHelperFunctions" {
+    /** @hidden */
+    export var pbrHelperFunctions: {
         name: string;
         shader: string;
     };
@@ -45245,23 +45309,37 @@ declare module "babylonjs/Shaders/ShadersInclude/harmonicsFunctions" {
         shader: string;
     };
 }
-declare module "babylonjs/Shaders/ShadersInclude/pbrPreLightingFunctions" {
+declare module "babylonjs/Shaders/ShadersInclude/pbrDirectLightingSetupFunctions" {
+    /** @hidden */
+    export var pbrDirectLightingSetupFunctions: {
+        name: string;
+        shader: string;
+    };
+}
+declare module "babylonjs/Shaders/ShadersInclude/pbrDirectLightingFalloffFunctions" {
+    /** @hidden */
+    export var pbrDirectLightingFalloffFunctions: {
+        name: string;
+        shader: string;
+    };
+}
+declare module "babylonjs/Shaders/ShadersInclude/pbrBRDFFunctions" {
     /** @hidden */
-    export var pbrPreLightingFunctions: {
+    export var pbrBRDFFunctions: {
         name: string;
         shader: string;
     };
 }
-declare module "babylonjs/Shaders/ShadersInclude/pbrFalloffLightingFunctions" {
+declare module "babylonjs/Shaders/ShadersInclude/pbrDirectLightingFunctions" {
     /** @hidden */
-    export var pbrFalloffLightingFunctions: {
+    export var pbrDirectLightingFunctions: {
         name: string;
         shader: string;
     };
 }
-declare module "babylonjs/Shaders/ShadersInclude/pbrLightingFunctions" {
+declare module "babylonjs/Shaders/ShadersInclude/pbrIBLFunctions" {
     /** @hidden */
-    export var pbrLightingFunctions: {
+    export var pbrIBLFunctions: {
         name: string;
         shader: string;
     };
@@ -45276,22 +45354,26 @@ declare module "babylonjs/Shaders/ShadersInclude/pbrDebug" {
 declare module "babylonjs/Shaders/pbr.fragment" {
     import "babylonjs/Shaders/ShadersInclude/pbrFragmentDeclaration";
     import "babylonjs/Shaders/ShadersInclude/pbrUboDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/pbrFragmentExtraDeclaration";
     import "babylonjs/Shaders/ShadersInclude/lightFragmentDeclaration";
     import "babylonjs/Shaders/ShadersInclude/lightUboDeclaration";
-    import "babylonjs/Shaders/ShadersInclude/reflectionFunction";
+    import "babylonjs/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration";
     import "babylonjs/Shaders/ShadersInclude/imageProcessingDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/clipPlaneFragmentDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/logDepthDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/fogFragmentDeclaration";
     import "babylonjs/Shaders/ShadersInclude/helperFunctions";
+    import "babylonjs/Shaders/ShadersInclude/pbrHelperFunctions";
     import "babylonjs/Shaders/ShadersInclude/imageProcessingFunctions";
     import "babylonjs/Shaders/ShadersInclude/shadowsFragmentFunctions";
-    import "babylonjs/Shaders/ShadersInclude/pbrFunctions";
     import "babylonjs/Shaders/ShadersInclude/harmonicsFunctions";
-    import "babylonjs/Shaders/ShadersInclude/pbrPreLightingFunctions";
-    import "babylonjs/Shaders/ShadersInclude/pbrFalloffLightingFunctions";
-    import "babylonjs/Shaders/ShadersInclude/pbrLightingFunctions";
+    import "babylonjs/Shaders/ShadersInclude/pbrDirectLightingSetupFunctions";
+    import "babylonjs/Shaders/ShadersInclude/pbrDirectLightingFalloffFunctions";
+    import "babylonjs/Shaders/ShadersInclude/pbrBRDFFunctions";
+    import "babylonjs/Shaders/ShadersInclude/pbrDirectLightingFunctions";
+    import "babylonjs/Shaders/ShadersInclude/pbrIBLFunctions";
     import "babylonjs/Shaders/ShadersInclude/bumpFragmentFunctions";
-    import "babylonjs/Shaders/ShadersInclude/clipPlaneFragmentDeclaration";
-    import "babylonjs/Shaders/ShadersInclude/logDepthDeclaration";
-    import "babylonjs/Shaders/ShadersInclude/fogFragmentDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/reflectionFunction";
     import "babylonjs/Shaders/ShadersInclude/clipPlaneFragment";
     import "babylonjs/Shaders/ShadersInclude/bumpFragment";
     import "babylonjs/Shaders/ShadersInclude/depthPrePass";
@@ -53138,6 +53220,16 @@ declare module "babylonjs/Physics/Plugins/ammoJSPlugin" {
          */
         setBodyPositionIterations(impostor: PhysicsImpostor, positionIterations: number): void;
         /**
+        * Append an anchor to a soft object
+        * @param impostor soft impostor to add anchor to
+        * @param otherImpostor rigid impostor as the anchor
+        * @param width ratio across width from 0 to 1
+        * @param height ratio up height from 0 to 1
+        * @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, no strech
+        * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
+        */
+        appendAnchor(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, width: number, height: number, influence?: number, noCollisionBetweenLinkedBodies?: boolean): void;
+        /**
          * Sleeps the physics body and stops it from being active
          * @param impostor impostor to sleep
          */
@@ -56154,6 +56246,10 @@ declare module "babylonjs/Rendering/outlineRenderer" {
      */
     export class OutlineRenderer implements ISceneComponent {
         /**
+         * Stencil value used to avoid outline being seen within the mesh when the mesh is transparent
+         */
+        private static _StencilReference;
+        /**
          * The name of the component. Each component must have a unique name.
          */
         name: string;
@@ -66169,6 +66265,7 @@ declare module BABYLON {
         /**
          * Defines the passed node as the parent of the current node.
          * The node will remain exactly where it is and its position / rotation will be updated accordingly
+         * @see https://doc.babylonjs.com/how_to/parenting
          * @param node the node ot set as the parent
          * @returns this TransformNode.
          */
@@ -77038,6 +77135,7 @@ declare module BABYLON {
         private _ranges;
         private _lastAbsoluteTransformsUpdateId;
         private _canUseTextureForBones;
+        private _uniqueId;
         /** @hidden */
         _numBonesWithLinkedTransformNode: number;
         /**
@@ -77069,6 +77167,10 @@ declare module BABYLON {
          */
         readonly isUsingTextureForMatrices: boolean;
         /**
+         * Gets the unique ID of this skeleton
+         */
+        readonly uniqueId: number;
+        /**
          * Creates a new skeleton
          * @param name defines the skeleton name
          * @param id defines the skeleton Id
@@ -77926,6 +78028,7 @@ declare module BABYLON {
         setBodyVelocityIterations?(impostor: PhysicsImpostor, velocityIterations: number): void;
         getBodyPositionIterations?(impostor: PhysicsImpostor): number;
         setBodyPositionIterations?(impostor: PhysicsImpostor, positionIterations: number): void;
+        appendAnchor?(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): void;
         sleepBody(impostor: PhysicsImpostor): void;
         wakeUpBody(impostor: PhysicsImpostor): void;
         raycast(from: Vector3, to: Vector3): PhysicsRaycastResult;
@@ -78502,6 +78605,16 @@ declare module BABYLON {
          */
         addJoint(otherImpostor: PhysicsImpostor, joint: PhysicsJoint): PhysicsImpostor;
         /**
+         * Add an anchor to a soft impostor
+         * @param otherImpostor rigid impostor as the anchor
+         * @param width ratio across width from 0 to 1
+         * @param height ratio up height from 0 to 1
+         * @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, no strech
+         * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
+         * @returns impostor the soft imposter
+         */
+        addAnchor(otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): PhysicsImpostor;
+        /**
          * Will keep this body still, in a sleep mode.
          * @returns the physics imposter
          */
@@ -82460,10 +82573,11 @@ declare module BABYLON {
         getBoundingInfo(): BoundingInfo;
         /**
          * Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
-         * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box
+         * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
+         * @param ignoreRotation ignore rotation when computing the scale (ie. object will be axis aligned). Default is false
          * @returns the current mesh
          */
-        normalizeToUnitCube(includeDescendants?: boolean): AbstractMesh;
+        normalizeToUnitCube(includeDescendants?: boolean, ignoreRotation?: boolean): AbstractMesh;
         /**
          * Overwrite the current bounding info
          * @param boundingInfo defines the new bounding info
@@ -83059,7 +83173,8 @@ declare module BABYLON {
          */
         isDisposed(): boolean;
         /**
-         * Gets or sets the parent of the node
+         * Gets or sets the parent of the node (without keeping the current position in the scene)
+         * @see https://doc.babylonjs.com/how_to/parenting
          */
         parent: Nullable<Node>;
         private addToSceneRootNodes;
@@ -85023,8 +85138,6 @@ declare module BABYLON {
         canUseTimestampForTimerQuery: boolean;
         /** Function used to let the system compiles shaders in background */
         parallelShaderCompile: {
-            MAX_SHADER_COMPILER_THREADS_KHR: number;
-            maxShaderCompilerThreadsKHR: (thread: number) => void;
             COMPLETION_STATUS_KHR: number;
         };
     }
@@ -85776,6 +85889,21 @@ declare module BABYLON {
          * Sets the current depth function to LESS
          */
         setDepthFunctionToLess(): void;
+        private _cachedStencilBuffer;
+        private _cachedStencilFunction;
+        private _cachedStencilMask;
+        private _cachedStencilOperationPass;
+        private _cachedStencilOperationFail;
+        private _cachedStencilOperationDepthFail;
+        private _cachedStencilReference;
+        /**
+         * Caches the the state of the stencil buffer
+         */
+        cacheStencilState(): void;
+        /**
+         * Restores the state of the stencil buffer
+         */
+        restoreStencilState(): void;
         /**
          * Sets the current depth function to LEQUAL
          */
@@ -91108,6 +91236,12 @@ declare module BABYLON {
          */
         getAnimationGroupByName(name: string): Nullable<AnimationGroup>;
         /**
+         * Get a material using its unique id
+         * @param uniqueId defines the material's unique id
+         * @return the material or null if none found.
+         */
+        getMaterialByUniqueID(uniqueId: number): Nullable<Material>;
+        /**
          * get a material using its id
          * @param id defines the material's ID
          * @return the material or null if none found.
@@ -91217,6 +91351,12 @@ declare module BABYLON {
          */
         getTransformNodeByID(id: string): Nullable<TransformNode>;
         /**
+         * Gets a transform node with its auto-generated unique id
+         * @param uniqueId efines the unique id to search for
+         * @return the found transform node or null if not found at all.
+         */
+        getTransformNodeByUniqueID(uniqueId: number): Nullable<TransformNode>;
+        /**
          * Gets a list of transform nodes using their id
          * @param id defines the id to search for
          * @returns a list of transform nodes
@@ -91271,6 +91411,12 @@ declare module BABYLON {
          */
         getLastSkeletonByID(id: string): Nullable<Skeleton>;
         /**
+         * Gets a skeleton using a given auto generated unique id
+         * @param  uniqueId defines the unique id to search for
+         * @return the found skeleton or null if not found at all.
+         */
+        getSkeletonByUniqueId(uniqueId: number): Nullable<Skeleton>;
+        /**
          * Gets a skeleton using a given id (if many are found, this function will pick the first one)
          * @param id defines the id to search for
          * @return the found skeleton or null if not found at all.
@@ -101983,7 +102129,21 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrFunctions: {
+    export var pbrFragmentExtraDeclaration: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrFragmentSamplersDeclaration: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrHelperFunctions: {
         name: string;
         shader: string;
     };
@@ -101997,21 +102157,35 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrPreLightingFunctions: {
+    export var pbrDirectLightingSetupFunctions: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrDirectLightingFalloffFunctions: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
+    export var pbrBRDFFunctions: {
         name: string;
         shader: string;
     };
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrFalloffLightingFunctions: {
+    export var pbrDirectLightingFunctions: {
         name: string;
         shader: string;
     };
 }
 declare module BABYLON {
     /** @hidden */
-    export var pbrLightingFunctions: {
+    export var pbrIBLFunctions: {
         name: string;
         shader: string;
     };
@@ -109302,6 +109476,16 @@ declare module BABYLON {
          */
         setBodyPositionIterations(impostor: PhysicsImpostor, positionIterations: number): void;
         /**
+        * Append an anchor to a soft object
+        * @param impostor soft impostor to add anchor to
+        * @param otherImpostor rigid impostor as the anchor
+        * @param width ratio across width from 0 to 1
+        * @param height ratio up height from 0 to 1
+        * @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, no strech
+        * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
+        */
+        appendAnchor(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, width: number, height: number, influence?: number, noCollisionBetweenLinkedBodies?: boolean): void;
+        /**
          * Sleeps the physics body and stops it from being active
          * @param impostor impostor to sleep
          */
@@ -112004,6 +112188,10 @@ declare module BABYLON {
      */
     export class OutlineRenderer implements ISceneComponent {
         /**
+         * Stencil value used to avoid outline being seen within the mesh when the mesh is transparent
+         */
+        private static _StencilReference;
+        /**
          * The name of the component. Each component must have a unique name.
          */
         name: string;

ファイルの差分が大きいため隠しています
+ 59 - 43
dist/preview release/viewer/babylon.viewer.js


ファイルの差分が大きいため隠しています
+ 3 - 3
dist/preview release/viewer/babylon.viewer.max.js


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

@@ -127,6 +127,7 @@
 - onActiveCameraChanged shouldn't be fired when rendering rig cameras ([TrevorDev](https://github.com/TrevorDev))
 - Added `MeshExploder` class ([danjpar](https://github.com/danjpar))
 - Observables can now make observers top or bottom priority ([TrevorDev](https://github.com/TrevorDev))
+- Mesh outline no longer is shown through the mesh when it's transparent ([TrevorDev](https://github.com/TrevorDev))
 
 ### OBJ Loader
 - Add color vertex support (not part of standard) ([brianzinn](https://github.com/brianzinn))

+ 13 - 1
inspector/src/components/actionTabs/tabs/toolsTabComponent.tsx

@@ -47,7 +47,7 @@ export class ToolsTabComponent extends PaneComponent {
     captureScreenshot() {
         const scene = this.props.scene;
         if (scene.activeCamera) {
-            Tools.CreateScreenshotUsingRenderTarget(scene.getEngine(), scene.activeCamera, { precision: 1.0 }, undefined, undefined, 4, true);
+            Tools.CreateScreenshot(scene.getEngine(), scene.activeCamera, { precision: 1.0 });
         }
     }
 
@@ -116,6 +116,14 @@ export class ToolsTabComponent extends PaneComponent {
             });
     }
 
+    resetReplay() {
+        this.props.globalState.recorder.reset();
+    }
+
+    exportReplay() {
+        this.props.globalState.recorder.export();
+    }
+
     render() {
         const scene = this.props.scene;
 
@@ -129,6 +137,10 @@ export class ToolsTabComponent extends PaneComponent {
                     <ButtonLineComponent label="Screenshot" onClick={() => this.captureScreenshot()} />
                     <ButtonLineComponent label={this.state.tag} onClick={() => this.recordVideo()} />
                 </LineContainerComponent>
+                <LineContainerComponent globalState={this.props.globalState} title="REPLAY">
+                    <ButtonLineComponent label="Generate replay code" onClick={() => this.exportReplay()} />
+                    <ButtonLineComponent label="Reset" onClick={() => this.resetReplay()} />
+                </LineContainerComponent>
                 <LineContainerComponent globalState={this.props.globalState} title="SCENE EXPORT">
                     <ButtonLineComponent label="Export to GLB" onClick={() => this.exportGLTF()} />
                     <ButtonLineComponent label="Export to Babylon" onClick={() => this.exportBabylon()} />

+ 11 - 0
inspector/src/components/globalState.ts

@@ -8,6 +8,7 @@ import { Scene } from "babylonjs/scene";
 import { Light } from "babylonjs/Lights/light";
 import { LightGizmo } from "babylonjs/Gizmos/lightGizmo";
 import { PropertyChangedEvent } from "./propertyChangedEvent";
+import { ReplayRecorder } from './replayRecorder';
 
 export class GlobalState {
     public onSelectionChangedObservable: Observable<any>;
@@ -26,6 +27,16 @@ export class GlobalState {
     public blockMutationUpdates = false;
     public selectedLineContainerTitle = "";
 
+    public recorder = new ReplayRecorder();
+
+    public init(propertyChangedObservable: Observable<PropertyChangedEvent>) {
+        this.onPropertyChangedObservable = propertyChangedObservable;
+
+        propertyChangedObservable.add(event => {
+            this.recorder.record(event);
+        })
+    }
+
     public prepareGLTFPlugin(loader: GLTFFileLoader) {
         var loaderState = this.glTFLoaderDefaults;
         if (loaderState !== undefined) {

+ 71 - 0
inspector/src/components/replayRecorder.ts

@@ -0,0 +1,71 @@
+import { PropertyChangedEvent } from './propertyChangedEvent';
+import { Tools } from 'babylonjs/Misc/tools';
+
+export class ReplayRecorder {
+    private _recordedCodeLines: string[];
+    private _previousObject: any;
+    private _previousProperty: string;
+
+    public reset() {
+        this._recordedCodeLines = [];
+        this._previousObject = null;
+        this._previousProperty = "";
+    }
+
+    public record(event: PropertyChangedEvent) {
+        if (!this._recordedCodeLines) {
+            this._recordedCodeLines = [];
+        }
+
+        if (this._previousObject === event.object && this._previousProperty === event.property) {
+            this._recordedCodeLines.pop();
+        }
+
+        let value = event.value;
+
+        if (value.w) { // Quaternion
+            value = `new BABYLON.Quaternion(${value.x}, ${value.y}, ${value.z}, ${value.w})`;
+        } else if (value.z) { // Vector3
+            value = `new BABYLON.Vector3(${value.x}, ${value.y}, ${value.z})`;
+        } else if (value.y) { // Vector2
+            value = `new BABYLON.Vector2(${value.x}, ${value.y})`;
+        } else if (value.a) { // Color4
+            value = `new BABYLON.Color4(${value.r}, ${value.g}, ${value.b}, ${value.a})`;
+        } else if (value.b) { // Color3
+            value = `new BABYLON.Color3(${value.r}, ${value.g}, ${value.b})`;
+        }
+
+        let target = event.object.getClassName().toLowerCase();
+
+        if (event.object.uniqueId) {
+            if (target.indexOf("camera")) {
+                target = `scene.getCameraByUniqueID(${event.object.uniqueId})`;
+            } else if (target.indexOf("mesh")) {
+                target = `scene.getMeshByUniqueID(${event.object.uniqueId})`;
+            } else if (target.indexOf("light")) {
+                target = `scene.getLightByUniqueID(${event.object.uniqueId})`;
+            } else if (target === "transformnode") {
+                target = `scene.getTransformNodeByUniqueID(${event.object.uniqueId})`;
+            } else if (target === "skeleton") {
+                target = `scene.getSkeletonByUniqueId(${event.object.uniqueId})`;
+            } else if (target.indexOf("material")) {
+                target = `scene.getMaterialByUniqueID(${event.object.uniqueId})`;
+            }
+        }
+
+        this._recordedCodeLines.push(`${target}.${event.property} = ${value};`);
+
+        this._previousObject = event.object;
+        this._previousProperty = event.property;
+    }
+
+    public export() {
+        let content = "// Code generated by babylon.js Inspector\r\n// Please keep in mind to define the 'scene' variable before using that code\r\n\r\n";
+
+        if (this._recordedCodeLines) {
+            content += this._recordedCodeLines.join("\r\n");
+        }
+
+        Tools.Download(new Blob([content]), "pseudo-code.txt");
+    }
+}

+ 1 - 1
inspector/src/inspector.ts

@@ -323,7 +323,7 @@ export class Inspector {
 
         // Prepare state
         if (!this._GlobalState.onPropertyChangedObservable) {
-            this._GlobalState.onPropertyChangedObservable = this.OnPropertyChangedObservable;
+            this._GlobalState.init(this.OnPropertyChangedObservable);
         }
         if (!this._GlobalState.onSelectionChangedObservable) {
             this._GlobalState.onSelectionChangedObservable = this.OnSelectionChangeObservable;

+ 3 - 2
loaders/src/glTF/2.0/Extensions/MSFT_audio_emitter.ts

@@ -10,6 +10,7 @@ import { WeightedSound } from "babylonjs/Audio/weightedsound";
 import { IArrayItem, IScene, INode, IAnimation } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
 import { GLTFLoader, ArrayItem } from "../glTFLoader";
+import { IProperty } from 'babylonjs-gltf2interface';
 
 const NAME = "MSFT_audio_emitter";
 
@@ -45,7 +46,7 @@ const enum AudioMimeType {
     WAV = "audio/wav",
 }
 
-interface IClip {
+interface IClip extends IProperty {
     uri?: string;
     bufferView?: number;
     mimeType?: AudioMimeType;
@@ -205,7 +206,7 @@ export class MSFT_audio_emitter implements IGLTFLoaderExtension {
 
         let promise: Promise<ArrayBufferView>;
         if (clip.uri) {
-            promise = this._loader.loadUriAsync(context, clip.uri);
+            promise = this._loader.loadUriAsync(context, clip, clip.uri);
         }
         else {
             const bufferView = ArrayItem.Get(`${context}/bufferView`, this._loader.gltf.bufferViews, clip.bufferView);

+ 4 - 3
loaders/src/glTF/2.0/Extensions/MSFT_lod.ts

@@ -8,6 +8,7 @@ import { Mesh } from "babylonjs/Meshes/mesh";
 import { INode, IMaterial } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
 import { GLTFLoader, ArrayItem } from "../glTFLoader";
+import { IProperty } from 'babylonjs-gltf2interface';
 
 const NAME = "MSFT_lod";
 
@@ -222,14 +223,14 @@ export class MSFT_lod implements IGLTFLoaderExtension {
     }
 
     /** @hidden */
-    public _loadUriAsync(context: string, uri: string): Nullable<Promise<ArrayBufferView>> {
+    public _loadUriAsync(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>> {
         // Defer the loading of uris if loading a material or node LOD.
         if (this._materialIndexLOD !== null) {
             this._loader.log(`deferred`);
             const previousIndexLOD = this._materialIndexLOD - 1;
             this._materialSignalLODs[previousIndexLOD] = this._materialSignalLODs[previousIndexLOD] || new Deferred<void>();
             return this._materialSignalLODs[previousIndexLOD].promise.then(() => {
-                return this._loader.loadUriAsync(context, uri);
+                return this._loader.loadUriAsync(context, property, uri);
             });
         }
         else if (this._nodeIndexLOD !== null) {
@@ -237,7 +238,7 @@ export class MSFT_lod implements IGLTFLoaderExtension {
             const previousIndexLOD = this._nodeIndexLOD - 1;
             this._nodeSignalLODs[previousIndexLOD] = this._nodeSignalLODs[previousIndexLOD] || new Deferred<void>();
             return this._nodeSignalLODs[this._nodeIndexLOD - 1].promise.then(() => {
-                return this._loader.loadUriAsync(context, uri);
+                return this._loader.loadUriAsync(context, property, uri);
             });
         }
 

+ 133 - 112
loaders/src/glTF/2.0/glTFLoader.ts

@@ -35,7 +35,9 @@ interface IFileRequestInfo extends IFileRequest {
 }
 
 interface ILoaderProperty extends IProperty {
-    _activeLoaderExtensions: any;
+    _activeLoaderExtensionFunctions: {
+        [id: string]: boolean
+    };
 }
 
 /**
@@ -74,12 +76,6 @@ export class ArrayItem {
  * The glTF 2.0 loader
  */
 export class GLTFLoader implements IGLTFLoader {
-    /** The glTF object parsed from the JSON. */
-    public gltf: IGLTF;
-
-    /** The Babylon scene when loading the asset. */
-    public babylonScene: Scene;
-
     /** @hidden */
     public _completePromises = new Array<Promise<any>>();
 
@@ -90,6 +86,8 @@ export class GLTFLoader implements IGLTFLoader {
     private _rootUrl: string;
     private _fileName: string;
     private _uniqueRootUrl: string;
+    private _gltf: IGLTF;
+    private _babylonScene: Scene;
     private _rootBabylonMesh: Mesh;
     private _defaultBabylonMaterialData: { [drawMode: number]: Material } = {};
     private _progressCallback?: (event: SceneLoaderProgressEvent) => void;
@@ -143,6 +141,27 @@ export class GLTFLoader implements IGLTFLoader {
         return this._state;
     }
 
+    /**
+     * The glTF object parsed from the JSON.
+     */
+    public get gltf(): IGLTF {
+        return this._gltf;
+    }
+
+    /**
+     * The Babylon scene when loading the asset.
+     */
+    public get babylonScene(): Scene {
+        return this._babylonScene;
+    }
+
+    /**
+     * The root Babylon mesh when loading the asset.
+     */
+    public get rootBabylonMesh(): Mesh {
+        return this._rootBabylonMesh;
+    }
+
     /** @hidden */
     constructor(parent: GLTFFileLoader) {
         this._parent = parent;
@@ -162,8 +181,6 @@ export class GLTFLoader implements IGLTFLoader {
 
         this._requests.length = 0;
 
-        delete this.gltf;
-        delete this.babylonScene;
         this._completePromises.length = 0;
 
         for (const name in this._extensions) {
@@ -175,6 +192,8 @@ export class GLTFLoader implements IGLTFLoader {
 
         this._extensions = {};
 
+        delete this._gltf;
+        delete this._babylonScene;
         delete this._rootBabylonMesh;
         delete this._progressCallback;
 
@@ -184,7 +203,7 @@ export class GLTFLoader implements IGLTFLoader {
     /** @hidden */
     public importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<{ meshes: AbstractMesh[], particleSystems: IParticleSystem[], skeletons: Skeleton[], animationGroups: AnimationGroup[] }> {
         return Promise.resolve().then(() => {
-            this.babylonScene = scene;
+            this._babylonScene = scene;
             this._rootUrl = rootUrl;
             this._fileName = fileName || "scene";
             this._progressCallback = onProgress;
@@ -194,8 +213,8 @@ export class GLTFLoader implements IGLTFLoader {
 
             if (meshesNames) {
                 const nodeMap: { [name: string]: number } = {};
-                if (this.gltf.nodes) {
-                    for (const node of this.gltf.nodes) {
+                if (this._gltf.nodes) {
+                    for (const node of this._gltf.nodes) {
                         if (node.name) {
                             nodeMap[node.name] = node.index;
                         }
@@ -227,7 +246,7 @@ export class GLTFLoader implements IGLTFLoader {
     /** @hidden */
     public loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<void> {
         return Promise.resolve().then(() => {
-            this.babylonScene = scene;
+            this._babylonScene = scene;
             this._rootUrl = rootUrl;
             this._fileName = fileName || "scene";
             this._progressCallback = onProgress;
@@ -257,8 +276,8 @@ export class GLTFLoader implements IGLTFLoader {
             if (nodes) {
                 promises.push(this.loadSceneAsync("/nodes", { nodes: nodes, index: -1 }));
             }
-            else if (this.gltf.scene != undefined) {
-                const scene = ArrayItem.Get(`/scene`, this.gltf.scenes, this.gltf.scene);
+            else if (this._gltf.scene != undefined) {
+                const scene = ArrayItem.Get(`/scene`, this._gltf.scenes, this._gltf.scene);
                 promises.push(this.loadSceneAsync(`/scenes/${scene.index}`, scene));
             }
 
@@ -321,11 +340,11 @@ export class GLTFLoader implements IGLTFLoader {
     }
 
     private _loadData(data: IGLTFLoaderData): void {
-        this.gltf = data.json as IGLTF;
+        this._gltf = data.json as IGLTF;
         this._setupData();
 
         if (data.bin) {
-            const buffers = this.gltf.buffers;
+            const buffers = this._gltf.buffers;
             if (buffers && buffers[0] && !buffers[0].uri) {
                 const binaryBuffer = buffers[0];
                 if (binaryBuffer.byteLength < data.bin.byteLength - 3 || binaryBuffer.byteLength > data.bin.byteLength) {
@@ -341,23 +360,23 @@ export class GLTFLoader implements IGLTFLoader {
     }
 
     private _setupData(): void {
-        ArrayItem.Assign(this.gltf.accessors);
-        ArrayItem.Assign(this.gltf.animations);
-        ArrayItem.Assign(this.gltf.buffers);
-        ArrayItem.Assign(this.gltf.bufferViews);
-        ArrayItem.Assign(this.gltf.cameras);
-        ArrayItem.Assign(this.gltf.images);
-        ArrayItem.Assign(this.gltf.materials);
-        ArrayItem.Assign(this.gltf.meshes);
-        ArrayItem.Assign(this.gltf.nodes);
-        ArrayItem.Assign(this.gltf.samplers);
-        ArrayItem.Assign(this.gltf.scenes);
-        ArrayItem.Assign(this.gltf.skins);
-        ArrayItem.Assign(this.gltf.textures);
-
-        if (this.gltf.nodes) {
+        ArrayItem.Assign(this._gltf.accessors);
+        ArrayItem.Assign(this._gltf.animations);
+        ArrayItem.Assign(this._gltf.buffers);
+        ArrayItem.Assign(this._gltf.bufferViews);
+        ArrayItem.Assign(this._gltf.cameras);
+        ArrayItem.Assign(this._gltf.images);
+        ArrayItem.Assign(this._gltf.materials);
+        ArrayItem.Assign(this._gltf.meshes);
+        ArrayItem.Assign(this._gltf.nodes);
+        ArrayItem.Assign(this._gltf.samplers);
+        ArrayItem.Assign(this._gltf.scenes);
+        ArrayItem.Assign(this._gltf.skins);
+        ArrayItem.Assign(this._gltf.textures);
+
+        if (this._gltf.nodes) {
             const nodeParents: { [index: number]: number } = {};
-            for (const node of this.gltf.nodes) {
+            for (const node of this._gltf.nodes) {
                 if (node.children) {
                     for (const index of node.children) {
                         nodeParents[index] = node.index;
@@ -366,9 +385,9 @@ export class GLTFLoader implements IGLTFLoader {
             }
 
             const rootNode = this._createRootNode();
-            for (const node of this.gltf.nodes) {
+            for (const node of this._gltf.nodes) {
                 const parentIndex = nodeParents[node.index];
-                node.parent = parentIndex === undefined ? rootNode : this.gltf.nodes[parentIndex];
+                node.parent = parentIndex === undefined ? rootNode : this._gltf.nodes[parentIndex];
             }
         }
     }
@@ -385,8 +404,8 @@ export class GLTFLoader implements IGLTFLoader {
     }
 
     private _checkExtensions(): void {
-        if (this.gltf.extensionsRequired) {
-            for (const name of this.gltf.extensionsRequired) {
+        if (this._gltf.extensionsRequired) {
+            for (const name of this._gltf.extensionsRequired) {
                 const extension = this._extensions[name];
                 if (!extension || !extension.enabled) {
                     throw new Error(`Require extension ${name} is not available`);
@@ -401,7 +420,7 @@ export class GLTFLoader implements IGLTFLoader {
     }
 
     private _createRootNode(): INode {
-        this._rootBabylonMesh = new Mesh("__root__", this.babylonScene);
+        this._rootBabylonMesh = new Mesh("__root__", this._babylonScene);
         this._rootBabylonMesh.setEnabled(false);
 
         const rootNode: INode = {
@@ -411,7 +430,7 @@ export class GLTFLoader implements IGLTFLoader {
 
         switch (this._parent.coordinateSystemMode) {
             case GLTFLoaderCoordinateSystemMode.AUTO: {
-                if (!this.babylonScene.useRightHandedSystem) {
+                if (!this._babylonScene.useRightHandedSystem) {
                     rootNode.rotation = [0, 1, 0, 0];
                     rootNode.scale = [1, 1, -1];
                     GLTFLoader._LoadTransform(rootNode, this._rootBabylonMesh);
@@ -419,7 +438,7 @@ export class GLTFLoader implements IGLTFLoader {
                 break;
             }
             case GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED: {
-                this.babylonScene.useRightHandedSystem = true;
+                this._babylonScene.useRightHandedSystem = true;
                 break;
             }
             default: {
@@ -449,7 +468,7 @@ export class GLTFLoader implements IGLTFLoader {
 
         if (scene.nodes) {
             for (let index of scene.nodes) {
-                const node = ArrayItem.Get(`${context}/nodes/${index}`, this.gltf.nodes, index);
+                const node = ArrayItem.Get(`${context}/nodes/${index}`, this._gltf.nodes, index);
                 promises.push(this.loadNodeAsync(`/nodes/${node.index}`, node, (babylonMesh) => {
                     babylonMesh.parent = this._rootBabylonMesh;
                 }));
@@ -458,8 +477,8 @@ export class GLTFLoader implements IGLTFLoader {
 
         // Link all Babylon bones for each glTF node with the corresponding Babylon transform node.
         // A glTF joint is a pointer to a glTF node in the glTF node hierarchy similar to Unity3D.
-        if (this.gltf.nodes) {
-            for (const node of this.gltf.nodes) {
+        if (this._gltf.nodes) {
+            for (const node of this._gltf.nodes) {
                 if (node._babylonTransformNode && node._babylonBones) {
                     for (const babylonBone of node._babylonBones) {
                         babylonBone.linkTransformNode(node._babylonTransformNode);
@@ -489,7 +508,7 @@ export class GLTFLoader implements IGLTFLoader {
         // Root mesh is always first.
         meshes.push(this._rootBabylonMesh);
 
-        const nodes = this.gltf.nodes;
+        const nodes = this._gltf.nodes;
         if (nodes) {
             for (const node of nodes) {
                 this._forEachPrimitive(node, (babylonMesh) => {
@@ -504,7 +523,7 @@ export class GLTFLoader implements IGLTFLoader {
     private _getSkeletons(): Skeleton[] {
         const skeletons = new Array<Skeleton>();
 
-        const skins = this.gltf.skins;
+        const skins = this._gltf.skins;
         if (skins) {
             for (const skin of skins) {
                 if (skin._data) {
@@ -519,7 +538,7 @@ export class GLTFLoader implements IGLTFLoader {
     private _getAnimationGroups(): AnimationGroup[] {
         const animationGroups = new Array<AnimationGroup>();
 
-        const animations = this.gltf.animations;
+        const animations = this._gltf.animations;
         if (animations) {
             for (const animation of animations) {
                 if (animation._babylonAnimationGroup) {
@@ -584,7 +603,7 @@ export class GLTFLoader implements IGLTFLoader {
             GLTFLoader._LoadTransform(node, babylonTransformNode);
 
             if (node.camera != undefined) {
-                const camera = ArrayItem.Get(`${context}/camera`, this.gltf.cameras, node.camera);
+                const camera = ArrayItem.Get(`${context}/camera`, this._gltf.cameras, node.camera);
                 promises.push(this.loadCameraAsync(`/cameras/${camera.index}`, camera, (babylonCamera) => {
                     babylonCamera.parent = babylonTransformNode;
                 }));
@@ -592,7 +611,7 @@ export class GLTFLoader implements IGLTFLoader {
 
             if (node.children) {
                 for (const index of node.children) {
-                    const childNode = ArrayItem.Get(`${context}/children/${index}`, this.gltf.nodes, index);
+                    const childNode = ArrayItem.Get(`${context}/children/${index}`, this._gltf.nodes, index);
                     promises.push(this.loadNodeAsync(`/nodes/${childNode.index}`, childNode, (childBabylonMesh) => {
                         childBabylonMesh.parent = babylonTransformNode;
                     }));
@@ -604,11 +623,11 @@ export class GLTFLoader implements IGLTFLoader {
 
         if (node.mesh == undefined) {
             const nodeName = node.name || `node${node.index}`;
-            node._babylonTransformNode = new TransformNode(nodeName, this.babylonScene);
+            node._babylonTransformNode = new TransformNode(nodeName, this._babylonScene);
             loadNode(node._babylonTransformNode);
         }
         else {
-            const mesh = ArrayItem.Get(`${context}/mesh`, this.gltf.meshes, node.mesh);
+            const mesh = ArrayItem.Get(`${context}/mesh`, this._gltf.meshes, node.mesh);
             promises.push(this._loadMeshAsync(`/meshes/${mesh.index}`, node, mesh, loadNode));
         }
 
@@ -647,7 +666,7 @@ export class GLTFLoader implements IGLTFLoader {
             }));
         }
         else {
-            node._babylonTransformNode = new TransformNode(name, this.babylonScene);
+            node._babylonTransformNode = new TransformNode(name, this._babylonScene);
             node._primitiveBabylonMeshes = [];
             for (const primitive of primitives) {
                 promises.push(this._loadMeshPrimitiveAsync(`${context}/primitives/${primitive.index}`, `${name}_primitive${primitive.index}`, node, mesh, primitive, (babylonMesh) => {
@@ -658,7 +677,7 @@ export class GLTFLoader implements IGLTFLoader {
         }
 
         if (node.skin != undefined) {
-            const skin = ArrayItem.Get(`${context}/skin`, this.gltf.skins, node.skin);
+            const skin = ArrayItem.Get(`${context}/skin`, this._gltf.skins, node.skin);
             promises.push(this._loadSkinAsync(`/skins/${skin.index}`, node, skin));
         }
 
@@ -687,7 +706,7 @@ export class GLTFLoader implements IGLTFLoader {
         else {
             const promises = new Array<Promise<any>>();
 
-            const babylonMesh = new Mesh(name, this.babylonScene);
+            const babylonMesh = new Mesh(name, this._babylonScene);
 
             this._createMorphTargets(context, node, mesh, primitive, babylonMesh);
             promises.push(this._loadVertexDataAsync(context, primitive, babylonMesh).then((babylonGeometry) => {
@@ -707,7 +726,7 @@ export class GLTFLoader implements IGLTFLoader {
                 babylonMesh.material = babylonMaterial;
             }
             else {
-                const material = ArrayItem.Get(`${context}/material`, this.gltf.materials, primitive.material);
+                const material = ArrayItem.Get(`${context}/material`, this._gltf.materials, primitive.material);
                 promises.push(this._loadMaterialAsync(`/materials/${material.index}`, material, babylonMesh, babylonDrawMode, (babylonMaterial) => {
                     babylonMesh.material = babylonMaterial;
                 }));
@@ -749,13 +768,13 @@ export class GLTFLoader implements IGLTFLoader {
 
         const promises = new Array<Promise<any>>();
 
-        const babylonGeometry = new Geometry(babylonMesh.name, this.babylonScene);
+        const babylonGeometry = new Geometry(babylonMesh.name, this._babylonScene);
 
         if (primitive.indices == undefined) {
             babylonMesh.isUnIndexed = true;
         }
         else {
-            const accessor = ArrayItem.Get(`${context}/indices`, this.gltf.accessors, primitive.indices);
+            const accessor = ArrayItem.Get(`${context}/indices`, this._gltf.accessors, primitive.indices);
             promises.push(this._loadIndicesAccessorAsync(`/accessors/${accessor.index}`, accessor).then((data) => {
                 babylonGeometry.setIndices(data);
             }));
@@ -771,7 +790,7 @@ export class GLTFLoader implements IGLTFLoader {
                 babylonMesh._delayInfo.push(kind);
             }
 
-            const accessor = ArrayItem.Get(`${context}/attributes/${attribute}`, this.gltf.accessors, attributes[attribute]);
+            const accessor = ArrayItem.Get(`${context}/attributes/${attribute}`, this._gltf.accessors, attributes[attribute]);
             promises.push(this._loadVertexAccessorAsync(`/accessors/${accessor.index}`, accessor, kind).then((babylonVertexBuffer) => {
                 babylonGeometry.setVerticesBuffer(babylonVertexBuffer, accessor.count);
             }));
@@ -848,7 +867,7 @@ export class GLTFLoader implements IGLTFLoader {
                 return;
             }
 
-            const accessor = ArrayItem.Get(`${context}/${attribute}`, this.gltf.accessors, attributes[attribute]);
+            const accessor = ArrayItem.Get(`${context}/${attribute}`, this._gltf.accessors, attributes[attribute]);
             promises.push(this._loadFloatAccessorAsync(`/accessors/${accessor.index}`, accessor).then((data) => {
                 setData(babylonVertexBuffer, data);
             }));
@@ -925,7 +944,7 @@ export class GLTFLoader implements IGLTFLoader {
         }
 
         const skeletonId = `skeleton${skin.index}`;
-        const babylonSkeleton = new Skeleton(skin.name || skeletonId, skeletonId, this.babylonScene);
+        const babylonSkeleton = new Skeleton(skin.name || skeletonId, skeletonId, this._babylonScene);
 
         // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
         babylonSkeleton.overrideMesh = this._rootBabylonMesh;
@@ -948,7 +967,7 @@ export class GLTFLoader implements IGLTFLoader {
     private _loadBones(context: string, skin: ISkin, babylonSkeleton: Skeleton): void {
         const babylonBones: { [index: number]: Bone } = {};
         for (const index of skin.joints) {
-            const node = ArrayItem.Get(`${context}/joints/${index}`, this.gltf.nodes, index);
+            const node = ArrayItem.Get(`${context}/joints/${index}`, this._gltf.nodes, index);
             this._loadBone(node, skin, babylonSkeleton, babylonBones);
         }
     }
@@ -980,7 +999,7 @@ export class GLTFLoader implements IGLTFLoader {
             return Promise.resolve(null);
         }
 
-        const accessor = ArrayItem.Get(`${context}/inverseBindMatrices`, this.gltf.accessors, skin.inverseBindMatrices);
+        const accessor = ArrayItem.Get(`${context}/inverseBindMatrices`, this._gltf.accessors, skin.inverseBindMatrices);
         return this._loadFloatAccessorAsync(`/accessors/${accessor.index}`, accessor);
     }
 
@@ -1029,7 +1048,7 @@ export class GLTFLoader implements IGLTFLoader {
 
         this.logOpen(`${context} ${camera.name || ""}`);
 
-        const babylonCamera = new FreeCamera(camera.name || `camera${camera.index}`, Vector3.Zero(), this.babylonScene, false);
+        const babylonCamera = new FreeCamera(camera.name || `camera${camera.index}`, Vector3.Zero(), this._babylonScene, false);
         babylonCamera.rotation = new Vector3(0, Math.PI, 0);
 
         switch (camera.type) {
@@ -1073,7 +1092,7 @@ export class GLTFLoader implements IGLTFLoader {
     }
 
     private _loadAnimationsAsync(): Promise<void> {
-        const animations = this.gltf.animations;
+        const animations = this._gltf.animations;
         if (!animations) {
             return Promise.resolve();
         }
@@ -1100,7 +1119,7 @@ export class GLTFLoader implements IGLTFLoader {
             return promise;
         }
 
-        const babylonAnimationGroup = new AnimationGroup(animation.name || `animation${animation.index}`, this.babylonScene);
+        const babylonAnimationGroup = new AnimationGroup(animation.name || `animation${animation.index}`, this._babylonScene);
         animation._babylonAnimationGroup = babylonAnimationGroup;
 
         const promises = new Array<Promise<any>>();
@@ -1123,7 +1142,7 @@ export class GLTFLoader implements IGLTFLoader {
             return Promise.resolve();
         }
 
-        const targetNode = ArrayItem.Get(`${context}/target/node`, this.gltf.nodes, channel.target.node);
+        const targetNode = ArrayItem.Get(`${context}/target/node`, this._gltf.nodes, channel.target.node);
 
         // Ignore animations that have no animation targets.
         if ((channel.target.path === AnimationChannelTargetPath.WEIGHTS && !targetNode._numMorphTargets) ||
@@ -1281,8 +1300,8 @@ export class GLTFLoader implements IGLTFLoader {
             }
         }
 
-        const inputAccessor = ArrayItem.Get(`${context}/input`, this.gltf.accessors, sampler.input);
-        const outputAccessor = ArrayItem.Get(`${context}/output`, this.gltf.accessors, sampler.output);
+        const inputAccessor = ArrayItem.Get(`${context}/input`, this._gltf.accessors, sampler.input);
+        const outputAccessor = ArrayItem.Get(`${context}/output`, this._gltf.accessors, sampler.output);
         sampler._data = Promise.all([
             this._loadFloatAccessorAsync(`/accessors/${inputAccessor.index}`, inputAccessor),
             this._loadFloatAccessorAsync(`/accessors/${outputAccessor.index}`, outputAccessor)
@@ -1306,7 +1325,7 @@ export class GLTFLoader implements IGLTFLoader {
             throw new Error(`${context}/uri: Value is missing`);
         }
 
-        buffer._data = this.loadUriAsync(`${context}/uri`, buffer.uri);
+        buffer._data = this.loadUriAsync(`${context}/uri`, buffer, buffer.uri);
 
         return buffer._data;
     }
@@ -1322,7 +1341,7 @@ export class GLTFLoader implements IGLTFLoader {
             return bufferView._data;
         }
 
-        const buffer = ArrayItem.Get(`${context}/buffer`, this.gltf.buffers, bufferView.buffer);
+        const buffer = ArrayItem.Get(`${context}/buffer`, this._gltf.buffers, bufferView.buffer);
         bufferView._data = this._loadBufferAsync(`/buffers/${buffer.index}`, buffer).then((data) => {
             try {
                 return new Uint8Array(data.buffer, data.byteOffset + (bufferView.byteOffset || 0), bufferView.byteLength);
@@ -1350,7 +1369,7 @@ export class GLTFLoader implements IGLTFLoader {
             return accessor._data as Promise<IndicesArray>;
         }
 
-        const bufferView = ArrayItem.Get(`${context}/bufferView`, this.gltf.bufferViews, accessor.bufferView);
+        const bufferView = ArrayItem.Get(`${context}/bufferView`, this._gltf.bufferViews, accessor.bufferView);
         accessor._data = this.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView).then((data) => {
             return GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, accessor.count);
         });
@@ -1376,7 +1395,7 @@ export class GLTFLoader implements IGLTFLoader {
             accessor._data = Promise.resolve(new Float32Array(length));
         }
         else {
-            const bufferView = ArrayItem.Get(`${context}/bufferView`, this.gltf.bufferViews, accessor.bufferView);
+            const bufferView = ArrayItem.Get(`${context}/bufferView`, this._gltf.bufferViews, accessor.bufferView);
             accessor._data = this.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView).then((data) => {
                 return GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, length);
             });
@@ -1386,8 +1405,8 @@ export class GLTFLoader implements IGLTFLoader {
             const sparse = accessor.sparse;
             accessor._data = accessor._data.then((view: ArrayBufferView) => {
                 const data = view as Float32Array;
-                const indicesBufferView = ArrayItem.Get(`${context}/sparse/indices/bufferView`, this.gltf.bufferViews, sparse.indices.bufferView);
-                const valuesBufferView = ArrayItem.Get(`${context}/sparse/values/bufferView`, this.gltf.bufferViews, sparse.values.bufferView);
+                const indicesBufferView = ArrayItem.Get(`${context}/sparse/indices/bufferView`, this._gltf.bufferViews, sparse.indices.bufferView);
+                const valuesBufferView = ArrayItem.Get(`${context}/sparse/values/bufferView`, this._gltf.bufferViews, sparse.values.bufferView);
                 return Promise.all([
                     this.loadBufferViewAsync(`/bufferViews/${indicesBufferView.index}`, indicesBufferView),
                     this.loadBufferViewAsync(`/bufferViews/${valuesBufferView.index}`, valuesBufferView)
@@ -1417,7 +1436,7 @@ export class GLTFLoader implements IGLTFLoader {
         }
 
         bufferView._babylonBuffer = this.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView).then((data) => {
-            return new Buffer(this.babylonScene.getEngine(), data, false);
+            return new Buffer(this._babylonScene.getEngine(), data, false);
         });
 
         return bufferView._babylonBuffer;
@@ -1430,21 +1449,21 @@ export class GLTFLoader implements IGLTFLoader {
 
         if (accessor.sparse) {
             accessor._babylonVertexBuffer = this._loadFloatAccessorAsync(`/accessors/${accessor.index}`, accessor).then((data) => {
-                return new VertexBuffer(this.babylonScene.getEngine(), data, kind, false);
+                return new VertexBuffer(this._babylonScene.getEngine(), data, kind, false);
             });
         }
         // HACK: If byte offset is not a multiple of component type byte length then load as a float array instead of using Babylon buffers.
         else if (accessor.byteOffset && accessor.byteOffset % VertexBuffer.GetTypeByteLength(accessor.componentType) !== 0) {
             Tools.Warn("Accessor byte offset is not a multiple of component type byte length");
             accessor._babylonVertexBuffer = this._loadFloatAccessorAsync(`/accessors/${accessor.index}`, accessor).then((data) => {
-                return new VertexBuffer(this.babylonScene.getEngine(), data, kind, false);
+                return new VertexBuffer(this._babylonScene.getEngine(), data, kind, false);
             });
         }
         else {
-            const bufferView = ArrayItem.Get(`${context}/bufferView`, this.gltf.bufferViews, accessor.bufferView);
+            const bufferView = ArrayItem.Get(`${context}/bufferView`, this._gltf.bufferViews, accessor.bufferView);
             accessor._babylonVertexBuffer = this._loadVertexBufferViewAsync(bufferView, kind).then((babylonBuffer) => {
                 const size = GLTFLoader._GetNumComponents(context, accessor.type);
-                return new VertexBuffer(this.babylonScene.getEngine(), babylonBuffer, kind, false, false, bufferView.byteStride,
+                return new VertexBuffer(this._babylonScene.getEngine(), babylonBuffer, kind, false, false, bufferView.byteStride,
                     false, accessor.byteOffset, size, accessor.componentType, accessor.normalized, true);
             });
         }
@@ -1538,8 +1557,8 @@ export class GLTFLoader implements IGLTFLoader {
     }
 
     private _createDefaultMaterial(name: string, babylonDrawMode: number): Material {
-        const babylonMaterial = new PBRMaterial(name, this.babylonScene);
-        babylonMaterial.sideOrientation = this.babylonScene.useRightHandedSystem ? Material.CounterClockWiseSideOrientation : Material.ClockWiseSideOrientation;
+        const babylonMaterial = new PBRMaterial(name, this._babylonScene);
+        babylonMaterial.sideOrientation = this._babylonScene.useRightHandedSystem ? Material.CounterClockWiseSideOrientation : Material.ClockWiseSideOrientation;
         babylonMaterial.fillMode = babylonDrawMode;
         babylonMaterial.enableSpecularAntiAliasing = true;
         babylonMaterial.useRadianceOverAlpha = !this._parent.transparencyAsCoverage;
@@ -1621,8 +1640,8 @@ export class GLTFLoader implements IGLTFLoader {
                 babylonMaterial.bumpTexture = texture;
             }));
 
-            babylonMaterial.invertNormalMapX = !this.babylonScene.useRightHandedSystem;
-            babylonMaterial.invertNormalMapY = this.babylonScene.useRightHandedSystem;
+            babylonMaterial.invertNormalMapX = !this._babylonScene.useRightHandedSystem;
+            babylonMaterial.invertNormalMapY = this._babylonScene.useRightHandedSystem;
             if (material.normalTexture.scale != undefined) {
                 babylonMaterial.bumpTexture.level = material.normalTexture.scale;
             }
@@ -1707,7 +1726,7 @@ export class GLTFLoader implements IGLTFLoader {
 
         this.logOpen(`${context}`);
 
-        const texture = ArrayItem.Get(`${context}/index`, this.gltf.textures, textureInfo.index);
+        const texture = ArrayItem.Get(`${context}/index`, this._gltf.textures, textureInfo.index);
         const promise = this._loadTextureAsync(`/textures/${textureInfo.index}`, texture, (babylonTexture) => {
             babylonTexture.coordinatesIndex = textureInfo.texCoord || 0;
 
@@ -1726,23 +1745,23 @@ export class GLTFLoader implements IGLTFLoader {
 
         this.logOpen(`${context} ${texture.name || ""}`);
 
-        const sampler = (texture.sampler == undefined ? GLTFLoader._DefaultSampler : ArrayItem.Get(`${context}/sampler`, this.gltf.samplers, texture.sampler));
+        const sampler = (texture.sampler == undefined ? GLTFLoader._DefaultSampler : ArrayItem.Get(`${context}/sampler`, this._gltf.samplers, texture.sampler));
         const samplerData = this._loadSampler(`/samplers/${sampler.index}`, sampler);
 
-        const image = ArrayItem.Get(`${context}/source`, this.gltf.images, texture.source);
+        const image = ArrayItem.Get(`${context}/source`, this._gltf.images, texture.source);
         let url: Nullable<string> = null;
         if (image.uri) {
             if (Tools.IsBase64(image.uri)) {
                 url = image.uri;
             }
-            else if (this.babylonScene.getEngine().textureFormatInUse) {
+            else if (this._babylonScene.getEngine().textureFormatInUse) {
                 // If an image uri and a texture format is set like (eg. KTX) load from url instead of blob to support texture format and fallback
                 url = this._rootUrl + image.uri;
             }
         }
 
         const deferred = new Deferred<void>();
-        const babylonTexture = new Texture(url, this.babylonScene, samplerData.noMipMaps, false, samplerData.samplingMode, () => {
+        const babylonTexture = new Texture(url, this._babylonScene, samplerData.noMipMaps, false, samplerData.samplingMode, () => {
             if (!this._disposed) {
                 deferred.resolve();
             }
@@ -1796,10 +1815,10 @@ export class GLTFLoader implements IGLTFLoader {
             this.logOpen(`${context} ${image.name || ""}`);
 
             if (image.uri) {
-                image._data = this.loadUriAsync(`${context}/uri`, image.uri);
+                image._data = this.loadUriAsync(`${context}/uri`, image, image.uri);
             }
             else {
-                const bufferView = ArrayItem.Get(`${context}/bufferView`, this.gltf.bufferViews, image.bufferView);
+                const bufferView = ArrayItem.Get(`${context}/bufferView`, this._gltf.bufferViews, image.bufferView);
                 image._data = this.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView);
             }
 
@@ -1812,11 +1831,12 @@ export class GLTFLoader implements IGLTFLoader {
     /**
      * Loads a glTF uri.
      * @param context The context when loading the asset
+     * @param property The glTF property associated with the uri
      * @param uri The base64 or relative uri
      * @returns A promise that resolves with the loaded data when the load is complete
      */
-    public loadUriAsync(context: string, uri: string): Promise<ArrayBufferView> {
-        const extensionPromise = this._extensionsLoadUriAsync(context, uri);
+    public loadUriAsync(context: string, property: IProperty, uri: string): Promise<ArrayBufferView> {
+        const extensionPromise = this._extensionsLoadUriAsync(context, property, uri);
         if (extensionPromise) {
             return extensionPromise;
         }
@@ -1859,7 +1879,7 @@ export class GLTFLoader implements IGLTFLoader {
                                 }
                             }
                         }
-                    }, this.babylonScene.offlineProvider, true, (request, exception) => {
+                    }, this._babylonScene.offlineProvider, true, (request, exception) => {
                         if (!this._disposed) {
                             reject(new LoadFileError(`${context}: Failed to load '${uri}'${request ? ": " + request.status + " " + request.statusText : ""}`, request));
                         }
@@ -2016,8 +2036,8 @@ export class GLTFLoader implements IGLTFLoader {
 
         const promises = new Array<Promise<any>>();
 
-        if (this.gltf.materials) {
-            for (const material of this.gltf.materials) {
+        if (this._gltf.materials) {
+            for (const material of this._gltf.materials) {
                 if (material._data) {
                     for (const babylonDrawMode in material._data) {
                         const babylonData = material._data[babylonDrawMode];
@@ -2046,7 +2066,7 @@ export class GLTFLoader implements IGLTFLoader {
 
         const promises = new Array<Promise<any>>();
 
-        const lights = this.babylonScene.lights;
+        const lights = this._babylonScene.lights;
         for (let light of lights) {
             let generator = light.getShadowGenerator();
             if (generator) {
@@ -2068,15 +2088,16 @@ export class GLTFLoader implements IGLTFLoader {
         }
     }
 
-    private _applyExtensions<T>(property: IProperty, actionAsync: (extension: IGLTFLoaderExtension) => Nullable<T> | undefined): Nullable<T> {
+    private _applyExtensions<T>(property: IProperty, functionName: string, actionAsync: (extension: IGLTFLoaderExtension) => Nullable<T> | undefined): Nullable<T> {
         for (const name of GLTFLoader._ExtensionNames) {
             const extension = this._extensions[name];
             if (extension.enabled) {
+                const id = `${name}.${functionName}`;
                 const loaderProperty = property as ILoaderProperty;
-                loaderProperty._activeLoaderExtensions = loaderProperty._activeLoaderExtensions || {};
-                const activeLoaderExtensions = loaderProperty._activeLoaderExtensions;
-                if (!activeLoaderExtensions[name]) {
-                    activeLoaderExtensions[name] = true;
+                loaderProperty._activeLoaderExtensionFunctions = loaderProperty._activeLoaderExtensionFunctions || {};
+                const activeLoaderExtensionFunctions = loaderProperty._activeLoaderExtensionFunctions;
+                if (!activeLoaderExtensionFunctions[id]) {
+                    activeLoaderExtensionFunctions[id] = true;
 
                     try {
                         const result = actionAsync(extension);
@@ -2085,7 +2106,7 @@ export class GLTFLoader implements IGLTFLoader {
                         }
                     }
                     finally {
-                        delete activeLoaderExtensions[name];
+                        delete activeLoaderExtensionFunctions[id];
                     }
                 }
             }
@@ -2103,43 +2124,43 @@ export class GLTFLoader implements IGLTFLoader {
     }
 
     private _extensionsLoadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>> {
-        return this._applyExtensions(scene, (extension) => extension.loadSceneAsync && extension.loadSceneAsync(context, scene));
+        return this._applyExtensions(scene, "loadScene", (extension) => extension.loadSceneAsync && extension.loadSceneAsync(context, scene));
     }
 
     private _extensionsLoadNodeAsync(context: string, node: INode, assign: (babylonTransformNode: TransformNode) => void): Nullable<Promise<TransformNode>> {
-        return this._applyExtensions(node, (extension) => extension.loadNodeAsync && extension.loadNodeAsync(context, node, assign));
+        return this._applyExtensions(node, "loadNode", (extension) => extension.loadNodeAsync && extension.loadNodeAsync(context, node, assign));
     }
 
     private _extensionsLoadCameraAsync(context: string, camera: ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>> {
-        return this._applyExtensions(camera, (extension) => extension.loadCameraAsync && extension.loadCameraAsync(context, camera, assign));
+        return this._applyExtensions(camera, "loadCamera", (extension) => extension.loadCameraAsync && extension.loadCameraAsync(context, camera, assign));
     }
 
     private _extensionsLoadVertexDataAsync(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>> {
-        return this._applyExtensions(primitive, (extension) => extension._loadVertexDataAsync && extension._loadVertexDataAsync(context, primitive, babylonMesh));
+        return this._applyExtensions(primitive, "loadVertexData", (extension) => extension._loadVertexDataAsync && extension._loadVertexDataAsync(context, primitive, babylonMesh));
     }
 
     private _extensionsLoadMaterialAsync(context: string, material: IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>> {
-        return this._applyExtensions(material, (extension) => extension._loadMaterialAsync && extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign));
+        return this._applyExtensions(material, "loadMaterial", (extension) => extension._loadMaterialAsync && extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign));
     }
 
     private _extensionsCreateMaterial(context: string, material: IMaterial, babylonDrawMode: number): Nullable<Material> {
-        return this._applyExtensions({}, (extension) => extension.createMaterial && extension.createMaterial(context, material, babylonDrawMode));
+        return this._applyExtensions(material, "createMaterial", (extension) => extension.createMaterial && extension.createMaterial(context, material, babylonDrawMode));
     }
 
     private _extensionsLoadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {
-        return this._applyExtensions(material, (extension) => extension.loadMaterialPropertiesAsync && extension.loadMaterialPropertiesAsync(context, material, babylonMaterial));
+        return this._applyExtensions(material, "loadMaterialProperties", (extension) => extension.loadMaterialPropertiesAsync && extension.loadMaterialPropertiesAsync(context, material, babylonMaterial));
     }
 
     private _extensionsLoadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>> {
-        return this._applyExtensions(textureInfo, (extension) => extension.loadTextureInfoAsync && extension.loadTextureInfoAsync(context, textureInfo, assign));
+        return this._applyExtensions(textureInfo, "loadTextureInfo", (extension) => extension.loadTextureInfoAsync && extension.loadTextureInfoAsync(context, textureInfo, assign));
     }
 
     private _extensionsLoadAnimationAsync(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>> {
-        return this._applyExtensions(animation, (extension) => extension.loadAnimationAsync && extension.loadAnimationAsync(context, animation));
+        return this._applyExtensions(animation, "loadAnimation", (extension) => extension.loadAnimationAsync && extension.loadAnimationAsync(context, animation));
     }
 
-    private _extensionsLoadUriAsync(context: string, uri: string): Nullable<Promise<ArrayBufferView>> {
-        return this._applyExtensions({}, (extension) => extension._loadUriAsync && extension._loadUriAsync(context, uri));
+    private _extensionsLoadUriAsync(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>> {
+        return this._applyExtensions(property, "loadUri", (extension) => extension._loadUriAsync && extension._loadUriAsync(context, property, uri));
     }
 
     /**

+ 3 - 1
loaders/src/glTF/2.0/glTFLoaderExtension.ts

@@ -10,6 +10,7 @@ import { IDisposable } from "babylonjs/scene";
 
 import { IScene, INode, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation } from "./glTFLoaderInterfaces";
 import { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from "../glTFFileLoader";
+import { IProperty } from 'babylonjs-gltf2interface';
 
 /**
  * Interface for a glTF loader extension.
@@ -106,8 +107,9 @@ export interface IGLTFLoaderExtension extends IGLTFBaseLoaderExtension, IDisposa
     /**
      * Define this method to modify the default behavior when loading uris.
      * @param context The context when loading the asset
+     * @param property The glTF property associated with the uri
      * @param uri The uri to load
      * @returns A promise that resolves with the loaded data when the load is complete or null if not handled
      */
-    _loadUriAsync?(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
+    _loadUriAsync?(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>>;
 }

+ 9 - 0
src/Bones/skeleton.ts

@@ -58,6 +58,7 @@ export class Skeleton implements IAnimatable {
     private _lastAbsoluteTransformsUpdateId = -1;
 
     private _canUseTextureForBones = false;
+    private _uniqueId = 0;
 
     /** @hidden */
     public _numBonesWithLinkedTransformNode = 0;
@@ -118,6 +119,13 @@ export class Skeleton implements IAnimatable {
     }
 
     /**
+     * Gets the unique ID of this skeleton
+     */
+    public get uniqueId(): number {
+        return this._uniqueId;
+    }
+
+    /**
      * Creates a new skeleton
      * @param name defines the skeleton name
      * @param id defines the skeleton Id
@@ -131,6 +139,7 @@ export class Skeleton implements IAnimatable {
         this.bones = [];
 
         this._scene = scene || EngineStore.LastCreatedScene;
+        this._uniqueId = this._scene.getUniqueId();
 
         this._scene.addSkeleton(this);
 

+ 34 - 0
src/Engines/engine.ts

@@ -1771,6 +1771,40 @@ export class Engine {
         this._depthCullingState.depthFunc = this._gl.LESS;
     }
 
+    private _cachedStencilBuffer: boolean;
+    private _cachedStencilFunction: number;
+    private _cachedStencilMask: number;
+    private _cachedStencilOperationPass: number;
+    private _cachedStencilOperationFail: number;
+    private _cachedStencilOperationDepthFail: number;
+    private _cachedStencilReference: number;
+
+    /**
+     * Caches the the state of the stencil buffer
+     */
+    public cacheStencilState() {
+        this._cachedStencilBuffer = this.getStencilBuffer();
+        this._cachedStencilFunction = this.getStencilFunction();
+        this._cachedStencilMask = this.getStencilMask();
+        this._cachedStencilOperationPass = this.getStencilOperationPass();
+        this._cachedStencilOperationFail = this.getStencilOperationFail();
+        this._cachedStencilOperationDepthFail = this.getStencilOperationDepthFail();
+        this._cachedStencilReference = this.getStencilFunctionReference();
+    }
+
+    /**
+     * Restores the state of the stencil buffer
+     */
+    public restoreStencilState() {
+        this.setStencilFunction(this._cachedStencilFunction);
+        this.setStencilMask(this._cachedStencilMask);
+        this.setStencilBuffer(this._cachedStencilBuffer);
+        this.setStencilOperationPass(this._cachedStencilOperationPass);
+        this.setStencilOperationFail(this._cachedStencilOperationFail);
+        this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail);
+        this.setStencilFunctionReference(this._cachedStencilReference);
+    }
+
     /**
      * Sets the current depth function to LEQUAL
      */

+ 2 - 14
src/Layers/highlightLayer.ts

@@ -456,13 +456,7 @@ export class HighlightLayer extends EffectLayer {
 
         // Cache
         var engine = this._engine;
-        var previousStencilBuffer = engine.getStencilBuffer();
-        var previousStencilFunction = engine.getStencilFunction();
-        var previousStencilMask = engine.getStencilMask();
-        var previousStencilOperationPass = engine.getStencilOperationPass();
-        var previousStencilOperationFail = engine.getStencilOperationFail();
-        var previousStencilOperationDepthFail = engine.getStencilOperationDepthFail();
-        var previousStencilReference = engine.getStencilFunctionReference();
+        engine.cacheStencilState();
 
         // Stencil operations
         engine.setStencilOperationPass(Constants.REPLACE);
@@ -487,13 +481,7 @@ export class HighlightLayer extends EffectLayer {
         }
 
         // Restore Cache
-        engine.setStencilFunction(previousStencilFunction);
-        engine.setStencilMask(previousStencilMask);
-        engine.setStencilBuffer(previousStencilBuffer);
-        engine.setStencilOperationPass(previousStencilOperationPass);
-        engine.setStencilOperationFail(previousStencilOperationFail);
-        engine.setStencilOperationDepthFail(previousStencilOperationDepthFail);
-        engine.setStencilFunctionReference(previousStencilReference);
+        engine.restoreStencilState();
     }
 
     /**

+ 24 - 2
src/Meshes/abstractMesh.ts

@@ -944,10 +944,24 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
 
     /**
      * Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
-     * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box
+     * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
+     * @param ignoreRotation ignore rotation when computing the scale (ie. object will be axis aligned). Default is false
      * @returns the current mesh
      */
-    public normalizeToUnitCube(includeDescendants = true): AbstractMesh {
+    public normalizeToUnitCube(includeDescendants = true, ignoreRotation = false): AbstractMesh {
+        let storedRotation: Nullable<Vector3> = null;
+        let storedRotationQuaternion: Nullable<Quaternion> = null;
+
+        if (ignoreRotation) {
+            if (this.rotationQuaternion) {
+                storedRotationQuaternion = this.rotationQuaternion.clone();
+                this.rotationQuaternion.copyFromFloats(0, 0, 0, 1);
+            } else if (this.rotation) {
+                storedRotation = this.rotation.clone();
+                this.rotation.copyFromFloats(0, 0, 0);
+            }
+        }
+
         let boundingVectors = this.getHierarchyBoundingVectors(includeDescendants);
         let sizeVec = boundingVectors.max.subtract(boundingVectors.min);
         let maxDimension = Math.max(sizeVec.x, sizeVec.y, sizeVec.z);
@@ -960,6 +974,14 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
 
         this.scaling.scaleInPlace(scale);
 
+        if (ignoreRotation) {
+            if (this.rotationQuaternion && storedRotationQuaternion) {
+                this.rotationQuaternion.copyFrom(storedRotationQuaternion);
+            } else if (this.rotation && storedRotation) {
+                this.rotation.copyFrom(storedRotation);
+            }
+        }
+
         return this;
     }
 

+ 1 - 0
src/Meshes/transformNode.ts

@@ -622,6 +622,7 @@ export class TransformNode extends Node {
     /**
      * Defines the passed node as the parent of the current node.
      * The node will remain exactly where it is and its position / rotation will be updated accordingly
+     * @see https://doc.babylonjs.com/how_to/parenting
      * @param node the node ot set as the parent
      * @returns this TransformNode.
      */

+ 6 - 3
src/PostProcesses/RenderPipeline/postProcessRenderPipeline.ts

@@ -203,14 +203,17 @@ export class PostProcessRenderPipeline {
     protected _enableMSAAOnFirstPostProcess(sampleCount: number): boolean {
         // Set samples of the very first post process to 4 to enable native anti-aliasing in browsers that support webGL 2.0 (See: https://github.com/BabylonJS/Babylon.js/issues/3754)
         var effectKeys = Object.keys(this._renderEffects);
-        if (this.engine.webGLVersion >= 2 && effectKeys.length > 0) {
+        if (this.engine.webGLVersion === 1) {
+            return false;
+        }
+
+        if (effectKeys.length > 0) {
             var postProcesses = this._renderEffects[effectKeys[0]].getPostProcesses();
             if (postProcesses) {
                 postProcesses[0].samples = sampleCount;
-                return true;
             }
         }
-        return false;
+        return true;
     }
 
     /**

+ 27 - 0
src/Rendering/outlineRenderer.ts

@@ -92,6 +92,10 @@ Object.defineProperty(AbstractMesh.prototype, "renderOverlay", {
  */
 export class OutlineRenderer implements ISceneComponent {
     /**
+     * Stencil value used to avoid outline being seen within the mesh when the mesh is transparent
+     */
+    private static _StencilReference = 0x04;
+    /**
      * The name of the component. Each component must have a unique name.
      */
     public name = SceneComponentConstants.NAME_OUTLINERENDERER;
@@ -274,9 +278,32 @@ export class OutlineRenderer implements ISceneComponent {
         // Outline - step 1
         this._savedDepthWrite = this._engine.getDepthWrite();
         if (mesh.renderOutline) {
+            var material = subMesh.getMaterial();
+            if (material && material.needAlphaBlending) {
+                this._engine.cacheStencilState();
+                // Draw only to stencil buffer for the original mesh
+                // The resulting stencil buffer will be used so the outline is not visible inside the mesh when the mesh is transparent
+                this._engine.setDepthWrite(false);
+                this._engine.setColorWrite(false);
+                this._engine.setStencilBuffer(true);
+                this._engine.setStencilOperationPass(Constants.REPLACE);
+                this._engine.setStencilFunction(Constants.ALWAYS);
+                this._engine.setStencilMask(OutlineRenderer._StencilReference);
+                this._engine.setStencilFunctionReference(OutlineRenderer._StencilReference);
+                this.render(subMesh, batch, /* This sets offset to 0 */ true);
+
+                this._engine.setColorWrite(true);
+                this._engine.setStencilFunction(Constants.NOTEQUAL);
+            }
+
+            // Draw the outline using the above stencil if needed to avoid drawing within the mesh
             this._engine.setDepthWrite(false);
             this.render(subMesh, batch);
             this._engine.setDepthWrite(this._savedDepthWrite);
+
+            if (material && material.needAlphaBlending) {
+                this._engine.restoreStencilState();
+            }
         }
     }
 

+ 14 - 11
src/Shaders/ShadersInclude/helperFunctions.fx

@@ -4,6 +4,14 @@ const float LinearEncodePowerApprox = 2.2;
 const float GammaEncodePowerApprox = 1.0 / LinearEncodePowerApprox;
 const vec3 LuminanceEncodeApprox = vec3(0.2126, 0.7152, 0.0722);
 
+const float Epsilon = 0.0000001;
+
+#define saturate(x)         clamp(x, 0.0, 1.0)
+
+#define absEps(x)           abs(x) + Epsilon
+#define maxEps(x)           max(x, Epsilon)
+#define saturateEps(x)      clamp(x, Epsilon, 1.0)
+
 mat3 transposeMat3(mat3 inMatrix) {
     vec3 i0 = inMatrix[0];
     vec3 i1 = inMatrix[1];
@@ -35,16 +43,6 @@ mat3 inverseMat3(mat3 inMatrix) {
               b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;
 }
 
-float computeFallOff(float value, vec2 clipSpace, float frustumEdgeFalloff)
-{
-    float mask = smoothstep(1.0 - frustumEdgeFalloff, 1.0, clamp(dot(clipSpace, clipSpace), 0., 1.));
-    return mix(value, 1.0, mask);
-}
-
-vec3 applyEaseInOut(vec3 x){
-    return x * x * (3.0 - 2.0 * x);
-}
-
 vec3 toLinearSpace(vec3 color)
 {
     return pow(color, vec3(LinearEncodePowerApprox));
@@ -60,6 +58,11 @@ float square(float value)
     return value * value;
 }
 
+float pow5(float value) {
+    float sq = value * value;
+    return sq * sq * value;
+}
+
 float getLuminance(vec3 color)
 {
     return clamp(dot(color, LuminanceEncodeApprox), 0., 1.);
@@ -81,7 +84,7 @@ float dither(vec2 seed, float varianceAmount) {
 const float rgbdMaxRange = 255.0;
 
 vec4 toRGBD(vec3 color) {
-    float maxRGB = max(0.0000001, max(color.r, max(color.g, color.b)));
+    float maxRGB = maxEps(max(color.r, max(color.g, color.b)));
     float D      = max(rgbdMaxRange / maxRGB, 1.);
     D            = clamp(floor(D) / 255.0, 0., 1.);
     // vec3 rgb = color.rgb * (D * (255.0 / rgbdMaxRange));

+ 7 - 7
src/Shaders/ShadersInclude/imageProcessingFunctions.fx

@@ -28,13 +28,13 @@
 		sliceUV.x *= sliceSize;
 		sliceUV.x += sliceInteger * sliceSize;
 
-		sliceUV = clamp(sliceUV, 0., 1.);
+		sliceUV = saturate(sliceUV);
 
 		vec4 slice0Color = texture2D(colorTransform, sliceUV);
 
 		sliceUV.x += sliceSize;
 		
-		sliceUV = clamp(sliceUV, 0., 1.);
+		sliceUV = saturate(sliceUV);
 		vec4 slice1Color = texture2D(colorTransform, sliceUV);
 
 		vec3 result = mix(slice0Color.rgb, slice1Color.rgb, sliceFraction);
@@ -86,7 +86,7 @@
 		color = ACESOutputMat * color;
 
 		// Clamp to [0, 1]
-		color = clamp(color, 0.0, 1.0);
+		color = saturate(color);
 
 		return color;
 	}
@@ -130,12 +130,12 @@ vec4 applyImageProcessing(vec4 result) {
 
 	// Going back to gamma space
 	result.rgb = toGammaSpace(result.rgb);
-	result.rgb = clamp(result.rgb, 0.0, 1.0);
+	result.rgb = saturate(result.rgb);
 
 #ifdef CONTRAST
-	// Contrast
-	vec3 resultHighContrast = applyEaseInOut(result.rgb);
-
+	// Contrast EaseInOut
+	vec3 resultHighContrast = result.rgb * result.rgb * (3.0 - 2.0 * result.rgb);
+	
 	if (contrast < 1.0) {
 		// Decrease contrast: interpolate towards zero-contrast image (flat grey)
 		result.rgb = mix(vec3(0.5, 0.5, 0.5), result.rgb, contrast);

+ 287 - 0
src/Shaders/ShadersInclude/pbrBRDFFunctions.fx

@@ -0,0 +1,287 @@
+// Constants
+#define FRESNEL_MAXIMUM_ON_ROUGH 0.25
+
+// ______________________________________________________________________
+//
+//                              BRDF LOOKUP
+// ______________________________________________________________________
+
+#ifdef MS_BRDF_ENERGY_CONSERVATION
+    // http://www.jcgt.org/published/0008/01/03/
+    // http://advances.realtimerendering.com/s2018/Siggraph%202018%20HDRP%20talk_with%20notes.pdf
+    vec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0, vec2 environmentBrdf) {
+        return 1.0 + specularEnvironmentR0 * (1.0 / environmentBrdf.y - 1.0);
+    }
+#endif
+
+#ifdef ENVIRONMENTBRDF
+    vec2 getBRDFLookup(float NdotV, float perceptualRoughness, sampler2D brdfSampler) {
+        // Indexed on cos(theta) and roughness
+        vec2 UV = vec2(NdotV, perceptualRoughness);
+        
+        // We can find the scale and offset to apply to the specular value.
+        vec2 brdfLookup = texture2D(brdfSampler, UV).xy;
+
+        return brdfLookup;
+    }
+
+    vec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0, vec2 environmentBrdf) {
+        #ifdef BRDF_V_HEIGHT_CORRELATED
+            vec3 reflectance = mix(environmentBrdf.xxx, environmentBrdf.yyy, specularEnvironmentR0);
+        #else
+            vec3 reflectance = specularEnvironmentR0 * environmentBrdf.x + environmentBrdf.y;
+        #endif
+        return reflectance;
+    }
+#else
+    vec3 getReflectanceFromAnalyticalBRDFLookup_Jones(float VdotN, vec3 reflectance0, vec3 reflectance90, float smoothness)
+    {
+        // Schlick fresnel approximation, extended with basic smoothness term so that rough surfaces do not approach reflectance90 at grazing angle
+        float weight = mix(FRESNEL_MAXIMUM_ON_ROUGH, 1.0, smoothness);
+        return reflectance0 + weight * (reflectance90 - reflectance0) * pow5(saturate(1.0 - VdotN));
+    }
+#endif
+
+#if defined(SHEEN) && defined(REFLECTION)
+    /**
+    * Special thanks to @romainguy for all the support :-)
+    * Analytical approximation of the pre-filtered DFG terms for the cloth shading
+    * model. This approximation is based on the Estevez & Kulla distribution term
+    * ("Charlie" sheen) and the Neubelt visibility term. See brdf.fs for more
+    * details.
+    */
+    vec2 getCharlieSheenAnalyticalBRDFLookup_RomainGuy(float NoV, float roughness) {
+        const vec3 c0 = vec3(0.95, 1250.0, 0.0095);
+        const vec4 c1 = vec4(0.04, 0.2, 0.3, 0.2);
+
+        float a = 1.0 - NoV;
+        float b = 1.0 - roughness;
+
+        float n = pow(c1.x + a, 64.0);
+        float e = b - c0.x;
+        float g = exp2(-(e * e) * c0.y);
+        float f = b + c1.y;
+        float a2 = a * a;
+        float a3 = a2 * a;
+        float c = n * g + c1.z * (a + c1.w) * roughness + f * f * a3 * a3 * a2;
+        float r = min(c, 18.0);
+
+        return vec2(r, r * c0.z);
+    }
+
+    vec3 getSheenReflectanceFromBRDFLookup(const vec3 reflectance0, float NdotV, float sheenAlphaG) {
+        vec2 environmentSheenBrdf = getCharlieSheenAnalyticalBRDFLookup_RomainGuy(NdotV, sheenAlphaG);
+        vec3 reflectance = reflectance0 * environmentSheenBrdf.x + environmentSheenBrdf.y;
+
+        return reflectance;
+    }
+#endif
+
+// ______________________________________________________________________
+//
+//                              Schlick/Fresnel
+// ______________________________________________________________________
+
+// Schlick's approximation for R0 (Fresnel Reflectance Values)
+// Keep for references
+// vec3 getR0fromAirToSurfaceIOR(vec3 ior1) {
+//     return getR0fromIOR(ior1, vec3(1.0));
+// }
+
+// vec3 getR0fromIOR(vec3 ior1, vec3 ior2) {
+//     vec3 t = (ior1 - ior2) / (ior1 + ior2);
+//     return t * t;
+// }
+
+// vec3 getIORfromAirToSurfaceR0(vec3 f0) {
+//     vec3 s = sqrt(f0);
+//     return (1.0 + s) / (1.0 - s);
+// }
+
+// f0 Remapping due to layers
+// vec3 getR0RemappedForClearCoat(vec3 f0, vec3 clearCoatF0) {
+//     vec3 iorBase = getIORfromAirToSurfaceR0(f0);
+//     vec3 clearCoatIor = getIORfromAirToSurfaceR0(clearCoatF0);
+//     return getR0fromIOR(iorBase, clearCoatIor);
+// }
+
+vec3 fresnelSchlickGGX(float VdotH, vec3 reflectance0, vec3 reflectance90)
+{
+    return reflectance0 + (reflectance90 - reflectance0) * pow5(1.0 - VdotH);
+}
+
+float fresnelSchlickGGX(float VdotH, float reflectance0, float reflectance90)
+{
+    return reflectance0 + (reflectance90 - reflectance0) * pow5(1.0 - VdotH);
+}
+
+#ifdef CLEARCOAT
+    // Knowing ior clear coat is fix for the material
+    // Solving iorbase = 1 + sqrt(fo) / (1 - sqrt(fo)) and f0base = square((iorbase - iorclearcoat) / (iorbase - iorclearcoat))
+    // provide f0base = square(A + B * sqrt(fo)) / (B + A * sqrt(fo))
+    // where A = 1 - iorclearcoat
+    // and   B = 1 + iorclearcoat
+    vec3 getR0RemappedForClearCoat(vec3 f0) {
+        #ifdef CLEARCOAT_DEFAULTIOR
+            #ifdef MOBILE
+                return saturate(f0 * (f0 * 0.526868 + 0.529324) - 0.0482256);
+            #else
+                return saturate(f0 * (f0 * (0.941892 - 0.263008 * f0) + 0.346479) - 0.0285998);
+            #endif
+        #else
+            vec3 s = sqrt(f0);
+            vec3 t = (vClearCoatRefractionParams.z + vClearCoatRefractionParams.w * s) / (vClearCoatRefractionParams.w + vClearCoatRefractionParams.z * s);
+            return t * t;
+        #endif
+    }
+#endif
+
+// ______________________________________________________________________
+//
+//                              Distribution
+// ______________________________________________________________________
+
+// Trowbridge-Reitz (GGX)
+// Generalised Trowbridge-Reitz with gamma power=2.0
+float normalDistributionFunction_TrowbridgeReitzGGX(float NdotH, float alphaG)
+{
+    // Note: alphaG is average slope (gradient) of the normals in slope-space.
+    // It is also the (trigonometric) tangent of the median distribution value, i.e. 50% of normals have
+    // a tangent (gradient) closer to the macrosurface than this slope.
+    float a2 = square(alphaG);
+    float d = NdotH * NdotH * (a2 - 1.0) + 1.0;
+    return a2 / (PI * d * d);
+}
+
+#ifdef SHEEN
+    // https://knarkowicz.wordpress.com/2018/01/04/cloth-shading/
+    float normalDistributionFunction_CharlieSheen(float NdotH, float alphaG)
+    {
+        float invR = 1. / alphaG;
+        float cos2h = NdotH * NdotH;
+        float sin2h = 1. - cos2h;
+        return (2. + invR) * pow(sin2h, invR * .5) / (2. * PI);
+    }
+#endif
+
+#ifdef ANISOTROPIC
+    // GGX Distribution Anisotropic
+    // https://blog.selfshadow.com/publications/s2012-shading-course/burley/s2012_pbs_disney_brdf_notes_v3.pdf Addenda
+    float normalDistributionFunction_BurleyGGX_Anisotropic(float NdotH, float TdotH, float BdotH, const vec2 alphaTB) {
+        float a2 = alphaTB.x * alphaTB.y;
+        vec3 v = vec3(alphaTB.y * TdotH, alphaTB.x  * BdotH, a2 * NdotH);
+        float v2 = dot(v, v);
+        float w2 = a2 / v2;
+        return a2 * w2 * w2 * RECIPROCAL_PI;
+    }
+#endif
+
+// ______________________________________________________________________
+//
+//                              Visibility/Geometry
+// ______________________________________________________________________
+
+#ifdef BRDF_V_HEIGHT_CORRELATED
+    // GGX Mask/Shadowing Isotropic 
+    // Heitz http://jcgt.org/published/0003/02/03/paper.pdf
+    // https://twvideo01.ubm-us.net/o1/vault/gdc2017/Presentations/Hammon_Earl_PBR_Diffuse_Lighting.pdf
+    float smithVisibility_GGXCorrelated(float NdotL, float NdotV, float alphaG) {
+        #ifdef MOBILE
+            // Appply simplification as all squared root terms are below 1 and squared
+            float GGXV = NdotL * (NdotV * (1.0 - alphaG) + alphaG);
+            float GGXL = NdotV * (NdotL * (1.0 - alphaG) + alphaG);
+            return 0.5 / (GGXV + GGXL);
+        #else
+            float a2 = alphaG * alphaG;
+            float GGXV = NdotL * sqrt(NdotV * (NdotV - a2 * NdotV) + a2);
+            float GGXL = NdotV * sqrt(NdotL * (NdotL - a2 * NdotL) + a2);
+            return 0.5 / (GGXV + GGXL);
+        #endif
+    }
+#else
+    // From Microfacet Models for Refraction through Rough Surfaces, Walter et al. 2007
+    // Keep for references
+    // float smithVisibilityG1_TrowbridgeReitzGGX(float dot, float alphaG)
+    // {
+    //     float tanSquared = (1.0 - dot * dot) / (dot * dot);
+    //     return 2.0 / (1.0 + sqrt(1.0 + alphaG * alphaG * tanSquared));
+    // }
+
+    // float smithVisibility_TrowbridgeReitzGGX_Walter(float NdotL, float NdotV, float alphaG)
+    // {
+    //     float visibility = smithVisibilityG1_TrowbridgeReitzGGX(NdotL, alphaG) * smithVisibilityG1_TrowbridgeReitzGGX(NdotV, alphaG);
+    //     visibility /= (4.0 * NdotL * NdotV); // Cook Torance Denominator  integrated in visibility to avoid issues when visibility function changes.
+    //     return visibility;
+    // }
+
+    // From smithVisibilityG1_TrowbridgeReitzGGX * dot / dot to cancel the cook
+    // torrance denominator :-)
+    float smithVisibilityG1_TrowbridgeReitzGGXFast(float dot, float alphaG)
+    {
+        #ifdef MOBILE
+            // Appply simplification as all squared root terms are below 1 and squared
+            return 1.0 / (dot + alphaG + (1.0 - alphaG) * dot ));
+        #else
+            float alphaSquared = alphaG * alphaG;
+            return 1.0 / (dot + sqrt(alphaSquared + (1.0 - alphaSquared) * dot * dot));
+        #endif
+    }
+
+    float smithVisibility_TrowbridgeReitzGGXFast(float NdotL, float NdotV, float alphaG)
+    {
+        float visibility = smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL, alphaG) * smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV, alphaG);
+        // No Cook Torance Denominator as it is canceled out in the previous form
+        return visibility;
+    }
+#endif
+
+#ifdef ANISOTROPIC
+    // GGX Mask/Shadowing Anisotropic 
+    // Heitz http://jcgt.org/published/0003/02/03/paper.pdf
+    float smithVisibility_GGXCorrelated_Anisotropic(float NdotL, float NdotV, float TdotV, float BdotV, float TdotL, float BdotL, const vec2 alphaTB) {
+        float lambdaV = NdotL * length(vec3(alphaTB.x * TdotV, alphaTB.y * BdotV, NdotV));
+        float lambdaL = NdotV * length(vec3(alphaTB.x * TdotL, alphaTB.y * BdotL, NdotL));
+        float v = 0.5 / (lambdaV + lambdaL);
+        return v;
+    }
+#endif
+
+#ifdef CLEARCOAT
+    float visibility_Kelemen(float VdotH) {
+        // Simplified form integration the cook torrance denminator.
+        // Expanded is nl * nv / vh2 which factor with 1 / (4 * nl * nv)
+        // giving 1 / (4 * vh2))
+        return 0.25 / (VdotH * VdotH); 
+    }
+#endif
+
+#ifdef SHEEN
+    // https://knarkowicz.wordpress.com/2018/01/04/cloth-shading/
+    // https://blog.selfshadow.com/publications/s2017-shading-course/imageworks/s2017_pbs_imageworks_sheen.pdf
+    // http://www.cs.utah.edu/~premoze/dbrdf/dBRDF.pdf
+    float visibility_Ashikhmin(float NdotL, float NdotV)
+    {
+        return 1. / (4. * (NdotL + NdotV - NdotL * NdotV));
+    }
+#endif
+
+// ______________________________________________________________________
+//
+//                              DiffuseBRDF
+// ______________________________________________________________________
+
+// Disney diffuse term
+// https://blog.selfshadow.com/publications/s2012-shading-course/burley/s2012_pbs_disney_brdf_notes_v3.pdf
+// Page 14
+float diffuseBRDF_Burley(float NdotL, float NdotV, float VdotH, float roughness) {
+    // Diffuse fresnel falloff as per Disney principled BRDF, and in the spirit of
+    // of general coupled diffuse/specular models e.g. Ashikhmin Shirley.
+    float diffuseFresnelNV = pow5(saturateEps(1.0 - NdotL));
+    float diffuseFresnelNL = pow5(saturateEps(1.0 - NdotV));
+    float diffuseFresnel90 = 0.5 + 2.0 * VdotH * VdotH * roughness;
+    float fresnel =
+        (1.0 + (diffuseFresnel90 - 1.0) * diffuseFresnelNL) *
+        (1.0 + (diffuseFresnel90 - 1.0) * diffuseFresnelNV);
+
+    return fresnel / PI;
+}

+ 5 - 6
src/Shaders/ShadersInclude/pbrFalloffLightingFunctions.fx

@@ -5,16 +5,15 @@ float computeDistanceLightFalloff_Standard(vec3 lightOffset, float range)
 
 float computeDistanceLightFalloff_Physical(float lightDistanceSquared)
 {
-    return 1.0 / ((lightDistanceSquared + 0.001));
+    return 1.0 / maxEps(lightDistanceSquared);
 }
 
 float computeDistanceLightFalloff_GLTF(float lightDistanceSquared, float inverseSquaredRange)
 {
-    const float minDistanceSquared = 0.01*0.01;
-    float lightDistanceFalloff = 1.0 / (max(lightDistanceSquared, minDistanceSquared));
+    float lightDistanceFalloff = 1.0 / maxEps(lightDistanceSquared);
 
     float factor = lightDistanceSquared * inverseSquaredRange;
-    float attenuation = clamp(1.0 - factor * factor, 0., 1.);
+    float attenuation = saturate(1.0 - factor * factor);
     attenuation *= attenuation;
 
     // Smooth attenuation of the falloff defined by the range.
@@ -38,7 +37,7 @@ float computeDirectionalLightFalloff_Standard(vec3 lightDirection, vec3 directio
 {
     float falloff = 0.0;
 
-    float cosAngle = max(0.000000000000001, dot(-lightDirection, directionToLightCenterW));
+    float cosAngle = maxEps(dot(-lightDirection, directionToLightCenterW));
     if (cosAngle >= cosHalfAngle)
     {
         falloff = max(0., pow(cosAngle, exponent));
@@ -72,7 +71,7 @@ float computeDirectionalLightFalloff_GLTF(vec3 lightDirection, vec3 directionToL
     // float lightAngleOffset = -cosOuter * angleScale;
 
     float cd = dot(-lightDirection, directionToLightCenterW);
-    float falloff = clamp(cd * lightAngleScale + lightAngleOffset, 0., 1.);
+    float falloff = saturate(cd * lightAngleScale + lightAngleOffset);
     // smooth the transition
     falloff *= falloff;
     return falloff;

+ 134 - 0
src/Shaders/ShadersInclude/pbrDirectLightingFunctions.fx

@@ -0,0 +1,134 @@
+#define CLEARCOATREFLECTANCE90 1.0
+
+// Light Results
+struct lightingInfo
+{
+    vec3 diffuse;
+    #ifdef SPECULARTERM
+        vec3 specular;
+    #endif
+    #ifdef CLEARCOAT
+        // xyz contains the clearcoat color.
+        // w contains the 1 - clearcoat fresnel to ease the energy conservation computation.
+        vec4 clearCoat;
+    #endif
+    #ifdef SHEEN
+        vec3 sheen;
+    #endif
+};
+
+// Simulate area (small) lights by increasing roughness
+float adjustRoughnessFromLightProperties(float roughness, float lightRadius, float lightDistance) {
+    #if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF)
+        // At small angle this approximation works. 
+        float lightRoughness = lightRadius / lightDistance;
+        // Distribution can sum.
+        float totalRoughness = saturate(lightRoughness + roughness);
+        return totalRoughness;
+    #else
+        return roughness;
+    #endif
+}
+
+vec3 computeHemisphericDiffuseLighting(preLightingInfo info, vec3 lightColor, vec3 groundColor) {
+    return mix(groundColor, lightColor, info.NdotL);
+}
+
+vec3 computeDiffuseLighting(preLightingInfo info, vec3 lightColor) {
+    float diffuseTerm = diffuseBRDF_Burley(info.NdotL, info.NdotV, info.VdotH, info.roughness);
+    return diffuseTerm * info.attenuation * info.NdotL * lightColor;
+}
+
+vec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler, mat4 textureProjectionMatrix){
+    vec4 strq = textureProjectionMatrix * vec4(vPositionW, 1.0);
+    strq /= strq.w;
+    vec3 textureColor = texture2D(projectionLightSampler, strq.xy).rgb;
+    return toLinearSpace(textureColor);
+}
+
+#ifdef SPECULARTERM
+    vec3 computeSpecularLighting(preLightingInfo info, vec3 N, vec3 reflectance0, vec3 reflectance90, float geometricRoughnessFactor, vec3 lightColor) {
+        float NdotH = saturateEps(dot(N, info.H));
+        float roughness = max(info.roughness, geometricRoughnessFactor);
+        float alphaG = convertRoughnessToAverageSlope(roughness);
+
+        vec3 fresnel = fresnelSchlickGGX(info.VdotH, reflectance0, reflectance90);
+        float distribution = normalDistributionFunction_TrowbridgeReitzGGX(NdotH, alphaG);
+
+        #ifdef BRDF_V_HEIGHT_CORRELATED
+            float visibility = smithVisibility_GGXCorrelated(info.NdotL, info.NdotV, alphaG);
+        #else
+            float visibility = smithVisibility_TrowbridgeReitzGGXFast(info.NdotL, info.NdotV, alphaG);
+        #endif
+
+        vec3 specTerm = fresnel * distribution * visibility;
+        return specTerm * info.attenuation * info.NdotL * lightColor;
+    }
+#endif
+
+#ifdef ANISOTROPIC
+    vec3 computeAnisotropicSpecularLighting(preLightingInfo info, vec3 V, vec3 N, vec3 T, vec3 B, float anisotropy, vec3 reflectance0, vec3 reflectance90, float geometricRoughnessFactor, vec3 lightColor) {
+        float NdotH = saturateEps(dot(N, info.H));
+        float TdotH = dot(T, info.H);
+        float BdotH = dot(B, info.H);
+        float TdotV = dot(T, V);
+        float BdotV = dot(B, V);
+        float TdotL = dot(T, info.L);
+        float BdotL = dot(B, info.L);
+        float alphaG = convertRoughnessToAverageSlope(info.roughness);
+        vec2 alphaTB = getAnisotropicRoughness(alphaG, anisotropy);
+        alphaTB = max(alphaTB, square(geometricRoughnessFactor));
+
+        vec3 fresnel = fresnelSchlickGGX(info.VdotH, reflectance0, reflectance90);
+        float distribution = normalDistributionFunction_BurleyGGX_Anisotropic(NdotH, TdotH, BdotH, alphaTB);
+        float visibility = smithVisibility_GGXCorrelated_Anisotropic(info.NdotL, info.NdotV, TdotV, BdotV, TdotL, BdotL, alphaTB);
+
+        vec3 specTerm = fresnel * distribution * visibility;
+        return specTerm * info.attenuation * info.NdotL * lightColor;
+    }
+#endif
+
+#ifdef CLEARCOAT
+    vec4 computeClearCoatLighting(preLightingInfo info, vec3 Ncc, float geometricRoughnessFactor, float clearCoatIntensity, vec3 lightColor) {
+        float NccdotL = saturateEps(dot(Ncc, info.L));
+        float NccdotH = saturateEps(dot(Ncc, info.H));
+        float clearCoatRoughness = max(info.roughness, geometricRoughnessFactor);
+        float alphaG = convertRoughnessToAverageSlope(clearCoatRoughness);
+
+        float fresnel = fresnelSchlickGGX(info.VdotH, vClearCoatRefractionParams.x, CLEARCOATREFLECTANCE90);
+        fresnel *= clearCoatIntensity;
+        float distribution = normalDistributionFunction_TrowbridgeReitzGGX(NccdotH, alphaG);
+        float visibility = visibility_Kelemen(info.VdotH);
+
+        float clearCoatTerm = fresnel * distribution * visibility;
+
+        return vec4(
+            clearCoatTerm * info.attenuation * NccdotL * lightColor,
+            1.0 - fresnel
+        );
+    }
+
+    vec3 computeClearCoatLightingAbsorption(float NdotVRefract, vec3 L, vec3 Ncc, vec3 clearCoatColor, float clearCoatThickness, float clearCoatIntensity) {
+        vec3 LRefract = -refract(L, Ncc, vClearCoatRefractionParams.y);
+        float NdotLRefract = saturateEps(dot(Ncc, LRefract));
+
+        vec3 absorption = computeClearCoatAbsorption(NdotVRefract, NdotLRefract, clearCoatColor, clearCoatThickness, clearCoatIntensity);
+        return absorption;
+    }
+#endif
+
+#ifdef SHEEN
+    vec3 computeSheenLighting(preLightingInfo info, vec3 N, vec3 reflectance0, vec3 reflectance90, float geometricRoughnessFactor, vec3 lightColor) {
+        float NdotH = saturateEps(dot(N, info.H));
+        float roughness = max(info.roughness, geometricRoughnessFactor);
+        float alphaG = convertRoughnessToAverageSlope(roughness);
+
+        // No Fresnel with sheen
+        // vec3 fresnel = fresnelSchlickGGX(info.VdotH, reflectance0, reflectance90);
+        float distribution = normalDistributionFunction_CharlieSheen(NdotH, alphaG);
+        float visibility = visibility_Ashikhmin(info.NdotL, info.NdotV);
+
+        float sheenTerm = distribution * visibility;
+        return sheenTerm * info.attenuation * info.NdotL * lightColor;
+    }
+#endif

+ 6 - 6
src/Shaders/ShadersInclude/pbrPreLightingFunctions.fx

@@ -31,8 +31,8 @@ preLightingInfo computePointAndSpotPreLightingInfo(vec4 lightData, vec3 V, vec3
     // Geometry Data.
     result.L = normalize(result.lightOffset);
     result.H = normalize(V + result.L);
-    result.NdotL = clamp(dot(N, result.L), 0.000000000001, 1.0);
-    result.VdotH = clamp(dot(V, result.H), 0.0, 1.0);
+    result.NdotL = saturateEps(dot(N, result.L));
+    result.VdotH = saturate(dot(V, result.H));
 
     return result;
 }
@@ -46,8 +46,8 @@ preLightingInfo computeDirectionalPreLightingInfo(vec4 lightData, vec3 V, vec3 N
     // Geometry Data.
     result.L = normalize(-lightData.xyz);
     result.H = normalize(V + result.L);
-    result.NdotL = clamp(dot(N, result.L), 0.00000000001, 1.0);
-    result.VdotH = clamp(dot(V, result.H), 0.0, 1.0);
+    result.NdotL = saturateEps(dot(N, result.L));
+    result.VdotH = saturate(dot(V, result.H));
 
     return result;
 }
@@ -57,12 +57,12 @@ preLightingInfo computeHemisphericPreLightingInfo(vec4 lightData, vec3 V, vec3 N
 
     // Geometry Data.
     result.NdotL = dot(N, lightData.xyz) * 0.5 + 0.5;
-    result.NdotL = clamp(result.NdotL, 0.000000000001, 1.0);
+    result.NdotL = saturateEps(result.NdotL);
 
     #ifdef SPECULARTERM
         result.L = normalize(lightData.xyz);
         result.H = normalize(V + result.L);
-        result.VdotH = clamp(dot(V, result.H), 0.0, 1.0);
+        result.VdotH = saturate(dot(V, result.H));
     #endif
 
     return result;

+ 30 - 0
src/Shaders/ShadersInclude/pbrFragmentExtraDeclaration.fx

@@ -0,0 +1,30 @@
+uniform vec4 vEyePosition;
+uniform vec3 vAmbientColor;
+uniform vec4 vCameraInfos;
+
+// Input
+varying vec3 vPositionW;
+
+#if DEBUGMODE > 0
+    uniform vec2 vDebugMode;
+    varying vec4 vClipSpacePosition;
+#endif
+
+#ifdef MAINUV1
+    varying vec2 vMainUV1;
+#endif 
+
+#ifdef MAINUV2 
+    varying vec2 vMainUV2;
+#endif 
+
+#ifdef NORMAL
+    varying vec3 vNormalW;
+    #if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
+        varying vec3 vEnvironmentIrradiance;
+    #endif
+#endif
+
+#ifdef VERTEXCOLOR
+    varying vec4 vColor;
+#endif

+ 203 - 0
src/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.fx

@@ -0,0 +1,203 @@
+#ifdef ALBEDO
+    #if ALBEDODIRECTUV == 1
+        #define vAlbedoUV vMainUV1
+    #elif ALBEDODIRECTUV == 2
+        #define vAlbedoUV vMainUV2
+    #else
+        varying vec2 vAlbedoUV;
+    #endif
+    uniform sampler2D albedoSampler;
+#endif
+
+#ifdef AMBIENT
+    #if AMBIENTDIRECTUV == 1
+        #define vAmbientUV vMainUV1
+    #elif AMBIENTDIRECTUV == 2
+        #define vAmbientUV vMainUV2
+    #else
+        varying vec2 vAmbientUV;
+    #endif
+    uniform sampler2D ambientSampler;
+#endif
+
+#ifdef OPACITY
+    #if OPACITYDIRECTUV == 1
+        #define vOpacityUV vMainUV1
+    #elif OPACITYDIRECTUV == 2
+        #define vOpacityUV vMainUV2
+    #else
+        varying vec2 vOpacityUV;
+    #endif
+    uniform sampler2D opacitySampler;
+#endif
+
+#ifdef EMISSIVE
+    #if EMISSIVEDIRECTUV == 1
+        #define vEmissiveUV vMainUV1
+    #elif EMISSIVEDIRECTUV == 2
+        #define vEmissiveUV vMainUV2
+    #else
+        varying vec2 vEmissiveUV;
+    #endif
+    uniform sampler2D emissiveSampler;
+#endif
+
+#ifdef LIGHTMAP
+    #if LIGHTMAPDIRECTUV == 1
+        #define vLightmapUV vMainUV1
+    #elif LIGHTMAPDIRECTUV == 2
+        #define vLightmapUV vMainUV2
+    #else
+        varying vec2 vLightmapUV;
+    #endif
+    uniform sampler2D lightmapSampler;
+#endif
+
+#ifdef REFLECTIVITY
+    #if REFLECTIVITYDIRECTUV == 1
+        #define vReflectivityUV vMainUV1
+    #elif REFLECTIVITYDIRECTUV == 2
+        #define vReflectivityUV vMainUV2
+    #else
+        varying vec2 vReflectivityUV;
+    #endif
+    uniform sampler2D reflectivitySampler;
+#endif
+
+#ifdef MICROSURFACEMAP
+    #if MICROSURFACEMAPDIRECTUV == 1
+        #define vMicroSurfaceSamplerUV vMainUV1
+    #elif MICROSURFACEMAPDIRECTUV == 2
+        #define vMicroSurfaceSamplerUV vMainUV2
+    #else
+        varying vec2 vMicroSurfaceSamplerUV;
+    #endif
+    uniform sampler2D microSurfaceSampler;
+#endif
+
+#ifdef CLEARCOAT
+    #ifdef CLEARCOAT_TEXTURE
+        #if CLEARCOAT_TEXTUREDIRECTUV == 1
+            #define vClearCoatUV vMainUV1
+        #elif CLEARCOAT_TEXTUREDIRECTUV == 2
+            #define vClearCoatUV vMainUV2
+        #else
+            varying vec2 vClearCoatUV;
+        #endif
+        uniform sampler2D clearCoatSampler;
+    #endif
+
+    #ifdef CLEARCOAT_BUMP
+        #if CLEARCOAT_BUMPDIRECTUV == 1
+            #define vClearCoatBumpUV vMainUV1
+        #elif CLEARCOAT_BUMPDIRECTUV == 2
+            #define vClearCoatBumpUV vMainUV2
+        #else
+            varying vec2 vClearCoatBumpUV;
+        #endif
+        uniform sampler2D clearCoatBumpSampler;
+    #endif
+
+    #ifdef CLEARCOAT_TINT_TEXTURE
+        #if CLEARCOAT_TINT_TEXTUREDIRECTUV == 1
+            #define vClearCoatTintUV vMainUV1
+        #elif CLEARCOAT_TINT_TEXTUREDIRECTUV == 2
+            #define vClearCoatTintUV vMainUV2
+        #else
+            varying vec2 vClearCoatTintUV;
+        #endif
+        uniform sampler2D clearCoatTintSampler;
+    #endif
+#endif
+
+#ifdef SHEEN
+    #ifdef SHEEN_TEXTURE
+        #if SHEEN_TEXTUREDIRECTUV == 1
+            #define vSheenUV vMainUV1
+        #elif SHEEN_TEXTUREDIRECTUV == 2
+            #define vSheenUV vMainUV2
+        #else
+            varying vec2 vSheenUV;
+        #endif
+        uniform sampler2D sheenSampler;
+    #endif
+#endif
+
+#ifdef ANISOTROPIC
+    #ifdef ANISOTROPIC_TEXTURE
+        #if ANISOTROPIC_TEXTUREDIRECTUV == 1
+            #define vAnisotropyUV vMainUV1
+        #elif ANISOTROPIC_TEXTUREDIRECTUV == 2
+            #define vAnisotropyUV vMainUV2
+        #else
+            varying vec2 vAnisotropyUV;
+        #endif
+        uniform sampler2D anisotropySampler;
+    #endif
+#endif
+
+// Refraction
+#ifdef REFRACTION
+    #ifdef REFRACTIONMAP_3D
+        #define sampleRefraction(s, c) textureCube(s, c)
+        
+        uniform samplerCube refractionSampler;
+
+        #ifdef LODBASEDMICROSFURACE
+            #define sampleRefractionLod(s, c, l) textureCubeLodEXT(s, c, l)
+        #else
+            uniform samplerCube refractionSamplerLow;
+            uniform samplerCube refractionSamplerHigh;
+        #endif
+    #else
+        #define sampleRefraction(s, c) texture2D(s, c)
+        
+        uniform sampler2D refractionSampler;
+
+        #ifdef LODBASEDMICROSFURACE
+            #define sampleRefractionLod(s, c, l) texture2DLodEXT(s, c, l)
+        #else
+            uniform samplerCube refractionSamplerLow;
+            uniform samplerCube refractionSamplerHigh;
+        #endif
+    #endif
+#endif
+
+// Reflection
+#ifdef REFLECTION
+    #ifdef REFLECTIONMAP_3D
+        #define sampleReflection(s, c) textureCube(s, c)
+
+        uniform samplerCube reflectionSampler;
+        
+        #ifdef LODBASEDMICROSFURACE
+            #define sampleReflectionLod(s, c, l) textureCubeLodEXT(s, c, l)
+        #else
+            uniform samplerCube reflectionSamplerLow;
+            uniform samplerCube reflectionSamplerHigh;
+        #endif
+    #else
+        #define sampleReflection(s, c) texture2D(s, c)
+
+        uniform sampler2D reflectionSampler;
+
+        #ifdef LODBASEDMICROSFURACE
+            #define sampleReflectionLod(s, c, l) texture2DLodEXT(s, c, l)
+        #else
+            uniform samplerCube reflectionSamplerLow;
+            uniform samplerCube reflectionSamplerHigh;
+        #endif
+    #endif
+
+    #ifdef REFLECTIONMAP_SKYBOX
+        varying vec3 vPositionUVW;
+    #else
+        #if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
+            varying vec3 vDirectionW;
+        #endif
+    #endif
+#endif
+
+#ifdef ENVIRONMENTBRDF
+    uniform sampler2D environmentBrdfSampler;
+#endif

+ 0 - 448
src/Shaders/ShadersInclude/pbrFunctions.fx

@@ -1,448 +0,0 @@
-// Constants
-#define RECIPROCAL_PI2 0.15915494
-#define RECIPROCAL_PI 0.31830988618
-#define FRESNEL_MAXIMUM_ON_ROUGH 0.25
-
-// AlphaG epsilon to avoid numerical issues
-#define MINIMUMVARIANCE 0.0005
-
-#define CLEARCOATREFLECTANCE90 1.0
-
-float convertRoughnessToAverageSlope(float roughness)
-{
-    // Calculate AlphaG as square of roughness; add epsilon to avoid numerical issues
-    return square(roughness) + MINIMUMVARIANCE;
-}
-
-vec2 getAARoughnessFactors(vec3 normalVector) {
-    #ifdef SPECULARAA
-        vec3 nDfdx = dFdx(normalVector.xyz);
-        vec3 nDfdy = dFdy(normalVector.xyz);
-        float slopeSquare = max(dot(nDfdx, nDfdx), dot(nDfdy, nDfdy));
-
-        // Vive analytical lights roughness factor.
-        float geometricRoughnessFactor = pow(clamp(slopeSquare , 0., 1.), 0.333);
-
-        // Adapt linear roughness (alphaG) to geometric curvature of the current pixel.
-        float geometricAlphaGFactor = sqrt(slopeSquare);
-        // BJS factor.
-        geometricAlphaGFactor *= 0.75;
-
-        return vec2(geometricRoughnessFactor, geometricAlphaGFactor);
-    #else
-        return vec2(0.);
-    #endif
-}
-
-
-#ifdef MS_BRDF_ENERGY_CONSERVATION
-    // http://www.jcgt.org/published/0008/01/03/
-    // http://advances.realtimerendering.com/s2018/Siggraph%202018%20HDRP%20talk_with%20notes.pdf
-    vec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0, vec2 environmentBrdf) {
-        return 1.0 + specularEnvironmentR0 * (1.0 / environmentBrdf.y - 1.0);
-    }
-#endif
-
-vec2 getBRDFLookup(float NdotV, float perceptualRoughness, sampler2D brdfSampler) {
-    // Indexed on cos(theta) and roughness
-    vec2 UV = vec2(NdotV, perceptualRoughness);
-    
-    // We can find the scale and offset to apply to the specular value.
-    vec2 brdfLookup = texture2D(brdfSampler, UV).xy;
-
-    return brdfLookup;
-}
-
-/**
- * Special thanks to @romainguy for all the support :-)
- * Analytical approximation of the pre-filtered DFG terms for the cloth shading
- * model. This approximation is based on the Estevez & Kulla distribution term
- * ("Charlie" sheen) and the Neubelt visibility term. See brdf.fs for more
- * details.
- */
-vec2 getCharlieSheenAnalyticalBRDFLookup_RomainGuy(float NoV, float roughness) {
-    const vec3 c0 = vec3(0.95, 1250.0, 0.0095);
-    const vec4 c1 = vec4(0.04, 0.2, 0.3, 0.2);
-
-    float a = 1.0 - NoV;
-    float b = 1.0 - roughness;
-
-    float n = pow(c1.x + a, 64.0);
-    float e = b - c0.x;
-    float g = exp2(-(e * e) * c0.y);
-    float f = b + c1.y;
-    float a2 = a * a;
-    float a3 = a2 * a;
-    float c = n * g + c1.z * (a + c1.w) * roughness + f * f * a3 * a3 * a2;
-    float r = min(c, 18.0);
-
-    return vec2(r, r * c0.z);
-}
-
-vec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0, vec2 environmentBrdf) {
-    #ifdef BRDF_V_HEIGHT_CORRELATED
-        vec3 reflectance = mix(environmentBrdf.xxx, environmentBrdf.yyy, specularEnvironmentR0);
-    #else
-        vec3 reflectance = specularEnvironmentR0 * environmentBrdf.x + environmentBrdf.y;
-    #endif
-    return reflectance;
-}
-
-vec3 getReflectanceFromAnalyticalBRDFLookup_Jones(float VdotN, vec3 reflectance0, vec3 reflectance90, float smoothness)
-{
-    // Schlick fresnel approximation, extended with basic smoothness term so that rough surfaces do not approach reflectance90 at grazing angle
-    float weight = mix(FRESNEL_MAXIMUM_ON_ROUGH, 1.0, smoothness);
-    return reflectance0 + weight * (reflectance90 - reflectance0) * pow(clamp(1.0 - VdotN, 0., 1.), 5.0);
-}
-
-vec3 getSheenReflectanceFromBRDFLookup(const vec3 reflectance0, float NdotV, float sheenAlphaG) {
-    vec2 environmentSheenBrdf = getCharlieSheenAnalyticalBRDFLookup_RomainGuy(NdotV, sheenAlphaG);
-    vec3 reflectance = reflectance0 * environmentSheenBrdf.x + environmentSheenBrdf.y;
-
-    return reflectance;
-}
-
-// Schlick's approximation for R0 (Fresnel Reflectance Values)
-// Keep for references
-// vec3 getR0fromAirToSurfaceIOR(vec3 ior1) {
-//     return getR0fromIOR(ior1, vec3(1.0));
-// }
-
-// vec3 getR0fromIOR(vec3 ior1, vec3 ior2) {
-//     vec3 t = (ior1 - ior2) / (ior1 + ior2);
-//     return t * t;
-// }
-
-// vec3 getIORfromAirToSurfaceR0(vec3 f0) {
-//     vec3 s = sqrt(f0);
-//     return (1.0 + s) / (1.0 - s);
-// }
-
-// f0 Remapping due to layers
-// vec3 getR0RemappedForClearCoat(vec3 f0, vec3 clearCoatF0) {
-//     vec3 iorBase = getIORfromAirToSurfaceR0(f0);
-//     vec3 clearCoatIor = getIORfromAirToSurfaceR0(clearCoatF0);
-//     return getR0fromIOR(iorBase, clearCoatIor);
-// }
-
-#ifdef CLEARCOAT
-    // Knowing ior clear coat is fix for the material
-    // Solving iorbase = 1 + sqrt(fo) / (1 - sqrt(fo)) and f0base = square((iorbase - iorclearcoat) / (iorbase - iorclearcoat))
-    // provide f0base = square(A + B * sqrt(fo)) / (B + A * sqrt(fo))
-    // where A = 1 - iorclearcoat
-    // and   B = 1 + iorclearcoat
-    vec3 getR0RemappedForClearCoat(vec3 f0) {
-        #ifdef CLEARCOAT_DEFAULTIOR
-            #ifdef MOBILE
-                return clamp(f0 * (f0 * 0.526868 + 0.529324) - 0.0482256, 0., 1.);
-            #else
-                return clamp(f0 * (f0 * (0.941892 - 0.263008 * f0) + 0.346479) - 0.0285998, 0., 1.);
-            #endif
-        #else
-            vec3 s = sqrt(f0);
-            vec3 t = (vClearCoatRefractionParams.z + vClearCoatRefractionParams.w * s) / (vClearCoatRefractionParams.w + vClearCoatRefractionParams.z * s);
-            return t * t;
-        #endif
-    }
-#endif
-
-// From Microfacet Models for Refraction through Rough Surfaces, Walter et al. 2007
-// Keep for references
-// float smithVisibilityG1_TrowbridgeReitzGGX(float dot, float alphaG)
-// {
-//     float tanSquared = (1.0 - dot * dot) / (dot * dot);
-//     return 2.0 / (1.0 + sqrt(1.0 + alphaG * alphaG * tanSquared));
-// }
-
-// float smithVisibility_TrowbridgeReitzGGX_Walter(float NdotL, float NdotV, float alphaG)
-// {
-//     float visibility = smithVisibilityG1_TrowbridgeReitzGGX(NdotL, alphaG) * smithVisibilityG1_TrowbridgeReitzGGX(NdotV, alphaG);
-//     visibility /= (4.0 * NdotL * NdotV); // Cook Torance Denominator  integrated in visibility to avoid issues when visibility function changes.
-//     return visibility;
-// }
-
-// From smithVisibilityG1_TrowbridgeReitzGGX * dot / dot to cancel the cook
-// torrance denominator :-)
-float smithVisibilityG1_TrowbridgeReitzGGXFast(float dot, float alphaG)
-{
-    #ifdef MOBILE
-        // Appply simplification as all squared root terms are below 1 and squared
-        return 1.0 / (dot + alphaG + (1.0 - alphaG) * dot ));
-    #else
-        float alphaSquared = alphaG * alphaG;
-        return 1.0 / (dot + sqrt(alphaSquared + (1.0 - alphaSquared) * dot * dot));
-    #endif
-}
-
-float smithVisibility_TrowbridgeReitzGGXFast(float NdotL, float NdotV, float alphaG)
-{
-    float visibility = smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL, alphaG) * smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV, alphaG);
-    // No Cook Torance Denominator as it is canceled out in the previous form
-    return visibility;
-}
-
-float visibility_Kelemen(float VdotH) {
-    // Simplified form integration the cook torrance denminator.
-    // Expanded is nl * nv / vh2 which factor with 1 / (4 * nl * nv)
-    // giving 1 / (4 * vh2))
-    return 0.25 / (VdotH * VdotH); 
-}
-
-// https://knarkowicz.wordpress.com/2018/01/04/cloth-shading/
-// https://blog.selfshadow.com/publications/s2017-shading-course/imageworks/s2017_pbs_imageworks_sheen.pdf
-// http://www.cs.utah.edu/~premoze/dbrdf/dBRDF.pdf
-float visibility_Ashikhmin(float NdotL, float NdotV)
-{
-    return 1. / (4. * (NdotL + NdotV - NdotL * NdotV));
-}
-
-float normalDistributionFunction_CharlieSheen(float NdotH, float alphaG)
-{
-    float invR = 1. / alphaG;
-    float cos2h = NdotH * NdotH;
-    float sin2h = 1. - cos2h;
-    return (2. + invR) * pow(sin2h, invR * .5) / (2. * PI);
-}
-
-// Trowbridge-Reitz (GGX)
-// Generalised Trowbridge-Reitz with gamma power=2.0
-float normalDistributionFunction_TrowbridgeReitzGGX(float NdotH, float alphaG)
-{
-    // Note: alphaG is average slope (gradient) of the normals in slope-space.
-    // It is also the (trigonometric) tangent of the median distribution value, i.e. 50% of normals have
-    // a tangent (gradient) closer to the macrosurface than this slope.
-    float a2 = square(alphaG);
-    float d = NdotH * NdotH * (a2 - 1.0) + 1.0;
-    return a2 / (PI * d * d);
-}
-
-// Aniso parameter remapping
-// https://blog.selfshadow.com/publications/s2017-shading-course/imageworks/s2017_pbs_imageworks_slides_v2.pdf page 24
-vec2 getAnisotropicRoughness(float alphaG, float anisotropy) {
-    float alphaT = max(alphaG * (1.0 + anisotropy), MINIMUMVARIANCE);
-    float alphaB = max(alphaG * (1.0 - anisotropy), MINIMUMVARIANCE);
-    return vec2(alphaT, alphaB);
-}
-
-// Aniso Bent Normals
-// Mc Alley https://www.gdcvault.com/play/1022235/Rendering-the-World-of-Far 
-vec3 getAnisotropicBentNormals(const vec3 T, const vec3 B, const vec3 N, const vec3 V, float anisotropy) {
-    vec3 anisotropicFrameDirection = anisotropy >= 0.0 ? B : T;
-    vec3 anisotropicFrameTangent = cross(normalize(anisotropicFrameDirection), V);
-    vec3 anisotropicFrameNormal = cross(anisotropicFrameTangent, anisotropicFrameDirection);
-    vec3 anisotropicNormal = normalize(mix(N, anisotropicFrameNormal, abs(anisotropy)));
-    return anisotropicNormal;
-
-    // should we also do http://advances.realtimerendering.com/s2018/Siggraph%202018%20HDRP%20talk_with%20notes.pdf page 80 ?
-}
-
-// GGX Distribution Anisotropic
-// https://blog.selfshadow.com/publications/s2012-shading-course/burley/s2012_pbs_disney_brdf_notes_v3.pdf Addenda
-float normalDistributionFunction_BurleyGGX_Anisotropic(float NdotH, float TdotH, float BdotH, const vec2 alphaTB) {
-    float a2 = alphaTB.x * alphaTB.y;
-    vec3 v = vec3(alphaTB.y * TdotH, alphaTB.x  * BdotH, a2 * NdotH);
-    float v2 = dot(v, v);
-    float w2 = a2 / v2;
-    return a2 * w2 * w2 * RECIPROCAL_PI;
-}
-
-// GGX Mask/Shadowing Isotropic 
-// Heitz http://jcgt.org/published/0003/02/03/paper.pdf
-// https://twvideo01.ubm-us.net/o1/vault/gdc2017/Presentations/Hammon_Earl_PBR_Diffuse_Lighting.pdf
-float smithVisibility_GGXCorrelated(float NdotV, float NdotL, float alphaG) {
-    #ifdef MOBILE
-        // Appply simplification as all squared root terms are below 1 and squared
-        float GGXV = NdotL * (NdotV * (1.0 - alphaG) + alphaG);
-        float GGXL = NdotV * (NdotL * (1.0 - alphaG) + alphaG);
-        return 0.5 / (GGXV + GGXL);
-    #else
-        float a2 = alphaG * alphaG;
-        float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - a2) + a2);
-        float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - a2) + a2);
-        return 0.5 / (GGXV + GGXL);
-    #endif
-}
-
-// GGX Mask/Shadowing Anisotropic 
-// Heitz http://jcgt.org/published/0003/02/03/paper.pdf
-float smithVisibility_GGXCorrelated_Anisotropic(float NdotV, float NdotL, float TdotV, float BdotV, float TdotL, float BdotL, const vec2 alphaTB) {
-    float lambdaV = NdotL * length(vec3(alphaTB.x * TdotV, alphaTB.y * BdotV, NdotV));
-    float lambdaL = NdotV * length(vec3(alphaTB.x * TdotL, alphaTB.y * BdotL, NdotL));
-    float v = 0.5 / (lambdaV + lambdaL);
-    return v;
-}
-
-vec3 fresnelSchlickGGX(float VdotH, vec3 reflectance0, vec3 reflectance90)
-{
-    return reflectance0 + (reflectance90 - reflectance0) * pow(1.0 - VdotH, 5.0);
-}
-
-float fresnelSchlickGGX(float VdotH, float reflectance0, float reflectance90)
-{
-    return reflectance0 + (reflectance90 - reflectance0) * pow(1.0 - VdotH, 5.0);
-}
-
-// From beer lambert law I1/I0 = e −α′lc
-// c is considered included in alpha
-// https://blog.selfshadow.com/publications/s2017-shading-course/drobot/s2017_pbs_multilayered.pdf page 47
-// where L on a thin constant size layer can be (d * ((NdotLRefract + NdotVRefract) / (NdotLRefract * NdotVRefract))
-vec3 cocaLambert(float NdotVRefract, float NdotLRefract, vec3 alpha, float thickness) {
-    return exp(alpha * -(thickness * ((NdotLRefract + NdotVRefract) / (NdotLRefract * NdotVRefract))));
-}
-// From beerLambert Solves what alpha should be for a given resutlt at a known distance.
-vec3 computeColorAtDistanceInMedia(vec3 color, float distance) {
-    return -log(color) / distance;
-}
-
-// Disney diffuse term
-// https://blog.selfshadow.com/publications/s2012-shading-course/burley/s2012_pbs_disney_brdf_notes_v3.pdf
-// Page 14
-float computeDiffuseTerm(float NdotL, float NdotV, float VdotH, float roughness) {
-    // Diffuse fresnel falloff as per Disney principled BRDF, and in the spirit of
-    // of general coupled diffuse/specular models e.g. Ashikhmin Shirley.
-    float diffuseFresnelNV = pow(clamp(1.0 - NdotL, 0.000001, 1.), 5.0);
-    float diffuseFresnelNL = pow(clamp(1.0 - NdotV, 0.000001, 1.), 5.0);
-    float diffuseFresnel90 = 0.5 + 2.0 * VdotH * VdotH * roughness;
-    float fresnel =
-        (1.0 + (diffuseFresnel90 - 1.0) * diffuseFresnelNL) *
-        (1.0 + (diffuseFresnel90 - 1.0) * diffuseFresnelNV);
-
-    return fresnel / PI;
-}
-
-// Cook Torance Specular computation.
-vec3 computeSpecularTerm(float NdotH, float NdotL, float NdotV, float VdotH, float roughness, vec3 reflectance0, vec3 reflectance90, float geometricRoughnessFactor) {
-    roughness = max(roughness, geometricRoughnessFactor);
-    float alphaG = convertRoughnessToAverageSlope(roughness);
-
-    float distribution = normalDistributionFunction_TrowbridgeReitzGGX(NdotH, alphaG);
-
-    #ifdef BRDF_V_HEIGHT_CORRELATED
-        float visibility = smithVisibility_GGXCorrelated(NdotL, NdotV, alphaG);
-    #else
-        float visibility = smithVisibility_TrowbridgeReitzGGXFast(NdotL, NdotV, alphaG);
-    #endif
-
-    float specTerm = max(0., visibility * distribution);
-
-    vec3 fresnel = fresnelSchlickGGX(VdotH, reflectance0, reflectance90);
-    return fresnel * specTerm;
-}
-
-#ifdef SHEEN
-    vec3 computeSheenTerm(float NdotH, float NdotL, float NdotV, float VdotH, float roughness, vec3 reflectance0, vec3 reflectance90, float geometricRoughnessFactor) {
-        roughness = max(roughness, geometricRoughnessFactor);
-        float alphaG = convertRoughnessToAverageSlope(roughness);
-
-        float distribution = normalDistributionFunction_CharlieSheen(NdotH, alphaG);
-        float visibility = visibility_Ashikhmin(NdotL, NdotV);
-
-        float specTerm = max(0., visibility * distribution);
-
-        vec3 fresnel = fresnelSchlickGGX(VdotH, reflectance0, reflectance90);
-        return vec3(specTerm);
-    }
-#endif
-
-#ifdef ANISOTROPIC
-    vec3 computeAnisotropicSpecularTerm(float NdotH, float NdotL, float NdotV, float VdotH, float TdotH, float BdotH, float TdotV, float BdotV, float TdotL, float BdotL, float roughness, float anisotropy, vec3 reflectance0, vec3 reflectance90, float geometricRoughnessFactor) {
-        float alphaG = convertRoughnessToAverageSlope(roughness);
-        vec2 alphaTB = getAnisotropicRoughness(alphaG, anisotropy);
-        alphaTB = max(alphaTB, geometricRoughnessFactor * geometricRoughnessFactor);
-
-        float distribution = normalDistributionFunction_BurleyGGX_Anisotropic(NdotH, TdotH, BdotH, alphaTB);
-        float visibility = smithVisibility_GGXCorrelated_Anisotropic(NdotV, NdotL, TdotV, BdotV, TdotL, BdotL, alphaTB);
-        float specTerm = max(0., visibility * distribution);
-
-        vec3 fresnel = fresnelSchlickGGX(VdotH, reflectance0, reflectance90);
-        return fresnel * specTerm;
-    }
-#endif
-
-#ifdef CLEARCOAT
-    vec2 computeClearCoatTerm(float NdotH, float VdotH, float clearCoatRoughness, float geometricRoughnessFactor, float clearCoatIntensity) {
-        clearCoatRoughness = max(clearCoatRoughness, geometricRoughnessFactor);
-        float alphaG = convertRoughnessToAverageSlope(clearCoatRoughness);
-
-        float distribution = normalDistributionFunction_TrowbridgeReitzGGX(NdotH, alphaG);
-        float visibility = visibility_Kelemen(VdotH);
-        float clearCoatTerm = max(0., visibility * distribution);
-
-        float fresnel = fresnelSchlickGGX(VdotH, vClearCoatRefractionParams.x, CLEARCOATREFLECTANCE90);
-        fresnel *= clearCoatIntensity;
-        
-        return vec2(fresnel * clearCoatTerm, 1.0 - fresnel);
-    }
-
-    vec3 computeClearCoatAbsorption(float NdotVRefract, float NdotLRefract, vec3 clearCoatColor, float clearCoatThickness, float clearCoatIntensity) {
-        vec3 clearCoatAbsorption = mix(vec3(1.0),
-            cocaLambert(NdotVRefract, NdotLRefract, clearCoatColor, clearCoatThickness),
-            clearCoatIntensity);
-        return clearCoatAbsorption;
-    }
-#endif
-
-float adjustRoughnessFromLightProperties(float roughness, float lightRadius, float lightDistance)
-{
-    #if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF)
-        // At small angle this approximation works. 
-        float lightRoughness = lightRadius / lightDistance;
-        // Distribution can sum.
-        float totalRoughness = clamp(lightRoughness + roughness, 0., 1.);
-        return totalRoughness;
-    #else
-        return roughness;
-    #endif
-}
-
-float computeDefaultMicroSurface(float microSurface, vec3 reflectivityColor)
-{
-    const float kReflectivityNoAlphaWorkflow_SmoothnessMax = 0.95;
-
-    float reflectivityLuminance = getLuminance(reflectivityColor);
-    float reflectivityLuma = sqrt(reflectivityLuminance);
-    microSurface = reflectivityLuma * kReflectivityNoAlphaWorkflow_SmoothnessMax;
-
-    return microSurface;
-}
-
-// For typical incident reflectance range (between 4% to 100%) set the grazing reflectance to 100% for typical fresnel effect.
-// For very low reflectance range on highly diffuse objects (below 4%), incrementally reduce grazing reflecance to 0%.
-float fresnelGrazingReflectance(float reflectance0) {
-    float reflectance90 = clamp(reflectance0 * 25.0, 0.0, 1.0);
-    return reflectance90;
-}
-
-// To enable 8 bit textures to be used we need to pack and unpack the LOD
-//inverse alpha is used to work around low-alpha bugs in Edge and Firefox
-#define UNPACK_LOD(x) (1.0 - x) * 255.0
-
-float getLodFromAlphaG(float cubeMapDimensionPixels, float alphaG, float NdotV) {
-    float microsurfaceAverageSlope = alphaG;
-
-    // Compensate for solid angle change between half-vector measure (Blinn-Phong) and reflected-vector measure (Phong):
-    //  dWr = 4*cos(theta)*dWh,
-    // where dWr = solid angle (delta omega) in environment incident radiance (reflection-vector) measure;
-    // where dWh = solid angle (delta omega) in microfacet normal (half-vector) measure;
-    // so the relationship is proportional to cosine theta = NdotV.
-    // The constant factor of four is handled elsewhere as part of the scale/offset filter parameters.
-    microsurfaceAverageSlope *= sqrt(abs(NdotV));
-
-    float microsurfaceAverageSlopeTexels = microsurfaceAverageSlope * cubeMapDimensionPixels;
-    float lod = log2(microsurfaceAverageSlopeTexels);
-    return lod;
-}
-
-float environmentRadianceOcclusion(float ambientOcclusion, float NdotVUnclamped) {
-    // Best balanced (implementation time vs result vs perf) analytical environment specular occlusion found.
-    // http://research.tri-ace.com/Data/cedec2011_RealtimePBR_Implementation_e.pptx
-    float temp = NdotVUnclamped + ambientOcclusion;
-    return clamp(square(temp) - 1.0 + ambientOcclusion, 0.0, 1.0);
-}
-
-float environmentHorizonOcclusion(vec3 view, vec3 normal) {
-    // http://marmosetco.tumblr.com/post/81245981087
-    vec3 reflection = reflect(view, normal);
-    float temp = clamp( 1.0 + 1.1 * dot(reflection, normal), 0.0, 1.0);
-    return square(temp);
-}

+ 101 - 0
src/Shaders/ShadersInclude/pbrHelperFunctions.fx

@@ -0,0 +1,101 @@
+// Constants
+#define RECIPROCAL_PI2 0.15915494
+#define RECIPROCAL_PI 0.31830988618
+
+// AlphaG epsilon to avoid numerical issues
+#define MINIMUMVARIANCE 0.0005
+
+float convertRoughnessToAverageSlope(float roughness)
+{
+    // Calculate AlphaG as square of roughness; add epsilon to avoid numerical issues
+    return square(roughness) + MINIMUMVARIANCE;
+}
+
+float fresnelGrazingReflectance(float reflectance0) {
+    // For typical incident reflectance range (between 4% to 100%) set the grazing reflectance to 100% for typical fresnel effect.
+    // For very low reflectance range on highly diffuse objects (below 4%), incrementally reduce grazing reflecance to 0%.
+    float reflectance90 = saturate(reflectance0 * 25.0);
+    return reflectance90;
+}
+
+vec2 getAARoughnessFactors(vec3 normalVector) {
+    #ifdef SPECULARAA
+        vec3 nDfdx = dFdx(normalVector.xyz);
+        vec3 nDfdy = dFdy(normalVector.xyz);
+        float slopeSquare = max(dot(nDfdx, nDfdx), dot(nDfdy, nDfdy));
+
+        // Vive analytical lights roughness factor.
+        float geometricRoughnessFactor = pow(saturate(slopeSquare), 0.333);
+
+        // Adapt linear roughness (alphaG) to geometric curvature of the current pixel.
+        float geometricAlphaGFactor = sqrt(slopeSquare);
+        // BJS factor.
+        geometricAlphaGFactor *= 0.75;
+
+        return vec2(geometricRoughnessFactor, geometricAlphaGFactor);
+    #else
+        return vec2(0.);
+    #endif
+}
+
+#ifdef ANISOTROPIC
+    // Aniso parameter remapping
+    // https://blog.selfshadow.com/publications/s2017-shading-course/imageworks/s2017_pbs_imageworks_slides_v2.pdf page 24
+    vec2 getAnisotropicRoughness(float alphaG, float anisotropy) {
+        float alphaT = max(alphaG * (1.0 + anisotropy), MINIMUMVARIANCE);
+        float alphaB = max(alphaG * (1.0 - anisotropy), MINIMUMVARIANCE);
+        return vec2(alphaT, alphaB);
+    }
+
+    // Aniso Bent Normals
+    // Mc Alley https://www.gdcvault.com/play/1022235/Rendering-the-World-of-Far 
+    vec3 getAnisotropicBentNormals(const vec3 T, const vec3 B, const vec3 N, const vec3 V, float anisotropy) {
+        vec3 anisotropicFrameDirection = anisotropy >= 0.0 ? B : T;
+        vec3 anisotropicFrameTangent = cross(normalize(anisotropicFrameDirection), V);
+        vec3 anisotropicFrameNormal = cross(anisotropicFrameTangent, anisotropicFrameDirection);
+        vec3 anisotropicNormal = normalize(mix(N, anisotropicFrameNormal, abs(anisotropy)));
+        return anisotropicNormal;
+
+        // should we also do http://advances.realtimerendering.com/s2018/Siggraph%202018%20HDRP%20talk_with%20notes.pdf page 80 ?
+    }
+#endif
+
+#ifdef CLEARCOAT
+    // From beer lambert law I1/I0 = e −α′lc
+    // c is considered included in alpha
+    // https://blog.selfshadow.com/publications/s2017-shading-course/drobot/s2017_pbs_multilayered.pdf page 47
+    // where L on a thin constant size layer can be (d * ((NdotLRefract + NdotVRefract) / (NdotLRefract * NdotVRefract))
+    vec3 cocaLambert(float NdotVRefract, float NdotLRefract, vec3 alpha, float thickness) {
+        return exp(alpha * -(thickness * ((NdotLRefract + NdotVRefract) / (NdotLRefract * NdotVRefract))));
+    }
+
+    // From beerLambert Solves what alpha should be for a given resutlt at a known distance.
+    vec3 computeColorAtDistanceInMedia(vec3 color, float distance) {
+        return -log(color) / distance;
+    }
+
+    vec3 computeClearCoatAbsorption(float NdotVRefract, float NdotLRefract, vec3 clearCoatColor, float clearCoatThickness, float clearCoatIntensity) {
+        vec3 clearCoatAbsorption = mix(vec3(1.0),
+            cocaLambert(NdotVRefract, NdotLRefract, clearCoatColor, clearCoatThickness),
+            clearCoatIntensity);
+        return clearCoatAbsorption;
+    }
+#endif
+
+// ___________________________________________________________________________________
+//
+// LEGACY
+// ___________________________________________________________________________________
+
+#ifdef MICROSURFACEAUTOMATIC
+    float computeDefaultMicroSurface(float microSurface, vec3 reflectivityColor)
+    {
+        const float kReflectivityNoAlphaWorkflow_SmoothnessMax = 0.95;
+
+        float reflectivityLuminance = getLuminance(reflectivityColor);
+        float reflectivityLuma = sqrt(reflectivityLuminance);
+        microSurface = reflectivityLuma * kReflectivityNoAlphaWorkflow_SmoothnessMax;
+
+        return microSurface;
+    }
+#endif

+ 50 - 0
src/Shaders/ShadersInclude/pbrIBLFunctions.fx

@@ -0,0 +1,50 @@
+#if defined(REFLECTION) || defined(REFRACTION)
+    float getLodFromAlphaG(float cubeMapDimensionPixels, float microsurfaceAverageSlope) {
+        float microsurfaceAverageSlopeTexels = microsurfaceAverageSlope * cubeMapDimensionPixels;
+        float lod = log2(microsurfaceAverageSlopeTexels);
+        return lod;
+    }
+#endif
+
+#if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)
+    float environmentRadianceOcclusion(float ambientOcclusion, float NdotVUnclamped) {
+        // Best balanced (implementation time vs result vs perf) analytical environment specular occlusion found.
+        // http://research.tri-ace.com/Data/cedec2011_RealtimePBR_Implementation_e.pptx
+        float temp = NdotVUnclamped + ambientOcclusion;
+        return saturate(square(temp) - 1.0 + ambientOcclusion);
+    }
+#endif
+
+#if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)
+    float environmentHorizonOcclusion(vec3 view, vec3 normal) {
+        // http://marmosetco.tumblr.com/post/81245981087
+        vec3 reflection = reflect(view, normal);
+        float temp = saturate(1.0 + 1.1 * dot(reflection, normal));
+        return square(temp);
+    }
+#endif
+
+// ___________________________________________________________________________________
+//
+// LEGACY
+// ___________________________________________________________________________________
+
+#if defined(LODINREFLECTIONALPHA) || defined(LODINREFRACTIONALPHA)
+    // To enable 8 bit textures to be used we need to pack and unpack the LOD
+    //inverse alpha is used to work around low-alpha bugs in Edge and Firefox
+    #define UNPACK_LOD(x) (1.0 - x) * 255.0
+
+    float getLodFromAlphaG(float cubeMapDimensionPixels, float alphaG, float NdotV) {
+        float microsurfaceAverageSlope = alphaG;
+
+        // Compensate for solid angle change between half-vector measure (Blinn-Phong) and reflected-vector measure (Phong):
+        //  dWr = 4*cos(theta)*dWh,
+        // where dWr = solid angle (delta omega) in environment incident radiance (reflection-vector) measure;
+        // where dWh = solid angle (delta omega) in microfacet normal (half-vector) measure;
+        // so the relationship is proportional to cosine theta = NdotV.
+        // The constant factor of four is handled elsewhere as part of the scale/offset filter parameters.
+        microsurfaceAverageSlope *= sqrt(abs(NdotV));
+
+        return getLodFromAlphaG(cubeMapDimensionPixels, microsurfaceAverageSlope);
+    }
+#endif

+ 0 - 87
src/Shaders/ShadersInclude/pbrLightingFunctions.fx

@@ -1,87 +0,0 @@
-// Light Results
-struct lightingInfo
-{
-    vec3 diffuse;
-    #ifdef SPECULARTERM
-        vec3 specular;
-    #endif
-    #ifdef CLEARCOAT
-        // xyz contains the clearcoat color.
-        // w contains the 1 - clearcoat fresnel to ease the energy conservation computation.
-        vec4 clearCoat;
-    #endif
-    #ifdef SHEEN
-        vec3 sheen;
-    #endif
-};
-
-vec3 computeHemisphericDiffuseLighting(preLightingInfo info, vec3 lightColor, vec3 groundColor) {
-    return mix(groundColor, lightColor, info.NdotL);
-}
-
-vec3 computeDiffuseLighting(preLightingInfo info, vec3 lightColor) {
-    float diffuseTerm = computeDiffuseTerm(info.NdotL, info.NdotV, info.VdotH, info.roughness);
-    return diffuseTerm * info.attenuation * info.NdotL * lightColor;
-}
-
-vec3 computeSpecularLighting(preLightingInfo info, vec3 N, vec3 reflectance0, vec3 reflectance90, float geometricRoughnessFactor, vec3 lightColor) {
-    float NdotH = clamp(dot(N, info.H), 0.000000000001, 1.0);
-
-    vec3 specTerm = computeSpecularTerm(NdotH, info.NdotL, info.NdotV, info.VdotH, info.roughness, reflectance0, reflectance90, geometricRoughnessFactor);
-    return specTerm * info.attenuation * info.NdotL * lightColor;
-}
-
-#ifdef ANISOTROPIC
-    vec3 computeAnisotropicSpecularLighting(preLightingInfo info, vec3 V, vec3 N, vec3 T, vec3 B, float anisotropy, vec3 reflectance0, vec3 reflectance90, float geometricRoughnessFactor, vec3 lightColor) {
-        float NdotH = clamp(dot(N, info.H), 0.000000000001, 1.0);
-
-        float TdotH = dot(T, info.H);
-        float BdotH = dot(B, info.H);
-
-        float TdotV = dot(T, V);
-        float BdotV = dot(B, V);
-        float TdotL = dot(T, info.L);
-        float BdotL = dot(B, info.L);
-
-        vec3 specTerm = computeAnisotropicSpecularTerm(NdotH, info.NdotL, info.NdotV, info.VdotH, TdotH, BdotH, TdotV, BdotV, TdotL, BdotL, info.roughness, anisotropy, reflectance0, reflectance90, geometricRoughnessFactor);
-        return specTerm * info.attenuation * info.NdotL * lightColor;
-    }
-#endif
-
-#ifdef CLEARCOAT
-    vec4 computeClearCoatLighting(preLightingInfo info, vec3 Ncc, float geometricRoughnessFactor, float clearCoatIntensity, vec3 lightColor) {
-        float NccdotL = clamp(dot(Ncc, info.L), 0.00000000001, 1.0);
-        float NccdotH = clamp(dot(Ncc, info.H), 0.000000000001, 1.0);
-
-        vec2 clearCoatTerm = computeClearCoatTerm(NccdotH, info.VdotH, info.roughness, geometricRoughnessFactor, clearCoatIntensity);
-
-        vec4 result = vec4(0.);
-        result.rgb = clearCoatTerm.x * info.attenuation * NccdotL * lightColor;
-        result.a = clearCoatTerm.y;
-        return result;
-    }
-
-    vec3 computeClearCoatLightingAbsorption(float NdotVRefract, vec3 L, vec3 Ncc, vec3 clearCoatColor, float clearCoatThickness, float clearCoatIntensity) {
-        vec3 LRefract = -refract(L, Ncc, vClearCoatRefractionParams.y);
-        float NdotLRefract = clamp(dot(Ncc, LRefract), 0.00000000001, 1.0);
-
-        vec3 absorption = computeClearCoatAbsorption(NdotVRefract, NdotLRefract, clearCoatColor, clearCoatThickness, clearCoatIntensity);
-        return absorption;
-    }
-#endif
-
-#ifdef SHEEN
-    vec3 computeSheenLighting(preLightingInfo info, vec3 N, vec3 reflectance0, vec3 reflectance90, float geometricRoughnessFactor, vec3 lightColor) {
-        float NdotH = clamp(dot(N, info.H), 0.000000000001, 1.0);
-
-        vec3 specTerm = computeSheenTerm(NdotH, info.NdotL, info.NdotV, info.VdotH, info.roughness, reflectance0, reflectance90, geometricRoughnessFactor);
-        return specTerm * info.attenuation * info.NdotL * lightColor;
-    }
-#endif
-
-vec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler, mat4 textureProjectionMatrix){
-	vec4 strq = textureProjectionMatrix * vec4(vPositionW, 1.0);
-	strq /= strq.w;
-	vec3 textureColor = texture2D(projectionLightSampler, strq.xy).rgb;
-	return toLinearSpace(textureColor);
-}

+ 6 - 0
src/Shaders/ShadersInclude/shadowsFragmentFunctions.fx

@@ -7,6 +7,12 @@
         }
     #endif
 
+    float computeFallOff(float value, vec2 clipSpace, float frustumEdgeFalloff)
+    {
+        float mask = smoothstep(1.0 - frustumEdgeFalloff, 1.0, clamp(dot(clipSpace, clipSpace), 0., 1.));
+        return mix(value, 1.0, mask);
+    }
+
     float computeShadowCube(vec3 lightPosition, samplerCube shadowSampler, float darkness, vec2 depthValues)
     {
         vec3 directionToLight = vPositionW - lightPosition;

+ 6 - 6
src/Shaders/background.fragment.fx

@@ -107,7 +107,7 @@ varying vec3 vNormalW;
     {
         // Schlick fresnel approximation, extended with basic smoothness term so that rough surfaces do not approach reflectance90 at grazing angle
         float weight = mix(FRESNEL_MAXIMUM_ON_ROUGH, 1.0, smoothness);
-        return reflectance0 + weight * (reflectance90 - reflectance0) * pow(clamp(1.0 - VdotN, 0., 1.), 5.0);
+        return reflectance0 + weight * (reflectance90 - reflectance0) * pow5(saturate(1.0 - VdotN));
     }
 #endif
 
@@ -163,7 +163,7 @@ vec4 reflectionColor = vec4(1., 1., 1., 1.);
             reflectionLOD = reflectionLOD * log2(vReflectionMicrosurfaceInfos.x) * vReflectionMicrosurfaceInfos.y + vReflectionMicrosurfaceInfos.z;
             reflectionColor = sampleReflectionLod(reflectionSampler, reflectionCoords, reflectionLOD);
         #else
-            float lodReflectionNormalized = clamp(reflectionLOD, 0., 1.);
+            float lodReflectionNormalized = saturate(reflectionLOD);
             float lodReflectionNormalizedDoubled = lodReflectionNormalized * 2.0;
 
             vec4 reflectionSpecularMid = sampleReflection(reflectionSampler, reflectionCoords);
@@ -249,16 +249,16 @@ float finalAlpha = alpha;
     vec3 reflectionReflectance90 = vReflectionControl.zzz;
     float VdotN = dot(normalize(vEyePosition), normalW);
 
-    vec3 planarReflectionFresnel = fresnelSchlickEnvironmentGGX(clamp(VdotN, 0.0, 1.0), reflectionReflectance0, reflectionReflectance90, 1.0);
+    vec3 planarReflectionFresnel = fresnelSchlickEnvironmentGGX(saturate(VdotN), reflectionReflectance0, reflectionReflectance90, 1.0);
     reflectionAmount *= planarReflectionFresnel;
 
     #ifdef REFLECTIONFALLOFF
-        float reflectionDistanceFalloff = 1.0 - clamp(length(vPositionW.xyz - vBackgroundCenter) * vReflectionControl.w, 0.0, 1.0);
+        float reflectionDistanceFalloff = 1.0 - saturate(length(vPositionW.xyz - vBackgroundCenter) * vReflectionControl.w);
         reflectionDistanceFalloff *= reflectionDistanceFalloff;
         reflectionAmount *= reflectionDistanceFalloff;
     #endif
 
-    finalColor = mix(finalColor, reflectionColor.rgb, clamp(reflectionAmount, 0., 1.));
+    finalColor = mix(finalColor, reflectionColor.rgb, saturate(reflectionAmount));
 #endif
 
 #ifdef OPACITYFRESNEL
@@ -266,7 +266,7 @@ float finalAlpha = alpha;
 
     // Fade out the floor plane as the angle between the floor and the camera tends to 0 (starting from startAngle)
     const float startAngle = 0.1;
-    float fadeFactor = clamp(viewAngleToFloor/startAngle, 0.0, 1.0);
+    float fadeFactor = saturate(viewAngleToFloor/startAngle);
 
     finalAlpha *= fadeFactor * fadeFactor;
 #endif

+ 40 - 273
src/Shaders/pbr.fragment.fx

@@ -12,279 +12,43 @@
 
 precision highp float;
 
-#include<__decl__pbrFragment>
-
-uniform vec4 vEyePosition;
-uniform vec3 vAmbientColor;
-uniform vec4 vCameraInfos;
-
-// Input
-varying vec3 vPositionW;
-
-#if DEBUGMODE > 0
-    uniform vec2 vDebugMode;
-    varying vec4 vClipSpacePosition;
-#endif
-
-#ifdef MAINUV1
-    varying vec2 vMainUV1;
-#endif 
-
-#ifdef MAINUV2 
-    varying vec2 vMainUV2;
-#endif 
-
-#ifdef NORMAL
-    varying vec3 vNormalW;
-    #if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
-        varying vec3 vEnvironmentIrradiance;
-    #endif
-#endif
-
-#ifdef VERTEXCOLOR
-varying vec4 vColor;
-#endif
-
-// Lights
-#include<__decl__lightFragment>[0..maxSimultaneousLights]
-
-// Samplers
-#ifdef ALBEDO
-    #if ALBEDODIRECTUV == 1
-        #define vAlbedoUV vMainUV1
-    #elif ALBEDODIRECTUV == 2
-        #define vAlbedoUV vMainUV2
-    #else
-        varying vec2 vAlbedoUV;
-    #endif
-    uniform sampler2D albedoSampler;
-#endif
-
-#ifdef AMBIENT
-    #if AMBIENTDIRECTUV == 1
-        #define vAmbientUV vMainUV1
-    #elif AMBIENTDIRECTUV == 2
-        #define vAmbientUV vMainUV2
-    #else
-        varying vec2 vAmbientUV;
-    #endif
-    uniform sampler2D ambientSampler;
-#endif
-
-#ifdef OPACITY
-    #if OPACITYDIRECTUV == 1
-        #define vOpacityUV vMainUV1
-    #elif OPACITYDIRECTUV == 2
-        #define vOpacityUV vMainUV2
-    #else
-        varying vec2 vOpacityUV;
-    #endif
-    uniform sampler2D opacitySampler;
-#endif
-
-#ifdef EMISSIVE
-    #if EMISSIVEDIRECTUV == 1
-        #define vEmissiveUV vMainUV1
-    #elif EMISSIVEDIRECTUV == 2
-        #define vEmissiveUV vMainUV2
-    #else
-        varying vec2 vEmissiveUV;
-    #endif
-    uniform sampler2D emissiveSampler;
-#endif
-
-#ifdef LIGHTMAP
-    #if LIGHTMAPDIRECTUV == 1
-        #define vLightmapUV vMainUV1
-    #elif LIGHTMAPDIRECTUV == 2
-        #define vLightmapUV vMainUV2
-    #else
-        varying vec2 vLightmapUV;
-    #endif
-    uniform sampler2D lightmapSampler;
-#endif
-
-#ifdef REFLECTIVITY
-    #if REFLECTIVITYDIRECTUV == 1
-        #define vReflectivityUV vMainUV1
-    #elif REFLECTIVITYDIRECTUV == 2
-        #define vReflectivityUV vMainUV2
-    #else
-        varying vec2 vReflectivityUV;
-    #endif
-    uniform sampler2D reflectivitySampler;
-#endif
-
-#ifdef MICROSURFACEMAP
-    #if MICROSURFACEMAPDIRECTUV == 1
-        #define vMicroSurfaceSamplerUV vMainUV1
-    #elif MICROSURFACEMAPDIRECTUV == 2
-        #define vMicroSurfaceSamplerUV vMainUV2
-    #else
-        varying vec2 vMicroSurfaceSamplerUV;
-    #endif
-    uniform sampler2D microSurfaceSampler;
-#endif
-
-#ifdef CLEARCOAT
-    #ifdef CLEARCOAT_TEXTURE
-        #if CLEARCOAT_TEXTUREDIRECTUV == 1
-            #define vClearCoatUV vMainUV1
-        #elif CLEARCOAT_TEXTUREDIRECTUV == 2
-            #define vClearCoatUV vMainUV2
-        #else
-            varying vec2 vClearCoatUV;
-        #endif
-        uniform sampler2D clearCoatSampler;
-    #endif
-
-    #ifdef CLEARCOAT_BUMP
-        #if CLEARCOAT_BUMPDIRECTUV == 1
-            #define vClearCoatBumpUV vMainUV1
-        #elif CLEARCOAT_BUMPDIRECTUV == 2
-            #define vClearCoatBumpUV vMainUV2
-        #else
-            varying vec2 vClearCoatBumpUV;
-        #endif
-        uniform sampler2D clearCoatBumpSampler;
-    #endif
-
-    #ifdef CLEARCOAT_TINT_TEXTURE
-        #if CLEARCOAT_TINT_TEXTUREDIRECTUV == 1
-            #define vClearCoatTintUV vMainUV1
-        #elif CLEARCOAT_TINT_TEXTUREDIRECTUV == 2
-            #define vClearCoatTintUV vMainUV2
-        #else
-            varying vec2 vClearCoatTintUV;
-        #endif
-        uniform sampler2D clearCoatTintSampler;
-    #endif
-#endif
-
-#ifdef SHEEN
-    #ifdef SHEEN_TEXTURE
-        #if SHEEN_TEXTUREDIRECTUV == 1
-            #define vSheenUV vMainUV1
-        #elif SHEEN_TEXTUREDIRECTUV == 2
-            #define vSheenUV vMainUV2
-        #else
-            varying vec2 vSheenUV;
-        #endif
-        uniform sampler2D sheenSampler;
-    #endif
-#endif
-
-#ifdef ANISOTROPIC
-    #ifdef ANISOTROPIC_TEXTURE
-        #if ANISOTROPIC_TEXTUREDIRECTUV == 1
-            #define vAnisotropyUV vMainUV1
-        #elif ANISOTROPIC_TEXTUREDIRECTUV == 2
-            #define vAnisotropyUV vMainUV2
-        #else
-            varying vec2 vAnisotropyUV;
-        #endif
-        uniform sampler2D anisotropySampler;
-    #endif
-#endif
-
-// Refraction
-#ifdef REFRACTION
-    #ifdef REFRACTIONMAP_3D
-        #define sampleRefraction(s, c) textureCube(s, c)
-        
-        uniform samplerCube refractionSampler;
-
-        #ifdef LODBASEDMICROSFURACE
-            #define sampleRefractionLod(s, c, l) textureCubeLodEXT(s, c, l)
-        #else
-            uniform samplerCube refractionSamplerLow;
-            uniform samplerCube refractionSamplerHigh;
-        #endif
-    #else
-        #define sampleRefraction(s, c) texture2D(s, c)
-        
-        uniform sampler2D refractionSampler;
-
-        #ifdef LODBASEDMICROSFURACE
-            #define sampleRefractionLod(s, c, l) texture2DLodEXT(s, c, l)
-        #else
-            uniform samplerCube refractionSamplerLow;
-            uniform samplerCube refractionSamplerHigh;
-        #endif
-    #endif
-#endif
-
-// Reflection
-#ifdef REFLECTION
-    #ifdef REFLECTIONMAP_3D
-        #define sampleReflection(s, c) textureCube(s, c)
-
-        uniform samplerCube reflectionSampler;
-        
-        #ifdef LODBASEDMICROSFURACE
-            #define sampleReflectionLod(s, c, l) textureCubeLodEXT(s, c, l)
-        #else
-            uniform samplerCube reflectionSamplerLow;
-            uniform samplerCube reflectionSamplerHigh;
-        #endif
-    #else
-        #define sampleReflection(s, c) texture2D(s, c)
-
-        uniform sampler2D reflectionSampler;
-
-        #ifdef LODBASEDMICROSFURACE
-            #define sampleReflectionLod(s, c, l) texture2DLodEXT(s, c, l)
-        #else
-            uniform samplerCube reflectionSamplerLow;
-            uniform samplerCube reflectionSamplerHigh;
-        #endif
-    #endif
-
-    #ifdef REFLECTIONMAP_SKYBOX
-        varying vec3 vPositionUVW;
-    #else
-        #if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
-            varying vec3 vDirectionW;
-        #endif
-    #endif
-
-    #include<reflectionFunction>
-#endif
-
-#ifdef ENVIRONMENTBRDF
-    uniform sampler2D environmentBrdfSampler;
-#endif
-
 // Forces linear space for image processing
 #ifndef FROMLINEARSPACE
     #define FROMLINEARSPACE;
 #endif
 
+// Declaration
+#include<__decl__pbrFragment>
+#include<pbrFragmentExtraDeclaration>
+#include<__decl__lightFragment>[0..maxSimultaneousLights]
+#include<pbrFragmentSamplersDeclaration>
 #include<imageProcessingDeclaration>
+#include<clipPlaneFragmentDeclaration>
+#include<logDepthDeclaration>
+#include<fogFragmentDeclaration>
 
+// Helper Functions
 #include<helperFunctions>
-
+#include<pbrHelperFunctions>
 #include<imageProcessingFunctions>
-
-// PBR
 #include<shadowsFragmentFunctions>
-#include<pbrFunctions>
 #include<harmonicsFunctions>
-#include<pbrPreLightingFunctions>
-#include<pbrFalloffLightingFunctions>
-#include<pbrLightingFunctions>
-
+#include<pbrDirectLightingSetupFunctions>
+#include<pbrDirectLightingFalloffFunctions>
+#include<pbrBRDFFunctions>
+#include<pbrDirectLightingFunctions>
+#include<pbrIBLFunctions>
 #include<bumpFragmentFunctions>
-#include<clipPlaneFragmentDeclaration>
-#include<logDepthDeclaration>
 
-// Fog
-#include<fogFragmentDeclaration>
+#ifdef REFLECTION
+    #include<reflectionFunction>
+#endif
 
+// _____________________________ MAIN FUNCTION ____________________________
 void main(void) {
-#include<clipPlaneFragment>
 
-// _______________________________________________________________________________
+    #include<clipPlaneFragment>
+
 // _____________________________ Geometry Information ____________________________
     vec3 viewDirectionW = normalize(vEyePosition.xyz - vPositionW);
 
@@ -468,7 +232,7 @@ void main(void) {
     #endif
 
     // Adapt microSurface.
-    microSurface = clamp(microSurface, 0., 1.);
+    microSurface = saturate(microSurface);
     // Compute roughness.
     float roughness = 1. - microSurface;
 
@@ -490,7 +254,7 @@ void main(void) {
             vec3 normalForward = faceforward(normalW, -viewDirectionW, normalW);
 
             // Calculate the appropriate linear opacity for the current viewing angle (formally, this quantity is the "directional absorptance").
-            alpha = getReflectanceFromAnalyticalBRDFLookup_Jones(clamp(dot(viewDirectionW, normalForward), 0.0, 1.0), vec3(opacity0), vec3(opacity90), sqrt(microSurface)).x;
+            alpha = getReflectanceFromAnalyticalBRDFLookup_Jones(saturate(dot(viewDirectionW, normalForward)), vec3(opacity0), vec3(opacity90), sqrt(microSurface)).x;
 
             #ifdef ALPHATEST
                 if (alpha < ALPHATESTVALUE)
@@ -506,7 +270,8 @@ void main(void) {
 
     // _____________________________ Compute Geometry info _________________________________
     float NdotVUnclamped = dot(normalW, viewDirectionW);
-    float NdotV = clamp(NdotVUnclamped,0., 1.) + 0.00001;
+    // The order 1886 page 3.
+    float NdotV = absEps(NdotVUnclamped);
     float alphaG = convertRoughnessToAverageSlope(roughness);
     vec2 AARoughnessFactors = getAARoughnessFactors(normalW.xyz);
 
@@ -560,7 +325,7 @@ void main(void) {
         #ifdef LODINREFRACTIONALPHA
             float refractionLOD = getLodFromAlphaG(vRefractionMicrosurfaceInfos.x, alphaG, NdotVUnclamped);
         #else
-            float refractionLOD = getLodFromAlphaG(vRefractionMicrosurfaceInfos.x, alphaG, 1.0);
+            float refractionLOD = getLodFromAlphaG(vRefractionMicrosurfaceInfos.x, alphaG);
         #endif
 
         #ifdef LODBASEDMICROSFURACE
@@ -586,7 +351,7 @@ void main(void) {
 
             environmentRefraction = sampleRefractionLod(refractionSampler, refractionCoords, requestedRefractionLOD);
         #else
-            float lodRefractionNormalized = clamp(refractionLOD / log2(vRefractionMicrosurfaceInfos.x), 0., 1.);
+            float lodRefractionNormalized = saturate(refractionLOD / log2(vRefractionMicrosurfaceInfos.x));
             float lodRefractionNormalizedDoubled = lodRefractionNormalized * 2.0;
 
             vec4 environmentRefractionMid = sampleRefraction(refractionSampler, refractionCoords);
@@ -646,7 +411,7 @@ void main(void) {
         #if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
             float reflectionLOD = getLodFromAlphaG(vReflectionMicrosurfaceInfos.x, alphaG, NdotVUnclamped);
         #else
-            float reflectionLOD = getLodFromAlphaG(vReflectionMicrosurfaceInfos.x, alphaG, 1.);
+            float reflectionLOD = getLodFromAlphaG(vReflectionMicrosurfaceInfos.x, alphaG);
         #endif
 
         #ifdef LODBASEDMICROSFURACE
@@ -672,7 +437,7 @@ void main(void) {
 
             environmentRadiance = sampleReflectionLod(reflectionSampler, reflectionCoords, requestedReflectionLOD);
         #else
-            float lodReflectionNormalized = clamp(reflectionLOD / log2(vReflectionMicrosurfaceInfos.x), 0., 1.);
+            float lodReflectionNormalized = saturate(reflectionLOD / log2(vReflectionMicrosurfaceInfos.x));
             float lodReflectionNormalizedDoubled = lodReflectionNormalized * 2.0;
 
             vec4 environmentSpecularMid = sampleReflection(reflectionSampler, reflectionCoords);
@@ -740,7 +505,7 @@ void main(void) {
         #endif
 
         #ifdef SHEEN_LINKWITHALBEDO
-            float sheenFactor = pow(1.0-sheenIntensity, 5.0);
+            float sheenFactor = pow5(1.0-sheenIntensity);
             vec3 sheenColor = baseColor.rgb*(1.0-sheenFactor);
             float sheenRoughness = sheenIntensity;
             // remap albedo.
@@ -771,7 +536,7 @@ void main(void) {
             #if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
                 float sheenReflectionLOD = getLodFromAlphaG(vReflectionMicrosurfaceInfos.x, sheenAlphaG, NdotVUnclamped);
             #else
-                float sheenReflectionLOD = getLodFromAlphaG(vReflectionMicrosurfaceInfos.x, sheenAlphaG, 1.);
+                float sheenReflectionLOD = getLodFromAlphaG(vReflectionMicrosurfaceInfos.x, sheenAlphaG);
             #endif
 
             #ifdef LODBASEDMICROSFURACE
@@ -779,7 +544,7 @@ void main(void) {
                 sheenReflectionLOD = sheenReflectionLOD * vReflectionMicrosurfaceInfos.y + vReflectionMicrosurfaceInfos.z;
                 environmentSheenRadiance = sampleReflectionLod(reflectionSampler, reflectionCoords, sheenReflectionLOD);
             #else
-                float lodSheenReflectionNormalized = clamp(sheenReflectionLOD / log2(vReflectionMicrosurfaceInfos.x), 0., 1.);
+                float lodSheenReflectionNormalized = saturate(sheenReflectionLOD / log2(vReflectionMicrosurfaceInfos.x));
                 float lodSheenReflectionNormalizedDoubled = lodSheenReflectionNormalized * 2.0;
 
                 vec4 environmentSheenMid = sampleReflection(reflectionSampler, reflectionCoords);
@@ -879,7 +644,8 @@ void main(void) {
 
         // Compute N dot V.
         float clearCoatNdotVUnclamped = dot(clearCoatNormalW, viewDirectionW);
-        float clearCoatNdotV = clamp(clearCoatNdotVUnclamped,0., 1.) + 0.00001;
+        // The order 1886 page 3.
+        float clearCoatNdotV = absEps(clearCoatNdotVUnclamped);
 
         // Clear Coat Reflection
         #if defined(REFLECTION)
@@ -911,7 +677,7 @@ void main(void) {
             #if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
                 float clearCoatReflectionLOD = getLodFromAlphaG(vReflectionMicrosurfaceInfos.x, clearCoatAlphaG, clearCoatNdotVUnclamped);
             #else
-                float clearCoatReflectionLOD = getLodFromAlphaG(vReflectionMicrosurfaceInfos.x, clearCoatAlphaG, 1.);
+                float clearCoatReflectionLOD = getLodFromAlphaG(vReflectionMicrosurfaceInfos.x, clearCoatAlphaG);
             #endif
 
             #ifdef LODBASEDMICROSFURACE
@@ -921,7 +687,7 @@ void main(void) {
 
                 environmentClearCoatRadiance = sampleReflectionLod(reflectionSampler, clearCoatReflectionCoords, requestedClearCoatReflectionLOD);
             #else
-                float lodClearCoatReflectionNormalized = clamp(clearCoatReflectionLOD / log2(vReflectionMicrosurfaceInfos.x), 0., 1.);
+                float lodClearCoatReflectionNormalized = saturate(clearCoatReflectionLOD / log2(vReflectionMicrosurfaceInfos.x));
                 float lodClearCoatReflectionNormalizedDoubled = lodClearCoatReflectionNormalized * 2.0;
 
                 vec4 environmentClearCoatMid = sampleReflection(reflectionSampler, reflectionCoords);
@@ -951,7 +717,8 @@ void main(void) {
             #ifdef CLEARCOAT_TINT
                 // Used later on in the light fragment and ibl.
                 vec3 clearCoatVRefract = -refract(vPositionW, clearCoatNormalW, vClearCoatRefractionParams.y);
-                float clearCoatNdotVRefract = clamp(dot(clearCoatNormalW, clearCoatVRefract), 0.00000000001, 1.0);
+                // The order 1886 page 3.
+                float clearCoatNdotVRefract = absEps(dot(clearCoatNormalW, clearCoatVRefract));
                 vec3 absorption = vec3(0.);
             #endif
 
@@ -1115,7 +882,7 @@ void main(void) {
             // TODO. PBR Tinting.
             vec3 mixedAlbedo = surfaceAlbedo;
             float maxChannel = max(max(mixedAlbedo.r, mixedAlbedo.g), mixedAlbedo.b);
-            vec3 tint = clamp(maxChannel * mixedAlbedo, 0.0, 1.0);
+            vec3 tint = saturate(maxChannel * mixedAlbedo);
 
             // Decrease Albedo Contribution
             surfaceAlbedo *= alpha;
@@ -1252,7 +1019,7 @@ void main(void) {
         #endif
 
         #if defined(RADIANCEOVERALPHA) || defined(SPECULAROVERALPHA)
-            alpha = clamp(alpha + luminanceOverAlpha * luminanceOverAlpha, 0., 1.);
+            alpha = saturate(alpha + luminanceOverAlpha * luminanceOverAlpha);
         #endif
     #endif
 #endif

+ 2 - 1
src/node.ts

@@ -154,7 +154,8 @@ export class Node implements IBehaviorAware<Node> {
     }
 
     /**
-     * Gets or sets the parent of the node
+     * Gets or sets the parent of the node (without keeping the current position in the scene)
+     * @see https://doc.babylonjs.com/how_to/parenting
      */
     public set parent(parent: Nullable<Node>) {
         if (this._parentNode === parent) {

+ 45 - 0
src/scene.ts

@@ -3092,6 +3092,21 @@ export class Scene extends AbstractScene implements IAnimatable {
     }
 
     /**
+     * Get a material using its unique id
+     * @param uniqueId defines the material's unique id
+     * @return the material or null if none found.
+     */
+    public getMaterialByUniqueID(uniqueId: number): Nullable<Material> {
+        for (var index = 0; index < this.materials.length; index++) {
+            if (this.materials[index].uniqueId === uniqueId) {
+                return this.materials[index];
+            }
+        }
+
+        return null;
+    }
+
+    /**
      * get a material using its id
      * @param id defines the material's ID
      * @return the material or null if none found.
@@ -3398,6 +3413,21 @@ export class Scene extends AbstractScene implements IAnimatable {
     }
 
     /**
+     * Gets a transform node with its auto-generated unique id
+     * @param uniqueId efines the unique id to search for
+     * @return the found transform node or null if not found at all.
+     */
+    public getTransformNodeByUniqueID(uniqueId: number): Nullable<TransformNode> {
+        for (var index = 0; index < this.transformNodes.length; index++) {
+            if (this.transformNodes[index].uniqueId === uniqueId) {
+                return this.transformNodes[index];
+            }
+        }
+
+        return null;
+    }
+
+    /**
      * Gets a list of transform nodes using their id
      * @param id defines the id to search for
      * @returns a list of transform nodes
@@ -3586,6 +3616,21 @@ export class Scene extends AbstractScene implements IAnimatable {
     }
 
     /**
+     * Gets a skeleton using a given auto generated unique id
+     * @param  uniqueId defines the unique id to search for
+     * @return the found skeleton or null if not found at all.
+     */
+    public getSkeletonByUniqueId(uniqueId: number): Nullable<Skeleton> {
+        for (var index = 0; index < this.skeletons.length; index++) {
+            if (this.skeletons[index].uniqueId === uniqueId) {
+                return this.skeletons[index];
+            }
+        }
+
+        return null;
+    }
+
+    /**
      * Gets a skeleton using a given id (if many are found, this function will pick the first one)
      * @param id defines the id to search for
      * @return the found skeleton or null if not found at all.