Browse Source

Merge branch 'master' into videoDome-180

Raanan Weber 6 years ago
parent
commit
bf7e5d2e9d
100 changed files with 4590 additions and 717 deletions
  1. 303 9
      Playground/babylon.d.txt
  2. 2 0
      Tools/Config/config.json
  3. 16 0
      Tools/WebpackPlugins/babylonExternals.js
  4. 304 18
      dist/preview release/babylon.d.ts
  5. 2 2
      dist/preview release/babylon.js
  6. 926 226
      dist/preview release/babylon.max.js
  7. 1 1
      dist/preview release/babylon.max.js.map
  8. 624 36
      dist/preview release/babylon.module.d.ts
  9. 302 9
      dist/preview release/documentation.d.ts
  10. 1 1
      dist/preview release/glTF2Interface/package.json
  11. 22 1
      dist/preview release/gui/babylon.gui.js
  12. 1 1
      dist/preview release/gui/babylon.gui.js.map
  13. 1 1
      dist/preview release/gui/babylon.gui.min.js
  14. 2 2
      dist/preview release/gui/package.json
  15. 6 6
      dist/preview release/inspector/babylon.inspector.bundle.js
  16. 32 26
      dist/preview release/inspector/babylon.inspector.bundle.max.js
  17. 1 1
      dist/preview release/inspector/babylon.inspector.bundle.max.js.map
  18. 7 6
      dist/preview release/inspector/package.json
  19. 3 3
      dist/preview release/loaders/package.json
  20. 15 4
      dist/preview release/materialsLibrary/babylon.cellMaterial.js
  21. 1 1
      dist/preview release/materialsLibrary/babylon.cellMaterial.js.map
  22. 15 4
      dist/preview release/materialsLibrary/babylon.customMaterial.js
  23. 1 1
      dist/preview release/materialsLibrary/babylon.customMaterial.js.map
  24. 1 1
      dist/preview release/materialsLibrary/babylon.customMaterial.min.js
  25. 15 4
      dist/preview release/materialsLibrary/babylon.fireMaterial.js
  26. 1 1
      dist/preview release/materialsLibrary/babylon.fireMaterial.js.map
  27. 15 4
      dist/preview release/materialsLibrary/babylon.furMaterial.js
  28. 1 1
      dist/preview release/materialsLibrary/babylon.furMaterial.js.map
  29. 15 4
      dist/preview release/materialsLibrary/babylon.gradientMaterial.js
  30. 1 1
      dist/preview release/materialsLibrary/babylon.gradientMaterial.js.map
  31. 15 4
      dist/preview release/materialsLibrary/babylon.gridMaterial.js
  32. 1 1
      dist/preview release/materialsLibrary/babylon.gridMaterial.js.map
  33. 15 4
      dist/preview release/materialsLibrary/babylon.lavaMaterial.js
  34. 1 1
      dist/preview release/materialsLibrary/babylon.lavaMaterial.js.map
  35. 15 4
      dist/preview release/materialsLibrary/babylon.mixMaterial.js
  36. 1 1
      dist/preview release/materialsLibrary/babylon.mixMaterial.js.map
  37. 15 4
      dist/preview release/materialsLibrary/babylon.normalMaterial.js
  38. 1 1
      dist/preview release/materialsLibrary/babylon.normalMaterial.js.map
  39. 15 4
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.js
  40. 1 1
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.js.map
  41. 15 4
      dist/preview release/materialsLibrary/babylon.simpleMaterial.js
  42. 1 1
      dist/preview release/materialsLibrary/babylon.simpleMaterial.js.map
  43. 15 4
      dist/preview release/materialsLibrary/babylon.skyMaterial.js
  44. 1 1
      dist/preview release/materialsLibrary/babylon.skyMaterial.js.map
  45. 15 4
      dist/preview release/materialsLibrary/babylon.terrainMaterial.js
  46. 1 1
      dist/preview release/materialsLibrary/babylon.terrainMaterial.js.map
  47. 15 4
      dist/preview release/materialsLibrary/babylon.triPlanarMaterial.js
  48. 1 1
      dist/preview release/materialsLibrary/babylon.triPlanarMaterial.js.map
  49. 82 13
      dist/preview release/materialsLibrary/babylon.waterMaterial.js
  50. 1 1
      dist/preview release/materialsLibrary/babylon.waterMaterial.js.map
  51. 1 1
      dist/preview release/materialsLibrary/babylon.waterMaterial.min.js
  52. 7 0
      dist/preview release/materialsLibrary/babylonjs.materials.d.ts
  53. 82 13
      dist/preview release/materialsLibrary/babylonjs.materials.js
  54. 1 1
      dist/preview release/materialsLibrary/babylonjs.materials.js.map
  55. 1 1
      dist/preview release/materialsLibrary/babylonjs.materials.min.js
  56. 16 0
      dist/preview release/materialsLibrary/babylonjs.materials.module.d.ts
  57. 2 2
      dist/preview release/materialsLibrary/package.json
  58. 53 4
      dist/preview release/nodeEditor/babylon.nodeEditor.d.ts
  59. 7 7
      dist/preview release/nodeEditor/babylon.nodeEditor.js
  60. 279 35
      dist/preview release/nodeEditor/babylon.nodeEditor.max.js
  61. 1 1
      dist/preview release/nodeEditor/babylon.nodeEditor.max.js.map
  62. 116 8
      dist/preview release/nodeEditor/babylon.nodeEditor.module.d.ts
  63. 2 2
      dist/preview release/nodeEditor/package.json
  64. 1 1
      dist/preview release/package.json
  65. 1 1
      dist/preview release/packagesSizeBaseLine.json
  66. 2 2
      dist/preview release/postProcessesLibrary/package.json
  67. 2 2
      dist/preview release/proceduralTexturesLibrary/package.json
  68. 3 3
      dist/preview release/serializers/package.json
  69. 606 18
      dist/preview release/viewer/babylon.module.d.ts
  70. 54 46
      dist/preview release/viewer/babylon.viewer.js
  71. 1 1
      dist/preview release/viewer/babylon.viewer.max.js
  72. 6 0
      dist/preview release/what's new.md
  73. 26 1
      gui/src/2D/controls/textBlock.ts
  74. 2 10
      inspector/src/components/actionTabs/tabs/propertyGrids/renderGridPropertyGridComponent.tsx
  75. 1 0
      inspector/src/components/actionTabs/tabs/propertyGrids/scenePropertyGridComponent.tsx
  76. 1 1
      inspector/src/components/sceneExplorer/treeItemComponent.tsx
  77. 1 1
      inspector/src/components/sceneExplorer/treeItemSpecializedComponent.tsx
  78. 3 0
      inspector/tsconfig.json
  79. 24 0
      materialsLibrary/src/water/water.fragment.fx
  80. 77 9
      materialsLibrary/src/water/waterMaterial.ts
  81. 21 14
      nodeEditor/src/components/diagram/texture/texturePropertyTabComponent.tsx
  82. 105 0
      nodeEditor/src/components/preview/previewManager.ts
  83. 47 0
      nodeEditor/src/components/preview/previewMeshControlComponent.tsx
  84. 6 0
      nodeEditor/src/components/preview/previewMeshType.ts
  85. 38 4
      nodeEditor/src/components/propertyTab/propertyTabComponent.tsx
  86. 13 1
      nodeEditor/src/globalState.ts
  87. 40 18
      nodeEditor/src/graphEditor.tsx
  88. 34 4
      nodeEditor/src/main.scss
  89. 5 0
      nodeEditor/src/nodeLocationInfo.ts
  90. 0 54
      nodeEditor/src/previewManager.ts
  91. 5 5
      package.json
  92. 2 0
      src/Audio/audioSceneComponent.ts
  93. 2 2
      src/Cameras/Inputs/BaseCameraPointersInput.ts
  94. 4 1
      src/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.ts
  95. 6 2
      src/Cameras/Inputs/freeCameraDeviceOrientationInput.ts
  96. 5 2
      src/Cameras/VR/vrExperienceHelper.ts
  97. 3 1
      src/Cameras/VR/webVRCamera.ts
  98. 10 3
      src/Cameras/deviceOrientationCamera.ts
  99. 1 1
      src/Engines/Extensions/engine.multiRender.ts
  100. 0 0
      src/Engines/Extensions/engine.webVR.ts

+ 303 - 9
Playground/babylon.d.txt

@@ -11939,6 +11939,10 @@ declare module BABYLON {
          */
         static POSE_ENABLED: number;
         /**
+         * Represents an Dual Shock controller
+         */
+        static DUALSHOCK: number;
+        /**
          * Specifies whether the left control stick should be Y-inverted
          */
         protected _invertLeftStickY: boolean;
@@ -13505,6 +13509,10 @@ declare module BABYLON {
          * Object will rotate to face the camera
          */
         static BILLBOARDMODE_ALL: number;
+        /**
+         * Object will rotate to face the camera's position instead of orientation
+         */
+        static BILLBOARDMODE_USE_POSITION: number;
         private _forward;
         private _forwardInverted;
         private _up;
@@ -18414,7 +18422,7 @@ declare module BABYLON {
          *
          * Returns the clone.
          */
-        clone(name: string, newParent: Node, doNotCloneChildren?: boolean): InstancedMesh;
+        clone(name: string, newParent?: Node, doNotCloneChildren?: boolean): InstancedMesh;
         /**
          * Disposes the InstancedMesh.
          * Returns nothing.
@@ -25159,6 +25167,8 @@ declare module BABYLON {
         static readonly BILLBOARDMODE_Z: number;
         /** Billboard on all axes */
         static readonly BILLBOARDMODE_ALL: number;
+        /** Billboard on using position instead of orientation */
+        static readonly BILLBOARDMODE_USE_POSITION: number;
         /** @hidden */
private _internalAbstractMeshDataInfo: _InternalAbstractMeshDataInfo;
         /**
          * The culling strategy to use to check whether the mesh must be rendered or not.
@@ -29065,6 +29075,8 @@ declare module BABYLON {
         parallelShaderCompile: {
             COMPLETION_STATUS_KHR: number;
         };
+        /** Max number of texture samples for MSAA */
+        maxMSAASamples: number;
     }
     /** Interface defining initialization parameters for Engine class */
     export interface EngineOptions extends WebGLContextAttributes {
@@ -29744,6 +29756,16 @@ declare module BABYLON {
          */
         getRenderingCanvas(): Nullable<HTMLCanvasElement>;
         /**
+         * Gets host window
+         * @returns the host window object
+         */
+        getHostWindow(): Window;
+        /**
+         * Gets host document
+         * @returns the host document object
+         */
+        getHostDocument(): Document;
+        /**
          * Gets the client rect of the HTML canvas attached with the current webGL context
          * @returns a client rectanglee
          */
@@ -31238,17 +31260,19 @@ declare module BABYLON {
         static IsEmpty(obj: any): boolean;
         /**
          * Function used to register events at window level
+         * @param windowElement defines the Window object to use
          * @param events defines the events to register
          */
-        static RegisterTopRootEvents(events: {
+        static RegisterTopRootEvents(windowElement: Window, events: {
             name: string;
             handler: Nullable<(e: FocusEvent) => any>;
         }[]): void;
         /**
          * Function used to unregister events from window level
+         * @param windowElement defines the Window object to use
          * @param events defines the events to unregister
          */
-        static UnregisterTopRootEvents(events: {
+        static UnregisterTopRootEvents(windowElement: Window, events: {
             name: string;
             handler: Nullable<(e: FocusEvent) => any>;
         }[]): void;
@@ -32049,6 +32073,21 @@ declare module BABYLON {
         */
         environmentTexture: Nullable<BaseTexture>;
         /** @hidden */
+        protected _environmentIntensity: number;
+        /**
+         * Intensity of the environment in all pbr material.
+         * This dims or reinforces the IBL lighting overall (reflection and diffuse).
+         * As in the majority of the scene they are the same (exception for multi room and so on),
+         * this is easier to reference from here than from all the materials.
+         */
+        /**
+        * Intensity of the environment in all pbr material.
+        * This dims or reinforces the IBL lighting overall (reflection and diffuse).
+        * As in the majority of the scene they are the same (exception for multi room and so on),
+        * this is easier to set here than in all the materials.
+        */
+        environmentIntensity: number;
+        /** @hidden */
         protected _imageProcessingConfiguration: ImageProcessingConfiguration;
         /**
          * Default image processing configuration used either in the rendering
@@ -37499,6 +37538,7 @@ declare module BABYLON {
         private _initialQuaternion;
         private _quaternionCache;
         private _tmpDragQuaternion;
+        private _disablePointerInputWhenUsingDeviceOrientation;
         /**
          * Creates a new device orientation camera
          * @param name The name of the camera
@@ -37507,9 +37547,9 @@ declare module BABYLON {
          */
         constructor(name: string, position: Vector3, scene: Scene);
         /**
-         * @hidden
-         * Disabled pointer input on first orientation sensor update (Default: true)
-         */
private _disablePointerInputWhenUsingDeviceOrientation: boolean;
+         * Gets or sets a boolean indicating that pointer input must be disabled on first orientation sensor update (Default: true)
+         */
+        disablePointerInputWhenUsingDeviceOrientation: boolean;
         private _dragFactor;
         /**
          * Enabled turning on the y axis when the orientation sensor is active
@@ -37769,6 +37809,238 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /**
+     * Defines supported buttons for DualShock compatible gamepads
+     */
+    export enum DualShockButton {
+        /** Cross */
+        Cross = 0,
+        /** Circle */
+        Circle = 1,
+        /** Square */
+        Square = 2,
+        /** Triangle */
+        Triangle = 3,
+        /** Options */
+        Options = 4,
+        /** Share */
+        Share = 5,
+        /** L1 */
+        L1 = 6,
+        /** R1 */
+        R1 = 7,
+        /** Left stick */
+        LeftStick = 8,
+        /** Right stick */
+        RightStick = 9
+    }
+    /** Defines values for DualShock DPad  */
+    export enum DualShockDpad {
+        /** Up */
+        Up = 0,
+        /** Down */
+        Down = 1,
+        /** Left */
+        Left = 2,
+        /** Right */
+        Right = 3
+    }
+    /**
+     * Defines a DualShock gamepad
+     */
+    export class DualShockPad extends Gamepad {
+        private _leftTrigger;
+        private _rightTrigger;
+        private _onlefttriggerchanged;
+        private _onrighttriggerchanged;
+        private _onbuttondown;
+        private _onbuttonup;
+        private _ondpaddown;
+        private _ondpadup;
+        /** Observable raised when a button is pressed */
+        onButtonDownObservable: Observable<DualShockButton>;
+        /** Observable raised when a button is released */
+        onButtonUpObservable: Observable<DualShockButton>;
+        /** Observable raised when a pad is pressed */
+        onPadDownObservable: Observable<DualShockDpad>;
+        /** Observable raised when a pad is released */
+        onPadUpObservable: Observable<DualShockDpad>;
+        private _buttonCross;
+        private _buttonCircle;
+        private _buttonSquare;
+        private _buttonTriangle;
+        private _buttonShare;
+        private _buttonOptions;
+        private _buttonL1;
+        private _buttonR1;
+        private _buttonLeftStick;
+        private _buttonRightStick;
+        private _dPadUp;
+        private _dPadDown;
+        private _dPadLeft;
+        private _dPadRight;
+        /**
+         * Creates a new DualShock gamepad object
+         * @param id defines the id of this gamepad
+         * @param index defines its index
+         * @param gamepad defines the internal HTML gamepad object
+         */
+        constructor(id: string, index: number, gamepad: any);
+        /**
+         * Defines the callback to call when left trigger is pressed
+         * @param callback defines the callback to use
+         */
+        onlefttriggerchanged(callback: (value: number) => void): void;
+        /**
+         * Defines the callback to call when right trigger is pressed
+         * @param callback defines the callback to use
+         */
+        onrighttriggerchanged(callback: (value: number) => void): void;
+        /**
+         * Gets the left trigger value
+         */
+        /**
+        * Sets the left trigger value
+        */
+        leftTrigger: number;
+        /**
+         * Gets the right trigger value
+         */
+        /**
+        * Sets the right trigger value
+        */
+        rightTrigger: number;
+        /**
+         * Defines the callback to call when a button is pressed
+         * @param callback defines the callback to use
+         */
+        onbuttondown(callback: (buttonPressed: DualShockButton) => void): void;
+        /**
+         * Defines the callback to call when a button is released
+         * @param callback defines the callback to use
+         */
+        onbuttonup(callback: (buttonReleased: DualShockButton) => void): void;
+        /**
+         * Defines the callback to call when a pad is pressed
+         * @param callback defines the callback to use
+         */
+        ondpaddown(callback: (dPadPressed: DualShockDpad) => void): void;
+        /**
+         * Defines the callback to call when a pad is released
+         * @param callback defines the callback to use
+         */
+        ondpadup(callback: (dPadReleased: DualShockDpad) => void): void;
+        private _setButtonValue;
+        private _setDPadValue;
+        /**
+         * Gets the value of the `Cross` button
+         */
+        /**
+        * Sets the value of the `Cross` button
+        */
+        buttonCross: number;
+        /**
+         * Gets the value of the `Circle` button
+         */
+        /**
+        * Sets the value of the `Circle` button
+        */
+        buttonCircle: number;
+        /**
+         * Gets the value of the `Square` button
+         */
+        /**
+        * Sets the value of the `Square` button
+        */
+        buttonSquare: number;
+        /**
+         * Gets the value of the `Triangle` button
+         */
+        /**
+        * Sets the value of the `Triangle` button
+        */
+        buttonTriangle: number;
+        /**
+         * Gets the value of the `Options` button
+         */
+        /**
+        * Sets the value of the `Options` button
+        */
+        buttonOptions: number;
+        /**
+         * Gets the value of the `Share` button
+         */
+        /**
+        * Sets the value of the `Share` button
+        */
+        buttonShare: number;
+        /**
+         * Gets the value of the `L1` button
+         */
+        /**
+        * Sets the value of the `L1` button
+        */
+        buttonL1: number;
+        /**
+         * Gets the value of the `R1` button
+         */
+        /**
+        * Sets the value of the `R1` button
+        */
+        buttonR1: number;
+        /**
+         * Gets the value of the Left joystick
+         */
+        /**
+        * Sets the value of the Left joystick
+        */
+        buttonLeftStick: number;
+        /**
+         * Gets the value of the Right joystick
+         */
+        /**
+        * Sets the value of the Right joystick
+        */
+        buttonRightStick: number;
+        /**
+         * Gets the value of D-pad up
+         */
+        /**
+        * Sets the value of D-pad up
+        */
+        dPadUp: number;
+        /**
+         * Gets the value of D-pad down
+         */
+        /**
+        * Sets the value of D-pad down
+        */
+        dPadDown: number;
+        /**
+         * Gets the value of D-pad left
+         */
+        /**
+        * Sets the value of D-pad left
+        */
+        dPadLeft: number;
+        /**
+         * Gets the value of D-pad right
+         */
+        /**
+        * Sets the value of D-pad right
+        */
+        dPadRight: number;
+        /**
+         * Force the gamepad to synchronize with device values
+         */
+        update(): void;
+        /**
+         * Disposes the gamepad
+         */
+        dispose(): void;
+    }
+}
+declare module BABYLON {
+    /**
      * Manager for handling gamepads
      */
     export class GamepadManager {
@@ -43115,8 +43387,9 @@ declare module BABYLON {
          * @param planeNormal The normal of the plane which the gizmo will be able to rotate on
          * @param color The color of the gizmo
          * @param tessellation Amount of tessellation to be used when creating rotation circles
+         * @param useEulerRotation Use and update Euler angle instead of quaternion
          */
-        constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number, parent?: Nullable<RotationGizmo>);
+        constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number, parent?: Nullable<RotationGizmo>, useEulerRotation?: boolean);
         protected _attachedMeshChanged(value: Nullable<AbstractMesh>): void;
         /**
              * If the gizmo is enabled
@@ -43155,8 +43428,9 @@ declare module BABYLON {
          * Creates a RotationGizmo
          * @param gizmoLayer The utility layer the gizmo will be added to
          * @param tessellation Amount of tessellation to be used when creating rotation circles
+         * @param useEulerRotation Use and update Euler angle instead of quaternion
          */
-        constructor(gizmoLayer?: UtilityLayerRenderer, tessellation?: number);
+        constructor(gizmoLayer?: UtilityLayerRenderer, tessellation?: number, useEulerRotation?: boolean);
         updateGizmoRotationToMatchAttachedMesh: boolean;
         /**
          * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
@@ -50605,6 +50879,7 @@ declare module BABYLON {
      * Class used to create a node based material built by assembling shader blocks
      */
     export class NodeMaterial extends PushMaterial {
+        private static _BuildIdGenerator;
         private _options;
         private _vertexCompilationState;
         private _fragmentCompilationState;
@@ -52279,7 +52554,7 @@ declare module BABYLON {
         /**
          * Vertex shader for the effect
          */
-        vertexShader: string;
+        vertexShader?: string;
         /**
          * Attributes to use in the shader
          */
@@ -57690,6 +57965,13 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /** @hidden */
+    export var volumetricLightScatteringPassVertexShader: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
     export var volumetricLightScatteringPassPixelShader: {
         name: string;
         shader: string;
@@ -59676,6 +59958,11 @@ declare module BABYLON {
          * to the src parameter of an <img> to display it
          */
         static CreateScreenshotUsingRenderTargetAsync(engine: Engine, camera: Camera, size: any, mimeType?: string, samples?: number, antialiasing?: boolean, fileName?: string): Promise<string>;
+        /**
+         * Gets height and width for screenshot size
+         * @private
+         */
+        private static _getScreenshotSize;
     }
 }
 declare module BABYLON {
@@ -68750,6 +69037,11 @@ declare module BABYLON {
         * @param {number}: Defines the waves speed
         */
         waveSpeed: number;
+        /**
+         * Sets or gets wether or not automatic clipping should be enabled or not. Setting to true will save performances and
+         * will avoid calculating useless pixels in the pixel shader of the water material.
+         */
+        disableClipPlane: boolean;
         protected _renderTargets: BABYLON.SmartArray<BABYLON.RenderTargetTexture>;
         private _mesh;
         private _refractionRTT;
@@ -68760,6 +69052,8 @@ declare module BABYLON {
         private _renderId;
         private _useLogarithmicDepth;
         private _waitingRenderList;
+        private _imageProcessingConfiguration;
+        private _imageProcessingObserver;
         /**
          * Gets a boolean indicating that current material needs to register RTT
          */

+ 2 - 0
Tools/Config/config.json

@@ -552,11 +552,13 @@
                         "babylonjs": "BABYLON",
                         "babylonjs-loaders": "BABYLON",
                         "babylonjs-serializers": "BABYLON",
+                        "babylonjs-materials": "BABYLON",
                         "babylonjs-gltf2interface": "BABYLON.GLTF2",
                         "react": "React",
                         "babylonjs-gui": "BABYLON.GUI",
                         "@babylonjs/core": "BABYLON",
                         "@babylonjs/loaders": "BABYLON",
+                        "@babylonjs/materials": "BABYLON",
                         "@babylonjs/serializers": "BABYLON",
                         "@babylonjs/gui": "BABYLON.GUI",
                         "@fortawesome": false,

+ 16 - 0
Tools/WebpackPlugins/babylonExternals.js

@@ -27,6 +27,14 @@ module.exports = function nodeExternals(options) {
                 amd: "babylonjs-gui"
             });
         }
+        else if (/^babylonjs-materials.*$/i.test(request)) {
+            callback(null, {
+                root: "BABYLON",
+                commonjs: "babylonjs-materials",
+                commonjs2: "babylonjs-materials",
+                amd: "babylonjs-materials"
+            });
+        }
         else if (/^babylonjs.*$/i.test(request)) {
             callback(null, {
                 root: "BABYLON",
@@ -59,6 +67,14 @@ module.exports = function nodeExternals(options) {
                 amd: "@babylonjs/gui"
             });
         }
+        else if (/^@babylonjs\/materials.*$/i.test(request)) {
+            callback(null, {
+                root: ["BABYLON", "MATERIALS"],
+                commonjs: "@babylonjs/materials",
+                commonjs2: "@babylonjs/materials",
+                amd: "@babylonjs/materials"
+            });
+        }
         else if (/^@babylonjs\/core.*$/i.test(request)) {
             callback(null, {
                 root: "BABYLON",

+ 304 - 18
dist/preview release/babylon.d.ts

@@ -12066,6 +12066,10 @@ declare module BABYLON {
          */
         static POSE_ENABLED: number;
         /**
+         * Represents an Dual Shock controller
+         */
+        static DUALSHOCK: number;
+        /**
          * Specifies whether the left control stick should be Y-inverted
          */
         protected _invertLeftStickY: boolean;
@@ -13651,6 +13655,10 @@ declare module BABYLON {
          * Object will rotate to face the camera
          */
         static BILLBOARDMODE_ALL: number;
+        /**
+         * Object will rotate to face the camera's position instead of orientation
+         */
+        static BILLBOARDMODE_USE_POSITION: number;
         private _forward;
         private _forwardInverted;
         private _up;
@@ -18673,7 +18681,7 @@ declare module BABYLON {
          *
          * Returns the clone.
          */
-        clone(name: string, newParent: Node, doNotCloneChildren?: boolean): InstancedMesh;
+        clone(name: string, newParent?: Node, doNotCloneChildren?: boolean): InstancedMesh;
         /**
          * Disposes the InstancedMesh.
          * Returns nothing.
@@ -25578,6 +25586,8 @@ declare module BABYLON {
         static readonly BILLBOARDMODE_Z: number;
         /** Billboard on all axes */
         static readonly BILLBOARDMODE_ALL: number;
+        /** Billboard on using position instead of orientation */
+        static readonly BILLBOARDMODE_USE_POSITION: number;
         /** @hidden */
         _internalAbstractMeshDataInfo: _InternalAbstractMeshDataInfo;
         /**
@@ -29619,6 +29629,8 @@ declare module BABYLON {
         parallelShaderCompile: {
             COMPLETION_STATUS_KHR: number;
         };
+        /** Max number of texture samples for MSAA */
+        maxMSAASamples: number;
     }
     /** Interface defining initialization parameters for Engine class */
     export interface EngineOptions extends WebGLContextAttributes {
@@ -30321,6 +30333,16 @@ declare module BABYLON {
          */
         getRenderingCanvas(): Nullable<HTMLCanvasElement>;
         /**
+         * Gets host window
+         * @returns the host window object
+         */
+        getHostWindow(): Window;
+        /**
+         * Gets host document
+         * @returns the host document object
+         */
+        getHostDocument(): Document;
+        /**
          * Gets the client rect of the HTML canvas attached with the current webGL context
          * @returns a client rectanglee
          */
@@ -31854,17 +31876,19 @@ declare module BABYLON {
         static IsEmpty(obj: any): boolean;
         /**
          * Function used to register events at window level
+         * @param windowElement defines the Window object to use
          * @param events defines the events to register
          */
-        static RegisterTopRootEvents(events: {
+        static RegisterTopRootEvents(windowElement: Window, events: {
             name: string;
             handler: Nullable<(e: FocusEvent) => any>;
         }[]): void;
         /**
          * Function used to unregister events from window level
+         * @param windowElement defines the Window object to use
          * @param events defines the events to unregister
          */
-        static UnregisterTopRootEvents(events: {
+        static UnregisterTopRootEvents(windowElement: Window, events: {
             name: string;
             handler: Nullable<(e: FocusEvent) => any>;
         }[]): void;
@@ -32669,6 +32693,21 @@ declare module BABYLON {
         */
         environmentTexture: Nullable<BaseTexture>;
         /** @hidden */
+        protected _environmentIntensity: number;
+        /**
+         * Intensity of the environment in all pbr material.
+         * This dims or reinforces the IBL lighting overall (reflection and diffuse).
+         * As in the majority of the scene they are the same (exception for multi room and so on),
+         * this is easier to reference from here than from all the materials.
+         */
+        /**
+        * Intensity of the environment in all pbr material.
+        * This dims or reinforces the IBL lighting overall (reflection and diffuse).
+        * As in the majority of the scene they are the same (exception for multi room and so on),
+        * this is easier to set here than in all the materials.
+        */
+        environmentIntensity: number;
+        /** @hidden */
         protected _imageProcessingConfiguration: ImageProcessingConfiguration;
         /**
          * Default image processing configuration used either in the rendering
@@ -37908,7 +37947,7 @@ declare module BABYLON {
          * @param timeout amount of time in milliseconds to wait for a response from the sensor (default: infinite)
          * @returns a promise that will resolve on orientation change
          */
-        static WaitForOrientationChangeAsync(timeout?: number): Promise<{}>;
+        static WaitForOrientationChangeAsync(timeout?: number): Promise<unknown>;
         /**
          * @hidden
          */
@@ -38210,6 +38249,7 @@ declare module BABYLON {
         private _initialQuaternion;
         private _quaternionCache;
         private _tmpDragQuaternion;
+        private _disablePointerInputWhenUsingDeviceOrientation;
         /**
          * Creates a new device orientation camera
          * @param name The name of the camera
@@ -38218,10 +38258,9 @@ declare module BABYLON {
          */
         constructor(name: string, position: Vector3, scene: Scene);
         /**
-         * @hidden
-         * Disabled pointer input on first orientation sensor update (Default: true)
+         * Gets or sets a boolean indicating that pointer input must be disabled on first orientation sensor update (Default: true)
          */
-        _disablePointerInputWhenUsingDeviceOrientation: boolean;
+        disablePointerInputWhenUsingDeviceOrientation: boolean;
         private _dragFactor;
         /**
          * Enabled turning on the y axis when the orientation sensor is active
@@ -38482,6 +38521,238 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /**
+     * Defines supported buttons for DualShock compatible gamepads
+     */
+    export enum DualShockButton {
+        /** Cross */
+        Cross = 0,
+        /** Circle */
+        Circle = 1,
+        /** Square */
+        Square = 2,
+        /** Triangle */
+        Triangle = 3,
+        /** Options */
+        Options = 4,
+        /** Share */
+        Share = 5,
+        /** L1 */
+        L1 = 6,
+        /** R1 */
+        R1 = 7,
+        /** Left stick */
+        LeftStick = 8,
+        /** Right stick */
+        RightStick = 9
+    }
+    /** Defines values for DualShock DPad  */
+    export enum DualShockDpad {
+        /** Up */
+        Up = 0,
+        /** Down */
+        Down = 1,
+        /** Left */
+        Left = 2,
+        /** Right */
+        Right = 3
+    }
+    /**
+     * Defines a DualShock gamepad
+     */
+    export class DualShockPad extends Gamepad {
+        private _leftTrigger;
+        private _rightTrigger;
+        private _onlefttriggerchanged;
+        private _onrighttriggerchanged;
+        private _onbuttondown;
+        private _onbuttonup;
+        private _ondpaddown;
+        private _ondpadup;
+        /** Observable raised when a button is pressed */
+        onButtonDownObservable: Observable<DualShockButton>;
+        /** Observable raised when a button is released */
+        onButtonUpObservable: Observable<DualShockButton>;
+        /** Observable raised when a pad is pressed */
+        onPadDownObservable: Observable<DualShockDpad>;
+        /** Observable raised when a pad is released */
+        onPadUpObservable: Observable<DualShockDpad>;
+        private _buttonCross;
+        private _buttonCircle;
+        private _buttonSquare;
+        private _buttonTriangle;
+        private _buttonShare;
+        private _buttonOptions;
+        private _buttonL1;
+        private _buttonR1;
+        private _buttonLeftStick;
+        private _buttonRightStick;
+        private _dPadUp;
+        private _dPadDown;
+        private _dPadLeft;
+        private _dPadRight;
+        /**
+         * Creates a new DualShock gamepad object
+         * @param id defines the id of this gamepad
+         * @param index defines its index
+         * @param gamepad defines the internal HTML gamepad object
+         */
+        constructor(id: string, index: number, gamepad: any);
+        /**
+         * Defines the callback to call when left trigger is pressed
+         * @param callback defines the callback to use
+         */
+        onlefttriggerchanged(callback: (value: number) => void): void;
+        /**
+         * Defines the callback to call when right trigger is pressed
+         * @param callback defines the callback to use
+         */
+        onrighttriggerchanged(callback: (value: number) => void): void;
+        /**
+         * Gets the left trigger value
+         */
+        /**
+        * Sets the left trigger value
+        */
+        leftTrigger: number;
+        /**
+         * Gets the right trigger value
+         */
+        /**
+        * Sets the right trigger value
+        */
+        rightTrigger: number;
+        /**
+         * Defines the callback to call when a button is pressed
+         * @param callback defines the callback to use
+         */
+        onbuttondown(callback: (buttonPressed: DualShockButton) => void): void;
+        /**
+         * Defines the callback to call when a button is released
+         * @param callback defines the callback to use
+         */
+        onbuttonup(callback: (buttonReleased: DualShockButton) => void): void;
+        /**
+         * Defines the callback to call when a pad is pressed
+         * @param callback defines the callback to use
+         */
+        ondpaddown(callback: (dPadPressed: DualShockDpad) => void): void;
+        /**
+         * Defines the callback to call when a pad is released
+         * @param callback defines the callback to use
+         */
+        ondpadup(callback: (dPadReleased: DualShockDpad) => void): void;
+        private _setButtonValue;
+        private _setDPadValue;
+        /**
+         * Gets the value of the `Cross` button
+         */
+        /**
+        * Sets the value of the `Cross` button
+        */
+        buttonCross: number;
+        /**
+         * Gets the value of the `Circle` button
+         */
+        /**
+        * Sets the value of the `Circle` button
+        */
+        buttonCircle: number;
+        /**
+         * Gets the value of the `Square` button
+         */
+        /**
+        * Sets the value of the `Square` button
+        */
+        buttonSquare: number;
+        /**
+         * Gets the value of the `Triangle` button
+         */
+        /**
+        * Sets the value of the `Triangle` button
+        */
+        buttonTriangle: number;
+        /**
+         * Gets the value of the `Options` button
+         */
+        /**
+        * Sets the value of the `Options` button
+        */
+        buttonOptions: number;
+        /**
+         * Gets the value of the `Share` button
+         */
+        /**
+        * Sets the value of the `Share` button
+        */
+        buttonShare: number;
+        /**
+         * Gets the value of the `L1` button
+         */
+        /**
+        * Sets the value of the `L1` button
+        */
+        buttonL1: number;
+        /**
+         * Gets the value of the `R1` button
+         */
+        /**
+        * Sets the value of the `R1` button
+        */
+        buttonR1: number;
+        /**
+         * Gets the value of the Left joystick
+         */
+        /**
+        * Sets the value of the Left joystick
+        */
+        buttonLeftStick: number;
+        /**
+         * Gets the value of the Right joystick
+         */
+        /**
+        * Sets the value of the Right joystick
+        */
+        buttonRightStick: number;
+        /**
+         * Gets the value of D-pad up
+         */
+        /**
+        * Sets the value of D-pad up
+        */
+        dPadUp: number;
+        /**
+         * Gets the value of D-pad down
+         */
+        /**
+        * Sets the value of D-pad down
+        */
+        dPadDown: number;
+        /**
+         * Gets the value of D-pad left
+         */
+        /**
+        * Sets the value of D-pad left
+        */
+        dPadLeft: number;
+        /**
+         * Gets the value of D-pad right
+         */
+        /**
+        * Sets the value of D-pad right
+        */
+        dPadRight: number;
+        /**
+         * Force the gamepad to synchronize with device values
+         */
+        update(): void;
+        /**
+         * Disposes the gamepad
+         */
+        dispose(): void;
+    }
+}
+declare module BABYLON {
+    /**
      * Manager for handling gamepads
      */
     export class GamepadManager {
@@ -40856,7 +41127,7 @@ declare module BABYLON {
          * Stops the xrSession and restores the renderloop
          * @returns Promise which resolves after it exits XR
          */
-        exitXRAsync(): Promise<{}>;
+        exitXRAsync(): Promise<unknown>;
         /**
          * Checks if a session would be supported for the creation options specified
          * @param sessionMode session mode to check if supported eg. immersive-vr
@@ -41002,7 +41273,7 @@ declare module BABYLON {
          * Exits XR mode and returns the scene to its original state
          * @returns promise that resolves after xr mode has exited
          */
-        exitXRAsync(): Promise<{}>;
+        exitXRAsync(): Promise<unknown>;
         /**
          * Enters XR mode (This must be done within a user interaction in most browsers eg. button click)
          * @param sessionCreationOptions options for the XR session
@@ -42362,9 +42633,9 @@ declare module BABYLON {
         private _snapDistance;
         private _scaleRatio;
         /** Fires an event when any of it's sub gizmos are dragged */
-        onDragStartObservable: Observable<{}>;
+        onDragStartObservable: Observable<unknown>;
         /** Fires an event when any of it's sub gizmos are released from dragging */
-        onDragEndObservable: Observable<{}>;
+        onDragEndObservable: Observable<unknown>;
         /**
          * If set to true, planar drag is enabled
          */
@@ -43636,9 +43907,9 @@ declare module BABYLON {
         private _uniformScalingMesh;
         private _octahedron;
         /** Fires an event when any of it's sub gizmos are dragged */
-        onDragStartObservable: Observable<{}>;
+        onDragStartObservable: Observable<unknown>;
         /** Fires an event when any of it's sub gizmos are released from dragging */
-        onDragEndObservable: Observable<{}>;
+        onDragEndObservable: Observable<unknown>;
         attachedMesh: Nullable<AbstractMesh>;
         /**
          * Creates a ScaleGizmo
@@ -43866,8 +44137,9 @@ declare module BABYLON {
          * @param planeNormal The normal of the plane which the gizmo will be able to rotate on
          * @param color The color of the gizmo
          * @param tessellation Amount of tessellation to be used when creating rotation circles
+         * @param useEulerRotation Use and update Euler angle instead of quaternion
          */
-        constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number, parent?: Nullable<RotationGizmo>);
+        constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number, parent?: Nullable<RotationGizmo>, useEulerRotation?: boolean);
         protected _attachedMeshChanged(value: Nullable<AbstractMesh>): void;
         /**
              * If the gizmo is enabled
@@ -43897,17 +44169,18 @@ declare module BABYLON {
          */
         zGizmo: PlaneRotationGizmo;
         /** Fires an event when any of it's sub gizmos are dragged */
-        onDragStartObservable: Observable<{}>;
+        onDragStartObservable: Observable<unknown>;
         /** Fires an event when any of it's sub gizmos are released from dragging */
-        onDragEndObservable: Observable<{}>;
+        onDragEndObservable: Observable<unknown>;
         private _meshAttached;
         attachedMesh: Nullable<AbstractMesh>;
         /**
          * Creates a RotationGizmo
          * @param gizmoLayer The utility layer the gizmo will be added to
          * @param tessellation Amount of tessellation to be used when creating rotation circles
+         * @param useEulerRotation Use and update Euler angle instead of quaternion
          */
-        constructor(gizmoLayer?: UtilityLayerRenderer, tessellation?: number);
+        constructor(gizmoLayer?: UtilityLayerRenderer, tessellation?: number, useEulerRotation?: boolean);
         updateGizmoRotationToMatchAttachedMesh: boolean;
         /**
          * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
@@ -51385,6 +51658,7 @@ declare module BABYLON {
      * Class used to create a node based material built by assembling shader blocks
      */
     export class NodeMaterial extends PushMaterial {
+        private static _BuildIdGenerator;
         private _options;
         private _vertexCompilationState;
         private _fragmentCompilationState;
@@ -53090,7 +53364,7 @@ declare module BABYLON {
         /**
          * Vertex shader for the effect
          */
-        vertexShader: string;
+        vertexShader?: string;
         /**
          * Attributes to use in the shader
          */
@@ -58547,6 +58821,13 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /** @hidden */
+    export var volumetricLightScatteringPassVertexShader: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
     export var volumetricLightScatteringPassPixelShader: {
         name: string;
         shader: string;
@@ -60542,6 +60823,11 @@ declare module BABYLON {
          * to the src parameter of an <img> to display it
          */
         static CreateScreenshotUsingRenderTargetAsync(engine: Engine, camera: Camera, size: any, mimeType?: string, samples?: number, antialiasing?: boolean, fileName?: string): Promise<string>;
+        /**
+         * Gets height and width for screenshot size
+         * @private
+         */
+        private static _getScreenshotSize;
     }
 }
 declare module BABYLON {

File diff suppressed because it is too large
+ 2 - 2
dist/preview release/babylon.js


File diff suppressed because it is too large
+ 926 - 226
dist/preview release/babylon.max.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/babylon.max.js.map


File diff suppressed because it is too large
+ 624 - 36
dist/preview release/babylon.module.d.ts


+ 302 - 9
dist/preview release/documentation.d.ts

@@ -12066,6 +12066,10 @@ declare module BABYLON {
          */
         static POSE_ENABLED: number;
         /**
+         * Represents an Dual Shock controller
+         */
+        static DUALSHOCK: number;
+        /**
          * Specifies whether the left control stick should be Y-inverted
          */
         protected _invertLeftStickY: boolean;
@@ -13651,6 +13655,10 @@ declare module BABYLON {
          * Object will rotate to face the camera
          */
         static BILLBOARDMODE_ALL: number;
+        /**
+         * Object will rotate to face the camera's position instead of orientation
+         */
+        static BILLBOARDMODE_USE_POSITION: number;
         private _forward;
         private _forwardInverted;
         private _up;
@@ -18673,7 +18681,7 @@ declare module BABYLON {
          *
          * Returns the clone.
          */
-        clone(name: string, newParent: Node, doNotCloneChildren?: boolean): InstancedMesh;
+        clone(name: string, newParent?: Node, doNotCloneChildren?: boolean): InstancedMesh;
         /**
          * Disposes the InstancedMesh.
          * Returns nothing.
@@ -25578,6 +25586,8 @@ declare module BABYLON {
         static readonly BILLBOARDMODE_Z: number;
         /** Billboard on all axes */
         static readonly BILLBOARDMODE_ALL: number;
+        /** Billboard on using position instead of orientation */
+        static readonly BILLBOARDMODE_USE_POSITION: number;
         /** @hidden */
         _internalAbstractMeshDataInfo: _InternalAbstractMeshDataInfo;
         /**
@@ -29619,6 +29629,8 @@ declare module BABYLON {
         parallelShaderCompile: {
             COMPLETION_STATUS_KHR: number;
         };
+        /** Max number of texture samples for MSAA */
+        maxMSAASamples: number;
     }
     /** Interface defining initialization parameters for Engine class */
     export interface EngineOptions extends WebGLContextAttributes {
@@ -30321,6 +30333,16 @@ declare module BABYLON {
          */
         getRenderingCanvas(): Nullable<HTMLCanvasElement>;
         /**
+         * Gets host window
+         * @returns the host window object
+         */
+        getHostWindow(): Window;
+        /**
+         * Gets host document
+         * @returns the host document object
+         */
+        getHostDocument(): Document;
+        /**
          * Gets the client rect of the HTML canvas attached with the current webGL context
          * @returns a client rectanglee
          */
@@ -31854,17 +31876,19 @@ declare module BABYLON {
         static IsEmpty(obj: any): boolean;
         /**
          * Function used to register events at window level
+         * @param windowElement defines the Window object to use
          * @param events defines the events to register
          */
-        static RegisterTopRootEvents(events: {
+        static RegisterTopRootEvents(windowElement: Window, events: {
             name: string;
             handler: Nullable<(e: FocusEvent) => any>;
         }[]): void;
         /**
          * Function used to unregister events from window level
+         * @param windowElement defines the Window object to use
          * @param events defines the events to unregister
          */
-        static UnregisterTopRootEvents(events: {
+        static UnregisterTopRootEvents(windowElement: Window, events: {
             name: string;
             handler: Nullable<(e: FocusEvent) => any>;
         }[]): void;
@@ -32669,6 +32693,21 @@ declare module BABYLON {
         */
         environmentTexture: Nullable<BaseTexture>;
         /** @hidden */
+        protected _environmentIntensity: number;
+        /**
+         * Intensity of the environment in all pbr material.
+         * This dims or reinforces the IBL lighting overall (reflection and diffuse).
+         * As in the majority of the scene they are the same (exception for multi room and so on),
+         * this is easier to reference from here than from all the materials.
+         */
+        /**
+        * Intensity of the environment in all pbr material.
+        * This dims or reinforces the IBL lighting overall (reflection and diffuse).
+        * As in the majority of the scene they are the same (exception for multi room and so on),
+        * this is easier to set here than in all the materials.
+        */
+        environmentIntensity: number;
+        /** @hidden */
         protected _imageProcessingConfiguration: ImageProcessingConfiguration;
         /**
          * Default image processing configuration used either in the rendering
@@ -38210,6 +38249,7 @@ declare module BABYLON {
         private _initialQuaternion;
         private _quaternionCache;
         private _tmpDragQuaternion;
+        private _disablePointerInputWhenUsingDeviceOrientation;
         /**
          * Creates a new device orientation camera
          * @param name The name of the camera
@@ -38218,10 +38258,9 @@ declare module BABYLON {
          */
         constructor(name: string, position: Vector3, scene: Scene);
         /**
-         * @hidden
-         * Disabled pointer input on first orientation sensor update (Default: true)
+         * Gets or sets a boolean indicating that pointer input must be disabled on first orientation sensor update (Default: true)
          */
-        _disablePointerInputWhenUsingDeviceOrientation: boolean;
+        disablePointerInputWhenUsingDeviceOrientation: boolean;
         private _dragFactor;
         /**
          * Enabled turning on the y axis when the orientation sensor is active
@@ -38482,6 +38521,238 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /**
+     * Defines supported buttons for DualShock compatible gamepads
+     */
+    export enum DualShockButton {
+        /** Cross */
+        Cross = 0,
+        /** Circle */
+        Circle = 1,
+        /** Square */
+        Square = 2,
+        /** Triangle */
+        Triangle = 3,
+        /** Options */
+        Options = 4,
+        /** Share */
+        Share = 5,
+        /** L1 */
+        L1 = 6,
+        /** R1 */
+        R1 = 7,
+        /** Left stick */
+        LeftStick = 8,
+        /** Right stick */
+        RightStick = 9
+    }
+    /** Defines values for DualShock DPad  */
+    export enum DualShockDpad {
+        /** Up */
+        Up = 0,
+        /** Down */
+        Down = 1,
+        /** Left */
+        Left = 2,
+        /** Right */
+        Right = 3
+    }
+    /**
+     * Defines a DualShock gamepad
+     */
+    export class DualShockPad extends Gamepad {
+        private _leftTrigger;
+        private _rightTrigger;
+        private _onlefttriggerchanged;
+        private _onrighttriggerchanged;
+        private _onbuttondown;
+        private _onbuttonup;
+        private _ondpaddown;
+        private _ondpadup;
+        /** Observable raised when a button is pressed */
+        onButtonDownObservable: Observable<DualShockButton>;
+        /** Observable raised when a button is released */
+        onButtonUpObservable: Observable<DualShockButton>;
+        /** Observable raised when a pad is pressed */
+        onPadDownObservable: Observable<DualShockDpad>;
+        /** Observable raised when a pad is released */
+        onPadUpObservable: Observable<DualShockDpad>;
+        private _buttonCross;
+        private _buttonCircle;
+        private _buttonSquare;
+        private _buttonTriangle;
+        private _buttonShare;
+        private _buttonOptions;
+        private _buttonL1;
+        private _buttonR1;
+        private _buttonLeftStick;
+        private _buttonRightStick;
+        private _dPadUp;
+        private _dPadDown;
+        private _dPadLeft;
+        private _dPadRight;
+        /**
+         * Creates a new DualShock gamepad object
+         * @param id defines the id of this gamepad
+         * @param index defines its index
+         * @param gamepad defines the internal HTML gamepad object
+         */
+        constructor(id: string, index: number, gamepad: any);
+        /**
+         * Defines the callback to call when left trigger is pressed
+         * @param callback defines the callback to use
+         */
+        onlefttriggerchanged(callback: (value: number) => void): void;
+        /**
+         * Defines the callback to call when right trigger is pressed
+         * @param callback defines the callback to use
+         */
+        onrighttriggerchanged(callback: (value: number) => void): void;
+        /**
+         * Gets the left trigger value
+         */
+        /**
+        * Sets the left trigger value
+        */
+        leftTrigger: number;
+        /**
+         * Gets the right trigger value
+         */
+        /**
+        * Sets the right trigger value
+        */
+        rightTrigger: number;
+        /**
+         * Defines the callback to call when a button is pressed
+         * @param callback defines the callback to use
+         */
+        onbuttondown(callback: (buttonPressed: DualShockButton) => void): void;
+        /**
+         * Defines the callback to call when a button is released
+         * @param callback defines the callback to use
+         */
+        onbuttonup(callback: (buttonReleased: DualShockButton) => void): void;
+        /**
+         * Defines the callback to call when a pad is pressed
+         * @param callback defines the callback to use
+         */
+        ondpaddown(callback: (dPadPressed: DualShockDpad) => void): void;
+        /**
+         * Defines the callback to call when a pad is released
+         * @param callback defines the callback to use
+         */
+        ondpadup(callback: (dPadReleased: DualShockDpad) => void): void;
+        private _setButtonValue;
+        private _setDPadValue;
+        /**
+         * Gets the value of the `Cross` button
+         */
+        /**
+        * Sets the value of the `Cross` button
+        */
+        buttonCross: number;
+        /**
+         * Gets the value of the `Circle` button
+         */
+        /**
+        * Sets the value of the `Circle` button
+        */
+        buttonCircle: number;
+        /**
+         * Gets the value of the `Square` button
+         */
+        /**
+        * Sets the value of the `Square` button
+        */
+        buttonSquare: number;
+        /**
+         * Gets the value of the `Triangle` button
+         */
+        /**
+        * Sets the value of the `Triangle` button
+        */
+        buttonTriangle: number;
+        /**
+         * Gets the value of the `Options` button
+         */
+        /**
+        * Sets the value of the `Options` button
+        */
+        buttonOptions: number;
+        /**
+         * Gets the value of the `Share` button
+         */
+        /**
+        * Sets the value of the `Share` button
+        */
+        buttonShare: number;
+        /**
+         * Gets the value of the `L1` button
+         */
+        /**
+        * Sets the value of the `L1` button
+        */
+        buttonL1: number;
+        /**
+         * Gets the value of the `R1` button
+         */
+        /**
+        * Sets the value of the `R1` button
+        */
+        buttonR1: number;
+        /**
+         * Gets the value of the Left joystick
+         */
+        /**
+        * Sets the value of the Left joystick
+        */
+        buttonLeftStick: number;
+        /**
+         * Gets the value of the Right joystick
+         */
+        /**
+        * Sets the value of the Right joystick
+        */
+        buttonRightStick: number;
+        /**
+         * Gets the value of D-pad up
+         */
+        /**
+        * Sets the value of D-pad up
+        */
+        dPadUp: number;
+        /**
+         * Gets the value of D-pad down
+         */
+        /**
+        * Sets the value of D-pad down
+        */
+        dPadDown: number;
+        /**
+         * Gets the value of D-pad left
+         */
+        /**
+        * Sets the value of D-pad left
+        */
+        dPadLeft: number;
+        /**
+         * Gets the value of D-pad right
+         */
+        /**
+        * Sets the value of D-pad right
+        */
+        dPadRight: number;
+        /**
+         * Force the gamepad to synchronize with device values
+         */
+        update(): void;
+        /**
+         * Disposes the gamepad
+         */
+        dispose(): void;
+    }
+}
+declare module BABYLON {
+    /**
      * Manager for handling gamepads
      */
     export class GamepadManager {
@@ -43866,8 +44137,9 @@ declare module BABYLON {
          * @param planeNormal The normal of the plane which the gizmo will be able to rotate on
          * @param color The color of the gizmo
          * @param tessellation Amount of tessellation to be used when creating rotation circles
+         * @param useEulerRotation Use and update Euler angle instead of quaternion
          */
-        constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number, parent?: Nullable<RotationGizmo>);
+        constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number, parent?: Nullable<RotationGizmo>, useEulerRotation?: boolean);
         protected _attachedMeshChanged(value: Nullable<AbstractMesh>): void;
         /**
              * If the gizmo is enabled
@@ -43906,8 +44178,9 @@ declare module BABYLON {
          * Creates a RotationGizmo
          * @param gizmoLayer The utility layer the gizmo will be added to
          * @param tessellation Amount of tessellation to be used when creating rotation circles
+         * @param useEulerRotation Use and update Euler angle instead of quaternion
          */
-        constructor(gizmoLayer?: UtilityLayerRenderer, tessellation?: number);
+        constructor(gizmoLayer?: UtilityLayerRenderer, tessellation?: number, useEulerRotation?: boolean);
         updateGizmoRotationToMatchAttachedMesh: boolean;
         /**
          * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
@@ -51385,6 +51658,7 @@ declare module BABYLON {
      * Class used to create a node based material built by assembling shader blocks
      */
     export class NodeMaterial extends PushMaterial {
+        private static _BuildIdGenerator;
         private _options;
         private _vertexCompilationState;
         private _fragmentCompilationState;
@@ -53090,7 +53364,7 @@ declare module BABYLON {
         /**
          * Vertex shader for the effect
          */
-        vertexShader: string;
+        vertexShader?: string;
         /**
          * Attributes to use in the shader
          */
@@ -58547,6 +58821,13 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /** @hidden */
+    export var volumetricLightScatteringPassVertexShader: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
     export var volumetricLightScatteringPassPixelShader: {
         name: string;
         shader: string;
@@ -60542,6 +60823,11 @@ declare module BABYLON {
          * to the src parameter of an <img> to display it
          */
         static CreateScreenshotUsingRenderTargetAsync(engine: Engine, camera: Camera, size: any, mimeType?: string, samples?: number, antialiasing?: boolean, fileName?: string): Promise<string>;
+        /**
+         * Gets height and width for screenshot size
+         * @private
+         */
+        private static _getScreenshotSize;
     }
 }
 declare module BABYLON {
@@ -69842,6 +70128,11 @@ declare module BABYLON {
         * @param {number}: Defines the waves speed
         */
         waveSpeed: number;
+        /**
+         * Sets or gets wether or not automatic clipping should be enabled or not. Setting to true will save performances and
+         * will avoid calculating useless pixels in the pixel shader of the water material.
+         */
+        disableClipPlane: boolean;
         protected _renderTargets: BABYLON.SmartArray<BABYLON.RenderTargetTexture>;
         private _mesh;
         private _refractionRTT;
@@ -69852,6 +70143,8 @@ declare module BABYLON {
         private _renderId;
         private _useLogarithmicDepth;
         private _waitingRenderList;
+        private _imageProcessingConfiguration;
+        private _imageProcessingObserver;
         /**
          * Gets a boolean indicating that current material needs to register RTT
          */

+ 1 - 1
dist/preview release/glTF2Interface/package.json

@@ -1,7 +1,7 @@
 {
     "name": "babylonjs-gltf2interface",
     "description": "A typescript declaration of babylon's gltf2 inteface.",
-    "version": "4.1.0-alpha.11",
+    "version": "4.1.0-alpha.13",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

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

@@ -11446,6 +11446,16 @@ var TextBlock = /** @class */ (function (_super) {
                 }
             }
             var newHeight = this.paddingTopInPixels + this.paddingBottomInPixels + this._fontOffset.height * this._lines.length;
+            if (this._lines.length > 0 && this._lineSpacing.internalValue !== 0) {
+                var lineSpacing = 0;
+                if (this._lineSpacing.isPixel) {
+                    lineSpacing = this._lineSpacing.getValue(this._host);
+                }
+                else {
+                    lineSpacing = (this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height));
+                }
+                newHeight += (this._lines.length - 1) * lineSpacing;
+            }
             if (newHeight !== this._height.internalValue) {
                 this._height.updateInPlace(newHeight, _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__["ValueAndUnit"].UNITMODE_PIXEL);
                 this._rebuildLayout = true;
@@ -11595,7 +11605,18 @@ var TextBlock = /** @class */ (function (_super) {
                     this._fontOffset = _control__WEBPACK_IMPORTED_MODULE_3__["Control"]._GetFontOffset(context_1.font);
                 }
                 var lines = this._lines ? this._lines : this._breakLines(this.widthInPixels - this.paddingLeftInPixels - this.paddingRightInPixels, context_1);
-                return this.paddingTopInPixels + this.paddingBottomInPixels + this._fontOffset.height * lines.length;
+                var newHeight = this.paddingTopInPixels + this.paddingBottomInPixels + this._fontOffset.height * lines.length;
+                if (this._lines.length > 0 && this._lineSpacing.internalValue !== 0) {
+                    var lineSpacing = 0;
+                    if (this._lineSpacing.isPixel) {
+                        lineSpacing = this._lineSpacing.getValue(this._host);
+                    }
+                    else {
+                        lineSpacing = (this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height));
+                    }
+                    newHeight += (lines.length - 1) * lineSpacing;
+                }
+                return newHeight;
             }
         }
         return 0;

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/gui/babylon.gui.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


+ 2 - 2
dist/preview release/gui/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-gui",
     "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
-    "version": "4.1.0-alpha.11",
+    "version": "4.1.0-alpha.13",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.1.0-alpha.11"
+        "babylonjs": "4.1.0-alpha.13"
     },
     "engines": {
         "node": "*"

File diff suppressed because it is too large
+ 6 - 6
dist/preview release/inspector/babylon.inspector.bundle.js


File diff suppressed because it is too large
+ 32 - 26
dist/preview release/inspector/babylon.inspector.bundle.max.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.max.js.map


+ 7 - 6
dist/preview release/inspector/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "4.1.0-alpha.11",
+    "version": "4.1.0-alpha.13",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -29,11 +29,12 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.1.0-alpha.11",
-        "babylonjs-gui": "4.1.0-alpha.11",
-        "babylonjs-loaders": "4.1.0-alpha.11",
-        "babylonjs-serializers": "4.1.0-alpha.11",
-        "babylonjs-gltf2interface": "4.1.0-alpha.11"
+        "babylonjs": "4.1.0-alpha.13",
+        "babylonjs-gui": "4.1.0-alpha.13",
+        "babylonjs-loaders": "4.1.0-alpha.13",
+        "babylonjs-materials": "4.1.0-alpha.13",
+        "babylonjs-serializers": "4.1.0-alpha.13",
+        "babylonjs-gltf2interface": "4.1.0-alpha.13"
     },
     "devDependencies": {
         "@types/react": "~16.7.3",

+ 3 - 3
dist/preview release/loaders/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-loaders",
     "description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
-    "version": "4.1.0-alpha.11",
+    "version": "4.1.0-alpha.13",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,8 +28,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "4.1.0-alpha.11",
-        "babylonjs": "4.1.0-alpha.11"
+        "babylonjs-gltf2interface": "4.1.0-alpha.13",
+        "babylonjs": "4.1.0-alpha.13"
     },
     "engines": {
         "node": "*"

+ 15 - 4
dist/preview release/materialsLibrary/babylon.cellMaterial.js

@@ -98,9 +98,9 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
-/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
+/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 "use strict";
@@ -117,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
@@ -169,8 +170,10 @@ function __rest(s, e) {
     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
         t[p] = s[p];
     if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
-            t[p[i]] = s[p[i]];
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
     return t;
 }
 
@@ -264,6 +267,14 @@ function __spread() {
     return ar;
 }
 
+function __spreadArrays() {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+            r[k] = a[j];
+    return r;
+};
+
 function __await(v) {
     return this instanceof __await ? (this.v = v, this) : new __await(v);
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.cellMaterial.js.map


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

@@ -98,9 +98,9 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
-/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
+/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 "use strict";
@@ -117,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
@@ -169,8 +170,10 @@ function __rest(s, e) {
     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
         t[p] = s[p];
     if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
-            t[p[i]] = s[p[i]];
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
     return t;
 }
 
@@ -264,6 +267,14 @@ function __spread() {
     return ar;
 }
 
+function __spreadArrays() {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+            r[k] = a[j];
+    return r;
+};
+
 function __await(v) {
     return this instanceof __await ? (this.v = v, this) : new __await(v);
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.customMaterial.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.customMaterial.min.js


+ 15 - 4
dist/preview release/materialsLibrary/babylon.fireMaterial.js

@@ -98,9 +98,9 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
-/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
+/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 "use strict";
@@ -117,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
@@ -169,8 +170,10 @@ function __rest(s, e) {
     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
         t[p] = s[p];
     if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
-            t[p[i]] = s[p[i]];
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
     return t;
 }
 
@@ -264,6 +267,14 @@ function __spread() {
     return ar;
 }
 
+function __spreadArrays() {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+            r[k] = a[j];
+    return r;
+};
+
 function __await(v) {
     return this instanceof __await ? (this.v = v, this) : new __await(v);
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.fireMaterial.js.map


+ 15 - 4
dist/preview release/materialsLibrary/babylon.furMaterial.js

@@ -98,9 +98,9 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
-/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
+/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 "use strict";
@@ -117,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
@@ -169,8 +170,10 @@ function __rest(s, e) {
     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
         t[p] = s[p];
     if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
-            t[p[i]] = s[p[i]];
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
     return t;
 }
 
@@ -264,6 +267,14 @@ function __spread() {
     return ar;
 }
 
+function __spreadArrays() {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+            r[k] = a[j];
+    return r;
+};
+
 function __await(v) {
     return this instanceof __await ? (this.v = v, this) : new __await(v);
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.furMaterial.js.map


+ 15 - 4
dist/preview release/materialsLibrary/babylon.gradientMaterial.js

@@ -98,9 +98,9 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
-/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
+/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 "use strict";
@@ -117,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
@@ -169,8 +170,10 @@ function __rest(s, e) {
     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
         t[p] = s[p];
     if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
-            t[p[i]] = s[p[i]];
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
     return t;
 }
 
@@ -264,6 +267,14 @@ function __spread() {
     return ar;
 }
 
+function __spreadArrays() {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+            r[k] = a[j];
+    return r;
+};
+
 function __await(v) {
     return this instanceof __await ? (this.v = v, this) : new __await(v);
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.gradientMaterial.js.map


+ 15 - 4
dist/preview release/materialsLibrary/babylon.gridMaterial.js

@@ -98,9 +98,9 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
-/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
+/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 "use strict";
@@ -117,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
@@ -169,8 +170,10 @@ function __rest(s, e) {
     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
         t[p] = s[p];
     if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
-            t[p[i]] = s[p[i]];
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
     return t;
 }
 
@@ -264,6 +267,14 @@ function __spread() {
     return ar;
 }
 
+function __spreadArrays() {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+            r[k] = a[j];
+    return r;
+};
+
 function __await(v) {
     return this instanceof __await ? (this.v = v, this) : new __await(v);
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.gridMaterial.js.map


+ 15 - 4
dist/preview release/materialsLibrary/babylon.lavaMaterial.js

@@ -98,9 +98,9 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
-/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
+/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 "use strict";
@@ -117,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
@@ -169,8 +170,10 @@ function __rest(s, e) {
     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
         t[p] = s[p];
     if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
-            t[p[i]] = s[p[i]];
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
     return t;
 }
 
@@ -264,6 +267,14 @@ function __spread() {
     return ar;
 }
 
+function __spreadArrays() {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+            r[k] = a[j];
+    return r;
+};
+
 function __await(v) {
     return this instanceof __await ? (this.v = v, this) : new __await(v);
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.lavaMaterial.js.map


+ 15 - 4
dist/preview release/materialsLibrary/babylon.mixMaterial.js

@@ -98,9 +98,9 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
-/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
+/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 "use strict";
@@ -117,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
@@ -169,8 +170,10 @@ function __rest(s, e) {
     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
         t[p] = s[p];
     if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
-            t[p[i]] = s[p[i]];
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
     return t;
 }
 
@@ -264,6 +267,14 @@ function __spread() {
     return ar;
 }
 
+function __spreadArrays() {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+            r[k] = a[j];
+    return r;
+};
+
 function __await(v) {
     return this instanceof __await ? (this.v = v, this) : new __await(v);
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.mixMaterial.js.map


+ 15 - 4
dist/preview release/materialsLibrary/babylon.normalMaterial.js

@@ -98,9 +98,9 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
-/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
+/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 "use strict";
@@ -117,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
@@ -169,8 +170,10 @@ function __rest(s, e) {
     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
         t[p] = s[p];
     if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
-            t[p[i]] = s[p[i]];
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
     return t;
 }
 
@@ -264,6 +267,14 @@ function __spread() {
     return ar;
 }
 
+function __spreadArrays() {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+            r[k] = a[j];
+    return r;
+};
+
 function __await(v) {
     return this instanceof __await ? (this.v = v, this) : new __await(v);
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.normalMaterial.js.map


+ 15 - 4
dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.js

@@ -98,9 +98,9 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
-/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
+/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 "use strict";
@@ -117,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
@@ -169,8 +170,10 @@ function __rest(s, e) {
     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
         t[p] = s[p];
     if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
-            t[p[i]] = s[p[i]];
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
     return t;
 }
 
@@ -264,6 +267,14 @@ function __spread() {
     return ar;
 }
 
+function __spreadArrays() {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+            r[k] = a[j];
+    return r;
+};
+
 function __await(v) {
     return this instanceof __await ? (this.v = v, this) : new __await(v);
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.js.map


+ 15 - 4
dist/preview release/materialsLibrary/babylon.simpleMaterial.js

@@ -98,9 +98,9 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
-/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
+/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 "use strict";
@@ -117,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
@@ -169,8 +170,10 @@ function __rest(s, e) {
     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
         t[p] = s[p];
     if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
-            t[p[i]] = s[p[i]];
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
     return t;
 }
 
@@ -264,6 +267,14 @@ function __spread() {
     return ar;
 }
 
+function __spreadArrays() {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+            r[k] = a[j];
+    return r;
+};
+
 function __await(v) {
     return this instanceof __await ? (this.v = v, this) : new __await(v);
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.simpleMaterial.js.map


+ 15 - 4
dist/preview release/materialsLibrary/babylon.skyMaterial.js

@@ -98,9 +98,9 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
-/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
+/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 "use strict";
@@ -117,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
@@ -169,8 +170,10 @@ function __rest(s, e) {
     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
         t[p] = s[p];
     if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
-            t[p[i]] = s[p[i]];
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
     return t;
 }
 
@@ -264,6 +267,14 @@ function __spread() {
     return ar;
 }
 
+function __spreadArrays() {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+            r[k] = a[j];
+    return r;
+};
+
 function __await(v) {
     return this instanceof __await ? (this.v = v, this) : new __await(v);
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.skyMaterial.js.map


+ 15 - 4
dist/preview release/materialsLibrary/babylon.terrainMaterial.js

@@ -98,9 +98,9 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
-/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
+/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 "use strict";
@@ -117,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
@@ -169,8 +170,10 @@ function __rest(s, e) {
     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
         t[p] = s[p];
     if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
-            t[p[i]] = s[p[i]];
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
     return t;
 }
 
@@ -264,6 +267,14 @@ function __spread() {
     return ar;
 }
 
+function __spreadArrays() {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+            r[k] = a[j];
+    return r;
+};
+
 function __await(v) {
     return this instanceof __await ? (this.v = v, this) : new __await(v);
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.terrainMaterial.js.map


+ 15 - 4
dist/preview release/materialsLibrary/babylon.triPlanarMaterial.js

@@ -98,9 +98,9 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
-/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
+/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 "use strict";
@@ -117,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
@@ -169,8 +170,10 @@ function __rest(s, e) {
     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
         t[p] = s[p];
     if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
-            t[p[i]] = s[p[i]];
+        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+                t[p[i]] = s[p[i]];
+        }
     return t;
 }
 
@@ -264,6 +267,14 @@ function __spread() {
     return ar;
 }
 
+function __spreadArrays() {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+            r[k] = a[j];
+    return r;
+};
+
 function __await(v) {
     return this instanceof __await ? (this.v = v, this) : new __await(v);
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.triPlanarMaterial.js.map


File diff suppressed because it is too large
+ 82 - 13
dist/preview release/materialsLibrary/babylon.waterMaterial.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.waterMaterial.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.waterMaterial.min.js


+ 7 - 0
dist/preview release/materialsLibrary/babylonjs.materials.d.ts

@@ -942,6 +942,11 @@ declare module BABYLON {
         * @param {number}: Defines the waves speed
         */
         waveSpeed: number;
+        /**
+         * Sets or gets wether or not automatic clipping should be enabled or not. Setting to true will save performances and
+         * will avoid calculating useless pixels in the pixel shader of the water material.
+         */
+        disableClipPlane: boolean;
         protected _renderTargets: BABYLON.SmartArray<BABYLON.RenderTargetTexture>;
         private _mesh;
         private _refractionRTT;
@@ -952,6 +957,8 @@ declare module BABYLON {
         private _renderId;
         private _useLogarithmicDepth;
         private _waitingRenderList;
+        private _imageProcessingConfiguration;
+        private _imageProcessingObserver;
         /**
          * Gets a boolean indicating that current material needs to register RTT
          */

File diff suppressed because it is too large
+ 82 - 13
dist/preview release/materialsLibrary/babylonjs.materials.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylonjs.materials.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylonjs.materials.min.js


+ 16 - 0
dist/preview release/materialsLibrary/babylonjs.materials.module.d.ts

@@ -1318,6 +1318,8 @@ declare module "babylonjs-materials/triPlanar/index" {
 }
 declare module "babylonjs-materials/water/water.fragment" {
     import "babylonjs/Shaders/ShadersInclude/helperFunctions";
+    import "babylonjs/Shaders/ShadersInclude/imageProcessingDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/imageProcessingFunctions";
     import "babylonjs/Shaders/ShadersInclude/lightFragmentDeclaration";
     import "babylonjs/Shaders/ShadersInclude/lightUboDeclaration";
     import "babylonjs/Shaders/ShadersInclude/lightsFragmentFunctions";
@@ -1436,6 +1438,11 @@ declare module "babylonjs-materials/water/waterMaterial" {
         * @param {number}: Defines the waves speed
         */
         waveSpeed: number;
+        /**
+         * Sets or gets wether or not automatic clipping should be enabled or not. Setting to true will save performances and
+         * will avoid calculating useless pixels in the pixel shader of the water material.
+         */
+        disableClipPlane: boolean;
         protected _renderTargets: SmartArray<RenderTargetTexture>;
         private _mesh;
         private _refractionRTT;
@@ -1446,6 +1453,8 @@ declare module "babylonjs-materials/water/waterMaterial" {
         private _renderId;
         private _useLogarithmicDepth;
         private _waitingRenderList;
+        private _imageProcessingConfiguration;
+        private _imageProcessingObserver;
         /**
          * Gets a boolean indicating that current material needs to register RTT
          */
@@ -2493,6 +2502,11 @@ declare module BABYLON {
         * @param {number}: Defines the waves speed
         */
         waveSpeed: number;
+        /**
+         * Sets or gets wether or not automatic clipping should be enabled or not. Setting to true will save performances and
+         * will avoid calculating useless pixels in the pixel shader of the water material.
+         */
+        disableClipPlane: boolean;
         protected _renderTargets: BABYLON.SmartArray<BABYLON.RenderTargetTexture>;
         private _mesh;
         private _refractionRTT;
@@ -2503,6 +2517,8 @@ declare module BABYLON {
         private _renderId;
         private _useLogarithmicDepth;
         private _waitingRenderList;
+        private _imageProcessingConfiguration;
+        private _imageProcessingObserver;
         /**
          * Gets a boolean indicating that current material needs to register RTT
          */

+ 2 - 2
dist/preview release/materialsLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-materials",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.1.0-alpha.11",
+    "version": "4.1.0-alpha.13",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.1.0-alpha.11"
+        "babylonjs": "4.1.0-alpha.13"
     },
     "engines": {
         "node": "*"

+ 53 - 4
dist/preview release/nodeEditor/babylon.nodeEditor.d.ts

@@ -286,6 +286,13 @@ declare module NODEEDITOR {
     }
 }
 declare module NODEEDITOR {
+    export interface INodeLocationInfo {
+        blockId: number;
+        x: number;
+        y: number;
+    }
+}
+declare module NODEEDITOR {
     interface IPropertyTabComponentProps {
         globalState: GlobalState;
     }
@@ -295,6 +302,7 @@ declare module NODEEDITOR {
         constructor(props: IPropertyTabComponentProps);
         componentWillMount(): void;
         load(file: File): void;
+        save(): void;
         render(): JSX.Element;
     }
 }
@@ -312,6 +320,7 @@ declare module NODEEDITOR {
         node: TextureNodeModel;
     }
     export class TexturePropertyTabComponent extends React.Component<ITexturePropertyTabComponentProps> {
+        updateAftertextureLoad(): void;
         /**
          * Replaces the texture of the node
          * @param file the file of the texture to use
@@ -867,6 +876,41 @@ declare module NODEEDITOR {
     }
 }
 declare module NODEEDITOR {
+    export enum PreviewMeshType {
+        Sphere = 0,
+        Box = 1,
+        Torus = 2,
+        Cylinder = 3
+    }
+}
+declare module NODEEDITOR {
+    export class PreviewManager {
+        private _nodeMaterial;
+        private _onBuildObserver;
+        private _onPreviewMeshTypeChangedObserver;
+        private _engine;
+        private _scene;
+        private _light;
+        private _dummy;
+        private _camera;
+        private _material;
+        private _globalState;
+        constructor(targetCanvas: HTMLCanvasElement, globalState: GlobalState);
+        private _refreshPreviewMesh;
+        private _updatePreview;
+        dispose(): void;
+    }
+}
+declare module NODEEDITOR {
+    interface IPreviewMeshControlComponent {
+        globalState: GlobalState;
+    }
+    export class PreviewMeshControlComponent extends React.Component<IPreviewMeshControlComponent> {
+        changeMeshType(newOne: PreviewMeshType): void;
+        render(): JSX.Element;
+    }
+}
+declare module NODEEDITOR {
     interface IGraphEditorProps {
         globalState: GlobalState;
     }
@@ -885,6 +929,7 @@ declare module NODEEDITOR {
         private _rightWidth;
         private _nodes;
         private _blocks;
+        private _previewManager;
         /** @hidden */
         _toAdd: LinkModel[] | null;
         /**
@@ -898,8 +943,8 @@ declare module NODEEDITOR {
         constructor(props: IGraphEditorProps);
         zoomToFit(retry?: number): void;
         buildMaterial(): void;
-        build(needToWait?: boolean): void;
-        reOrganize(): void;
+        build(needToWait?: boolean, locations?: BABYLON.Nullable<INodeLocationInfo[]>): void;
+        reOrganize(locations?: BABYLON.Nullable<INodeLocationInfo[]>): void;
         onPointerDown(evt: React.PointerEvent<HTMLDivElement>): void;
         onPointerUp(evt: React.PointerEvent<HTMLDivElement>): void;
         resizeColumns(evt: React.PointerEvent<HTMLDivElement>, forLeft?: boolean): void;
@@ -930,17 +975,21 @@ declare module NODEEDITOR {
 }
 declare module NODEEDITOR {
     export class GlobalState {
-        nodeMaterial?: BABYLON.NodeMaterial;
+        nodeMaterial: BABYLON.NodeMaterial;
         hostElement: HTMLElement;
         hostDocument: HTMLDocument;
         onSelectionChangedObservable: BABYLON.Observable<BABYLON.Nullable<DefaultNodeModel>>;
         onRebuildRequiredObservable: BABYLON.Observable<void>;
-        onResetRequiredObservable: BABYLON.Observable<void>;
+        onResetRequiredObservable: BABYLON.Observable<BABYLON.Nullable<INodeLocationInfo[]>>;
         onUpdateRequiredObservable: BABYLON.Observable<void>;
         onZoomToFitRequiredObservable: BABYLON.Observable<void>;
         onReOrganizedRequiredObservable: BABYLON.Observable<void>;
         onLogRequiredObservable: BABYLON.Observable<LogEntry>;
         onErrorMessageDialogRequiredObservable: BABYLON.Observable<string>;
+        onPreviewMeshTypeChanged: BABYLON.Observable<void>;
+        onGetNodeFromBlock: (block: BABYLON.NodeMaterialBlock) => NodeModel;
+        previewMeshType: PreviewMeshType;
+        constructor();
     }
 }
 declare module NODEEDITOR {

File diff suppressed because it is too large
+ 7 - 7
dist/preview release/nodeEditor/babylon.nodeEditor.js


File diff suppressed because it is too large
+ 279 - 35
dist/preview release/nodeEditor/babylon.nodeEditor.max.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/nodeEditor/babylon.nodeEditor.max.js.map


+ 116 - 8
dist/preview release/nodeEditor/babylon.nodeEditor.module.d.ts

@@ -344,6 +344,13 @@ declare module "babylonjs-node-editor/sharedComponents/fileButtonLineComponent"
         render(): JSX.Element;
     }
 }
+declare module "babylonjs-node-editor/nodeLocationInfo" {
+    export interface INodeLocationInfo {
+        blockId: number;
+        x: number;
+        y: number;
+    }
+}
 declare module "babylonjs-node-editor/components/propertyTab/propertyTabComponent" {
     import * as React from "react";
     import { GlobalState } from "babylonjs-node-editor/globalState";
@@ -358,6 +365,7 @@ declare module "babylonjs-node-editor/components/propertyTab/propertyTabComponen
         constructor(props: IPropertyTabComponentProps);
         componentWillMount(): void;
         load(file: File): void;
+        save(): void;
         render(): JSX.Element;
     }
 }
@@ -380,6 +388,7 @@ declare module "babylonjs-node-editor/components/diagram/texture/textureProperty
         node: TextureNodeModel;
     }
     export class TexturePropertyTabComponent extends React.Component<ITexturePropertyTabComponentProps> {
+        updateAftertextureLoad(): void;
         /**
          * Replaces the texture of the node
          * @param file the file of the texture to use
@@ -1030,6 +1039,45 @@ declare module "babylonjs-node-editor/graphHelper" {
         private static _MapEdges;
     }
 }
+declare module "babylonjs-node-editor/components/preview/previewMeshType" {
+    export enum PreviewMeshType {
+        Sphere = 0,
+        Box = 1,
+        Torus = 2,
+        Cylinder = 3
+    }
+}
+declare module "babylonjs-node-editor/components/preview/previewManager" {
+    import { GlobalState } from "babylonjs-node-editor/globalState";
+    export class PreviewManager {
+        private _nodeMaterial;
+        private _onBuildObserver;
+        private _onPreviewMeshTypeChangedObserver;
+        private _engine;
+        private _scene;
+        private _light;
+        private _dummy;
+        private _camera;
+        private _material;
+        private _globalState;
+        constructor(targetCanvas: HTMLCanvasElement, globalState: GlobalState);
+        private _refreshPreviewMesh;
+        private _updatePreview;
+        dispose(): void;
+    }
+}
+declare module "babylonjs-node-editor/components/preview/previewMeshControlComponent" {
+    import * as React from "react";
+    import { GlobalState } from "babylonjs-node-editor/globalState";
+    import { PreviewMeshType } from "babylonjs-node-editor/components/preview/previewMeshType";
+    interface IPreviewMeshControlComponent {
+        globalState: GlobalState;
+    }
+    export class PreviewMeshControlComponent extends React.Component<IPreviewMeshControlComponent> {
+        changeMeshType(newOne: PreviewMeshType): void;
+        render(): JSX.Element;
+    }
+}
 declare module "babylonjs-node-editor/graphEditor" {
     import { LinkModel } from "storm-react-diagrams";
     import * as React from "react";
@@ -1037,6 +1085,8 @@ declare module "babylonjs-node-editor/graphEditor" {
     import { NodeMaterialBlock } from 'babylonjs/Materials/Node/nodeMaterialBlock';
     import { NodeMaterialConnectionPoint } from 'babylonjs/Materials/Node/nodeMaterialBlockConnectionPoint';
     import { DefaultNodeModel } from "babylonjs-node-editor/components/diagram/defaultNodeModel";
+    import { Nullable } from 'babylonjs/types';
+    import { INodeLocationInfo } from "babylonjs-node-editor/nodeLocationInfo";
     interface IGraphEditorProps {
         globalState: GlobalState;
     }
@@ -1055,6 +1105,7 @@ declare module "babylonjs-node-editor/graphEditor" {
         private _rightWidth;
         private _nodes;
         private _blocks;
+        private _previewManager;
         /** @hidden */
         _toAdd: LinkModel[] | null;
         /**
@@ -1068,8 +1119,8 @@ declare module "babylonjs-node-editor/graphEditor" {
         constructor(props: IGraphEditorProps);
         zoomToFit(retry?: number): void;
         buildMaterial(): void;
-        build(needToWait?: boolean): void;
-        reOrganize(): void;
+        build(needToWait?: boolean, locations?: Nullable<INodeLocationInfo[]>): void;
+        reOrganize(locations?: Nullable<INodeLocationInfo[]>): void;
         onPointerDown(evt: React.PointerEvent<HTMLDivElement>): void;
         onPointerUp(evt: React.PointerEvent<HTMLDivElement>): void;
         resizeColumns(evt: React.PointerEvent<HTMLDivElement>, forLeft?: boolean): void;
@@ -1110,18 +1161,26 @@ declare module "babylonjs-node-editor/globalState" {
     import { Observable } from 'babylonjs/Misc/observable';
     import { DefaultNodeModel } from "babylonjs-node-editor/components/diagram/defaultNodeModel";
     import { LogEntry } from "babylonjs-node-editor/components/log/logComponent";
+    import { NodeModel } from 'storm-react-diagrams';
+    import { INodeLocationInfo } from "babylonjs-node-editor/nodeLocationInfo";
+    import { NodeMaterialBlock } from 'babylonjs/Materials/Node/nodeMaterialBlock';
+    import { PreviewMeshType } from "babylonjs-node-editor/components/preview/previewMeshType";
     export class GlobalState {
-        nodeMaterial?: NodeMaterial;
+        nodeMaterial: NodeMaterial;
         hostElement: HTMLElement;
         hostDocument: HTMLDocument;
         onSelectionChangedObservable: Observable<Nullable<DefaultNodeModel>>;
         onRebuildRequiredObservable: Observable<void>;
-        onResetRequiredObservable: Observable<void>;
+        onResetRequiredObservable: Observable<Nullable<INodeLocationInfo[]>>;
         onUpdateRequiredObservable: Observable<void>;
         onZoomToFitRequiredObservable: Observable<void>;
         onReOrganizedRequiredObservable: Observable<void>;
         onLogRequiredObservable: Observable<LogEntry>;
         onErrorMessageDialogRequiredObservable: Observable<string>;
+        onPreviewMeshTypeChanged: Observable<void>;
+        onGetNodeFromBlock: (block: NodeMaterialBlock) => NodeModel;
+        previewMeshType: PreviewMeshType;
+        constructor();
     }
 }
 declare module "babylonjs-node-editor/sharedComponents/popup" {
@@ -1446,6 +1505,13 @@ declare module NODEEDITOR {
     }
 }
 declare module NODEEDITOR {
+    export interface INodeLocationInfo {
+        blockId: number;
+        x: number;
+        y: number;
+    }
+}
+declare module NODEEDITOR {
     interface IPropertyTabComponentProps {
         globalState: GlobalState;
     }
@@ -1455,6 +1521,7 @@ declare module NODEEDITOR {
         constructor(props: IPropertyTabComponentProps);
         componentWillMount(): void;
         load(file: File): void;
+        save(): void;
         render(): JSX.Element;
     }
 }
@@ -1472,6 +1539,7 @@ declare module NODEEDITOR {
         node: TextureNodeModel;
     }
     export class TexturePropertyTabComponent extends React.Component<ITexturePropertyTabComponentProps> {
+        updateAftertextureLoad(): void;
         /**
          * Replaces the texture of the node
          * @param file the file of the texture to use
@@ -2027,6 +2095,41 @@ declare module NODEEDITOR {
     }
 }
 declare module NODEEDITOR {
+    export enum PreviewMeshType {
+        Sphere = 0,
+        Box = 1,
+        Torus = 2,
+        Cylinder = 3
+    }
+}
+declare module NODEEDITOR {
+    export class PreviewManager {
+        private _nodeMaterial;
+        private _onBuildObserver;
+        private _onPreviewMeshTypeChangedObserver;
+        private _engine;
+        private _scene;
+        private _light;
+        private _dummy;
+        private _camera;
+        private _material;
+        private _globalState;
+        constructor(targetCanvas: HTMLCanvasElement, globalState: GlobalState);
+        private _refreshPreviewMesh;
+        private _updatePreview;
+        dispose(): void;
+    }
+}
+declare module NODEEDITOR {
+    interface IPreviewMeshControlComponent {
+        globalState: GlobalState;
+    }
+    export class PreviewMeshControlComponent extends React.Component<IPreviewMeshControlComponent> {
+        changeMeshType(newOne: PreviewMeshType): void;
+        render(): JSX.Element;
+    }
+}
+declare module NODEEDITOR {
     interface IGraphEditorProps {
         globalState: GlobalState;
     }
@@ -2045,6 +2148,7 @@ declare module NODEEDITOR {
         private _rightWidth;
         private _nodes;
         private _blocks;
+        private _previewManager;
         /** @hidden */
         _toAdd: LinkModel[] | null;
         /**
@@ -2058,8 +2162,8 @@ declare module NODEEDITOR {
         constructor(props: IGraphEditorProps);
         zoomToFit(retry?: number): void;
         buildMaterial(): void;
-        build(needToWait?: boolean): void;
-        reOrganize(): void;
+        build(needToWait?: boolean, locations?: BABYLON.Nullable<INodeLocationInfo[]>): void;
+        reOrganize(locations?: BABYLON.Nullable<INodeLocationInfo[]>): void;
         onPointerDown(evt: React.PointerEvent<HTMLDivElement>): void;
         onPointerUp(evt: React.PointerEvent<HTMLDivElement>): void;
         resizeColumns(evt: React.PointerEvent<HTMLDivElement>, forLeft?: boolean): void;
@@ -2090,17 +2194,21 @@ declare module NODEEDITOR {
 }
 declare module NODEEDITOR {
     export class GlobalState {
-        nodeMaterial?: BABYLON.NodeMaterial;
+        nodeMaterial: BABYLON.NodeMaterial;
         hostElement: HTMLElement;
         hostDocument: HTMLDocument;
         onSelectionChangedObservable: BABYLON.Observable<BABYLON.Nullable<DefaultNodeModel>>;
         onRebuildRequiredObservable: BABYLON.Observable<void>;
-        onResetRequiredObservable: BABYLON.Observable<void>;
+        onResetRequiredObservable: BABYLON.Observable<BABYLON.Nullable<INodeLocationInfo[]>>;
         onUpdateRequiredObservable: BABYLON.Observable<void>;
         onZoomToFitRequiredObservable: BABYLON.Observable<void>;
         onReOrganizedRequiredObservable: BABYLON.Observable<void>;
         onLogRequiredObservable: BABYLON.Observable<LogEntry>;
         onErrorMessageDialogRequiredObservable: BABYLON.Observable<string>;
+        onPreviewMeshTypeChanged: BABYLON.Observable<void>;
+        onGetNodeFromBlock: (block: BABYLON.NodeMaterialBlock) => NodeModel;
+        previewMeshType: PreviewMeshType;
+        constructor();
     }
 }
 declare module NODEEDITOR {

+ 2 - 2
dist/preview release/nodeEditor/package.json

@@ -4,14 +4,14 @@
     },
     "name": "babylonjs-node-editor",
     "description": "The Babylon.js node material editor.",
-    "version": "4.1.0-alpha.11",
+    "version": "4.1.0-alpha.13",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
     },
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.1.0-alpha.11"
+        "babylonjs": "4.1.0-alpha.13"
     },
     "files": [
         "babylon.nodeEditor.max.js.map",

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

@@ -7,7 +7,7 @@
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "4.1.0-alpha.11",
+    "version": "4.1.0-alpha.13",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

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

@@ -1 +1 @@
-{"engineOnly":166310,"sceneOnly":504943,"minGridMaterial":633812,"minStandardMaterial":761093}
+{"engineOnly":166856,"sceneOnly":506490,"minGridMaterial":635391,"minStandardMaterial":762672}

+ 2 - 2
dist/preview release/postProcessesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-post-process",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.1.0-alpha.11",
+    "version": "4.1.0-alpha.13",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.1.0-alpha.11"
+        "babylonjs": "4.1.0-alpha.13"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/proceduralTexturesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-procedural-textures",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.1.0-alpha.11",
+    "version": "4.1.0-alpha.13",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.1.0-alpha.11"
+        "babylonjs": "4.1.0-alpha.13"
     },
     "engines": {
         "node": "*"

+ 3 - 3
dist/preview release/serializers/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-serializers",
     "description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.",
-    "version": "4.1.0-alpha.11",
+    "version": "4.1.0-alpha.13",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,8 +28,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.1.0-alpha.11",
-        "babylonjs-gltf2interface": "4.1.0-alpha.11"
+        "babylonjs": "4.1.0-alpha.13",
+        "babylonjs-gltf2interface": "4.1.0-alpha.13"
     },
     "engines": {
         "node": "*"

+ 606 - 18
dist/preview release/viewer/babylon.module.d.ts

@@ -12296,6 +12296,10 @@ declare module "babylonjs/Gamepads/gamepad" {
          */
         static POSE_ENABLED: number;
         /**
+         * Represents an Dual Shock controller
+         */
+        static DUALSHOCK: number;
+        /**
          * Specifies whether the left control stick should be Y-inverted
          */
         protected _invertLeftStickY: boolean;
@@ -13934,6 +13938,10 @@ declare module "babylonjs/Meshes/transformNode" {
          * Object will rotate to face the camera
          */
         static BILLBOARDMODE_ALL: number;
+        /**
+         * Object will rotate to face the camera's position instead of orientation
+         */
+        static BILLBOARDMODE_USE_POSITION: number;
         private _forward;
         private _forwardInverted;
         private _up;
@@ -19168,7 +19176,7 @@ declare module "babylonjs/Meshes/instancedMesh" {
          *
          * Returns the clone.
          */
-        clone(name: string, newParent: Node, doNotCloneChildren?: boolean): InstancedMesh;
+        clone(name: string, newParent?: Node, doNotCloneChildren?: boolean): InstancedMesh;
         /**
          * Disposes the InstancedMesh.
          * Returns nothing.
@@ -26322,6 +26330,8 @@ declare module "babylonjs/Meshes/abstractMesh" {
         static readonly BILLBOARDMODE_Z: number;
         /** Billboard on all axes */
         static readonly BILLBOARDMODE_ALL: number;
+        /** Billboard on using position instead of orientation */
+        static readonly BILLBOARDMODE_USE_POSITION: number;
         /** @hidden */
         _internalAbstractMeshDataInfo: _InternalAbstractMeshDataInfo;
         /**
@@ -30482,6 +30492,8 @@ declare module "babylonjs/Engines/engine" {
         parallelShaderCompile: {
             COMPLETION_STATUS_KHR: number;
         };
+        /** Max number of texture samples for MSAA */
+        maxMSAASamples: number;
     }
     /** Interface defining initialization parameters for Engine class */
     export interface EngineOptions extends WebGLContextAttributes {
@@ -31184,6 +31196,16 @@ declare module "babylonjs/Engines/engine" {
          */
         getRenderingCanvas(): Nullable<HTMLCanvasElement>;
         /**
+         * Gets host window
+         * @returns the host window object
+         */
+        getHostWindow(): Window;
+        /**
+         * Gets host document
+         * @returns the host document object
+         */
+        getHostDocument(): Document;
+        /**
          * Gets the client rect of the HTML canvas attached with the current webGL context
          * @returns a client rectanglee
          */
@@ -32728,17 +32750,19 @@ declare module "babylonjs/Misc/tools" {
         static IsEmpty(obj: any): boolean;
         /**
          * Function used to register events at window level
+         * @param windowElement defines the Window object to use
          * @param events defines the events to register
          */
-        static RegisterTopRootEvents(events: {
+        static RegisterTopRootEvents(windowElement: Window, events: {
             name: string;
             handler: Nullable<(e: FocusEvent) => any>;
         }[]): void;
         /**
          * Function used to unregister events from window level
+         * @param windowElement defines the Window object to use
          * @param events defines the events to unregister
          */
-        static UnregisterTopRootEvents(events: {
+        static UnregisterTopRootEvents(windowElement: Window, events: {
             name: string;
             handler: Nullable<(e: FocusEvent) => any>;
         }[]): void;
@@ -33609,6 +33633,21 @@ declare module "babylonjs/scene" {
         */
         environmentTexture: Nullable<BaseTexture>;
         /** @hidden */
+        protected _environmentIntensity: number;
+        /**
+         * Intensity of the environment in all pbr material.
+         * This dims or reinforces the IBL lighting overall (reflection and diffuse).
+         * As in the majority of the scene they are the same (exception for multi room and so on),
+         * this is easier to reference from here than from all the materials.
+         */
+        /**
+        * Intensity of the environment in all pbr material.
+        * This dims or reinforces the IBL lighting overall (reflection and diffuse).
+        * As in the majority of the scene they are the same (exception for multi room and so on),
+        * this is easier to set here than in all the materials.
+        */
+        environmentIntensity: number;
+        /** @hidden */
         protected _imageProcessingConfiguration: ImageProcessingConfiguration;
         /**
          * Default image processing configuration used either in the rendering
@@ -36099,6 +36138,7 @@ declare module "babylonjs/Audio/audioSceneComponent" {
     import { ISceneSerializableComponent } from "babylonjs/sceneComponent";
     import { Scene } from "babylonjs/scene";
     import { AbstractScene } from "babylonjs/abstractScene";
+    import "babylonjs/Audio/audioEngine";
     module "babylonjs/abstractScene" {
         interface AbstractScene {
             /**
@@ -39402,6 +39442,7 @@ declare module "babylonjs/Cameras/deviceOrientationCamera" {
         private _initialQuaternion;
         private _quaternionCache;
         private _tmpDragQuaternion;
+        private _disablePointerInputWhenUsingDeviceOrientation;
         /**
          * Creates a new device orientation camera
          * @param name The name of the camera
@@ -39410,10 +39451,9 @@ declare module "babylonjs/Cameras/deviceOrientationCamera" {
          */
         constructor(name: string, position: Vector3, scene: Scene);
         /**
-         * @hidden
-         * Disabled pointer input on first orientation sensor update (Default: true)
+         * Gets or sets a boolean indicating that pointer input must be disabled on first orientation sensor update (Default: true)
          */
-        _disablePointerInputWhenUsingDeviceOrientation: boolean;
+        disablePointerInputWhenUsingDeviceOrientation: boolean;
         private _dragFactor;
         /**
          * Enabled turning on the y axis when the orientation sensor is active
@@ -39674,6 +39714,240 @@ declare module "babylonjs/Gamepads/xboxGamepad" {
         dispose(): void;
     }
 }
+declare module "babylonjs/Gamepads/dualShockGamepad" {
+    import { Observable } from "babylonjs/Misc/observable";
+    import { Gamepad } from "babylonjs/Gamepads/gamepad";
+    /**
+     * Defines supported buttons for DualShock compatible gamepads
+     */
+    export enum DualShockButton {
+        /** Cross */
+        Cross = 0,
+        /** Circle */
+        Circle = 1,
+        /** Square */
+        Square = 2,
+        /** Triangle */
+        Triangle = 3,
+        /** Options */
+        Options = 4,
+        /** Share */
+        Share = 5,
+        /** L1 */
+        L1 = 6,
+        /** R1 */
+        R1 = 7,
+        /** Left stick */
+        LeftStick = 8,
+        /** Right stick */
+        RightStick = 9
+    }
+    /** Defines values for DualShock DPad  */
+    export enum DualShockDpad {
+        /** Up */
+        Up = 0,
+        /** Down */
+        Down = 1,
+        /** Left */
+        Left = 2,
+        /** Right */
+        Right = 3
+    }
+    /**
+     * Defines a DualShock gamepad
+     */
+    export class DualShockPad extends Gamepad {
+        private _leftTrigger;
+        private _rightTrigger;
+        private _onlefttriggerchanged;
+        private _onrighttriggerchanged;
+        private _onbuttondown;
+        private _onbuttonup;
+        private _ondpaddown;
+        private _ondpadup;
+        /** Observable raised when a button is pressed */
+        onButtonDownObservable: Observable<DualShockButton>;
+        /** Observable raised when a button is released */
+        onButtonUpObservable: Observable<DualShockButton>;
+        /** Observable raised when a pad is pressed */
+        onPadDownObservable: Observable<DualShockDpad>;
+        /** Observable raised when a pad is released */
+        onPadUpObservable: Observable<DualShockDpad>;
+        private _buttonCross;
+        private _buttonCircle;
+        private _buttonSquare;
+        private _buttonTriangle;
+        private _buttonShare;
+        private _buttonOptions;
+        private _buttonL1;
+        private _buttonR1;
+        private _buttonLeftStick;
+        private _buttonRightStick;
+        private _dPadUp;
+        private _dPadDown;
+        private _dPadLeft;
+        private _dPadRight;
+        /**
+         * Creates a new DualShock gamepad object
+         * @param id defines the id of this gamepad
+         * @param index defines its index
+         * @param gamepad defines the internal HTML gamepad object
+         */
+        constructor(id: string, index: number, gamepad: any);
+        /**
+         * Defines the callback to call when left trigger is pressed
+         * @param callback defines the callback to use
+         */
+        onlefttriggerchanged(callback: (value: number) => void): void;
+        /**
+         * Defines the callback to call when right trigger is pressed
+         * @param callback defines the callback to use
+         */
+        onrighttriggerchanged(callback: (value: number) => void): void;
+        /**
+         * Gets the left trigger value
+         */
+        /**
+        * Sets the left trigger value
+        */
+        leftTrigger: number;
+        /**
+         * Gets the right trigger value
+         */
+        /**
+        * Sets the right trigger value
+        */
+        rightTrigger: number;
+        /**
+         * Defines the callback to call when a button is pressed
+         * @param callback defines the callback to use
+         */
+        onbuttondown(callback: (buttonPressed: DualShockButton) => void): void;
+        /**
+         * Defines the callback to call when a button is released
+         * @param callback defines the callback to use
+         */
+        onbuttonup(callback: (buttonReleased: DualShockButton) => void): void;
+        /**
+         * Defines the callback to call when a pad is pressed
+         * @param callback defines the callback to use
+         */
+        ondpaddown(callback: (dPadPressed: DualShockDpad) => void): void;
+        /**
+         * Defines the callback to call when a pad is released
+         * @param callback defines the callback to use
+         */
+        ondpadup(callback: (dPadReleased: DualShockDpad) => void): void;
+        private _setButtonValue;
+        private _setDPadValue;
+        /**
+         * Gets the value of the `Cross` button
+         */
+        /**
+        * Sets the value of the `Cross` button
+        */
+        buttonCross: number;
+        /**
+         * Gets the value of the `Circle` button
+         */
+        /**
+        * Sets the value of the `Circle` button
+        */
+        buttonCircle: number;
+        /**
+         * Gets the value of the `Square` button
+         */
+        /**
+        * Sets the value of the `Square` button
+        */
+        buttonSquare: number;
+        /**
+         * Gets the value of the `Triangle` button
+         */
+        /**
+        * Sets the value of the `Triangle` button
+        */
+        buttonTriangle: number;
+        /**
+         * Gets the value of the `Options` button
+         */
+        /**
+        * Sets the value of the `Options` button
+        */
+        buttonOptions: number;
+        /**
+         * Gets the value of the `Share` button
+         */
+        /**
+        * Sets the value of the `Share` button
+        */
+        buttonShare: number;
+        /**
+         * Gets the value of the `L1` button
+         */
+        /**
+        * Sets the value of the `L1` button
+        */
+        buttonL1: number;
+        /**
+         * Gets the value of the `R1` button
+         */
+        /**
+        * Sets the value of the `R1` button
+        */
+        buttonR1: number;
+        /**
+         * Gets the value of the Left joystick
+         */
+        /**
+        * Sets the value of the Left joystick
+        */
+        buttonLeftStick: number;
+        /**
+         * Gets the value of the Right joystick
+         */
+        /**
+        * Sets the value of the Right joystick
+        */
+        buttonRightStick: number;
+        /**
+         * Gets the value of D-pad up
+         */
+        /**
+        * Sets the value of D-pad up
+        */
+        dPadUp: number;
+        /**
+         * Gets the value of D-pad down
+         */
+        /**
+        * Sets the value of D-pad down
+        */
+        dPadDown: number;
+        /**
+         * Gets the value of D-pad left
+         */
+        /**
+        * Sets the value of D-pad left
+        */
+        dPadLeft: number;
+        /**
+         * Gets the value of D-pad right
+         */
+        /**
+        * Sets the value of D-pad right
+        */
+        dPadRight: number;
+        /**
+         * Force the gamepad to synchronize with device values
+         */
+        update(): void;
+        /**
+         * Disposes the gamepad
+         */
+        dispose(): void;
+    }
+}
 declare module "babylonjs/Gamepads/gamepadManager" {
     import { Observable } from "babylonjs/Misc/observable";
     import { Nullable } from "babylonjs/types";
@@ -45311,6 +45585,7 @@ declare module "babylonjs/Gamepads/index" {
     export * from "babylonjs/Gamepads/gamepadManager";
     export * from "babylonjs/Gamepads/gamepadSceneComponent";
     export * from "babylonjs/Gamepads/xboxGamepad";
+    export * from "babylonjs/Gamepads/dualShockGamepad";
 }
 declare module "babylonjs/Meshes/Builders/polyhedronBuilder" {
     import { Scene } from "babylonjs/scene";
@@ -45651,8 +45926,9 @@ declare module "babylonjs/Gizmos/planeRotationGizmo" {
          * @param planeNormal The normal of the plane which the gizmo will be able to rotate on
          * @param color The color of the gizmo
          * @param tessellation Amount of tessellation to be used when creating rotation circles
+         * @param useEulerRotation Use and update Euler angle instead of quaternion
          */
-        constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number, parent?: Nullable<RotationGizmo>);
+        constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number, parent?: Nullable<RotationGizmo>, useEulerRotation?: boolean);
         protected _attachedMeshChanged(value: Nullable<AbstractMesh>): void;
         /**
              * If the gizmo is enabled
@@ -45698,8 +45974,9 @@ declare module "babylonjs/Gizmos/rotationGizmo" {
          * Creates a RotationGizmo
          * @param gizmoLayer The utility layer the gizmo will be added to
          * @param tessellation Amount of tessellation to be used when creating rotation circles
+         * @param useEulerRotation Use and update Euler angle instead of quaternion
          */
-        constructor(gizmoLayer?: UtilityLayerRenderer, tessellation?: number);
+        constructor(gizmoLayer?: UtilityLayerRenderer, tessellation?: number, useEulerRotation?: boolean);
         updateGizmoRotationToMatchAttachedMesh: boolean;
         /**
          * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
@@ -53775,6 +54052,7 @@ declare module "babylonjs/Materials/Node/nodeMaterial" {
      * Class used to create a node based material built by assembling shader blocks
      */
     export class NodeMaterial extends PushMaterial {
+        private static _BuildIdGenerator;
         private _options;
         private _vertexCompilationState;
         private _fragmentCompilationState;
@@ -55672,7 +55950,7 @@ declare module "babylonjs/Materials/effectRenderer" {
         /**
          * Vertex shader for the effect
          */
-        vertexShader: string;
+        vertexShader?: string;
         /**
          * Attributes to use in the shader
          */
@@ -60674,6 +60952,7 @@ declare module "babylonjs/PostProcesses/RenderPipeline/Pipelines/lensRenderingPi
     import { Camera } from "babylonjs/Cameras/camera";
     import { PostProcessRenderPipeline } from "babylonjs/PostProcesses/RenderPipeline/postProcessRenderPipeline";
     import { Scene } from "babylonjs/scene";
+    import "babylonjs/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent";
     import "babylonjs/Shaders/chromaticAberration.fragment";
     import "babylonjs/Shaders/lensHighlights.fragment";
     import "babylonjs/Shaders/depthOfField.fragment";
@@ -60911,6 +61190,7 @@ declare module "babylonjs/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingP
     import { Camera } from "babylonjs/Cameras/camera";
     import { PostProcessRenderPipeline } from "babylonjs/PostProcesses/RenderPipeline/postProcessRenderPipeline";
     import { Scene } from "babylonjs/scene";
+    import "babylonjs/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent";
     import "babylonjs/Shaders/ssao2.fragment";
     import "babylonjs/Shaders/ssaoCombine.fragment";
     /**
@@ -61062,6 +61342,7 @@ declare module "babylonjs/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPi
     import { Camera } from "babylonjs/Cameras/camera";
     import { PostProcessRenderPipeline } from "babylonjs/PostProcesses/RenderPipeline/postProcessRenderPipeline";
     import { Scene } from "babylonjs/scene";
+    import "babylonjs/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent";
     import "babylonjs/Shaders/ssao.fragment";
     import "babylonjs/Shaders/ssaoCombine.fragment";
     /**
@@ -61178,6 +61459,7 @@ declare module "babylonjs/PostProcesses/RenderPipeline/Pipelines/standardRenderi
     import { DirectionalLight } from "babylonjs/Lights/directionalLight";
     import { Scene } from "babylonjs/scene";
     import { Animation } from "babylonjs/Animations/animation";
+    import "babylonjs/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent";
     import "babylonjs/Shaders/standard.fragment";
     /**
      * Standard rendering pipeline
@@ -61593,6 +61875,20 @@ declare module "babylonjs/Shaders/volumetricLightScattering.fragment" {
         shader: string;
     };
 }
+declare module "babylonjs/Shaders/volumetricLightScatteringPass.vertex" {
+    import "babylonjs/Shaders/ShadersInclude/bonesDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/morphTargetsVertexDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/instancesDeclaration";
+    import "babylonjs/Shaders/ShadersInclude/morphTargetsVertex";
+    import "babylonjs/Shaders/ShadersInclude/instancesVertex";
+    import "babylonjs/Shaders/ShadersInclude/bonesVertex";
+    /** @hidden */
+    export var volumetricLightScatteringPassVertexShader: {
+        name: string;
+        shader: string;
+    };
+}
 declare module "babylonjs/Shaders/volumetricLightScatteringPass.fragment" {
     /** @hidden */
     export var volumetricLightScatteringPassPixelShader: {
@@ -61611,6 +61907,7 @@ declare module "babylonjs/PostProcesses/volumetricLightScatteringPostProcess" {
     import "babylonjs/Meshes/Builders/planeBuilder";
     import "babylonjs/Shaders/depth.vertex";
     import "babylonjs/Shaders/volumetricLightScattering.fragment";
+    import "babylonjs/Shaders/volumetricLightScatteringPass.vertex";
     import "babylonjs/Shaders/volumetricLightScatteringPass.fragment";
     import { Engine } from "babylonjs/Engines/engine";
     /**
@@ -63733,6 +64030,11 @@ declare module "babylonjs/Misc/screenshotTools" {
          * to the src parameter of an <img> to display it
          */
         static CreateScreenshotUsingRenderTargetAsync(engine: Engine, camera: Camera, size: any, mimeType?: string, samples?: number, antialiasing?: boolean, fileName?: string): Promise<string>;
+        /**
+         * Gets height and width for screenshot size
+         * @private
+         */
+        private static _getScreenshotSize;
     }
 }
 declare module "babylonjs/Misc/index" {
@@ -75997,6 +76299,10 @@ declare module BABYLON {
          */
         static POSE_ENABLED: number;
         /**
+         * Represents an Dual Shock controller
+         */
+        static DUALSHOCK: number;
+        /**
          * Specifies whether the left control stick should be Y-inverted
          */
         protected _invertLeftStickY: boolean;
@@ -77582,6 +77888,10 @@ declare module BABYLON {
          * Object will rotate to face the camera
          */
         static BILLBOARDMODE_ALL: number;
+        /**
+         * Object will rotate to face the camera's position instead of orientation
+         */
+        static BILLBOARDMODE_USE_POSITION: number;
         private _forward;
         private _forwardInverted;
         private _up;
@@ -82604,7 +82914,7 @@ declare module BABYLON {
          *
          * Returns the clone.
          */
-        clone(name: string, newParent: Node, doNotCloneChildren?: boolean): InstancedMesh;
+        clone(name: string, newParent?: Node, doNotCloneChildren?: boolean): InstancedMesh;
         /**
          * Disposes the InstancedMesh.
          * Returns nothing.
@@ -89509,6 +89819,8 @@ declare module BABYLON {
         static readonly BILLBOARDMODE_Z: number;
         /** Billboard on all axes */
         static readonly BILLBOARDMODE_ALL: number;
+        /** Billboard on using position instead of orientation */
+        static readonly BILLBOARDMODE_USE_POSITION: number;
         /** @hidden */
         _internalAbstractMeshDataInfo: _InternalAbstractMeshDataInfo;
         /**
@@ -93550,6 +93862,8 @@ declare module BABYLON {
         parallelShaderCompile: {
             COMPLETION_STATUS_KHR: number;
         };
+        /** Max number of texture samples for MSAA */
+        maxMSAASamples: number;
     }
     /** Interface defining initialization parameters for Engine class */
     export interface EngineOptions extends WebGLContextAttributes {
@@ -94252,6 +94566,16 @@ declare module BABYLON {
          */
         getRenderingCanvas(): Nullable<HTMLCanvasElement>;
         /**
+         * Gets host window
+         * @returns the host window object
+         */
+        getHostWindow(): Window;
+        /**
+         * Gets host document
+         * @returns the host document object
+         */
+        getHostDocument(): Document;
+        /**
          * Gets the client rect of the HTML canvas attached with the current webGL context
          * @returns a client rectanglee
          */
@@ -95785,17 +96109,19 @@ declare module BABYLON {
         static IsEmpty(obj: any): boolean;
         /**
          * Function used to register events at window level
+         * @param windowElement defines the Window object to use
          * @param events defines the events to register
          */
-        static RegisterTopRootEvents(events: {
+        static RegisterTopRootEvents(windowElement: Window, events: {
             name: string;
             handler: Nullable<(e: FocusEvent) => any>;
         }[]): void;
         /**
          * Function used to unregister events from window level
+         * @param windowElement defines the Window object to use
          * @param events defines the events to unregister
          */
-        static UnregisterTopRootEvents(events: {
+        static UnregisterTopRootEvents(windowElement: Window, events: {
             name: string;
             handler: Nullable<(e: FocusEvent) => any>;
         }[]): void;
@@ -96600,6 +96926,21 @@ declare module BABYLON {
         */
         environmentTexture: Nullable<BaseTexture>;
         /** @hidden */
+        protected _environmentIntensity: number;
+        /**
+         * Intensity of the environment in all pbr material.
+         * This dims or reinforces the IBL lighting overall (reflection and diffuse).
+         * As in the majority of the scene they are the same (exception for multi room and so on),
+         * this is easier to reference from here than from all the materials.
+         */
+        /**
+        * Intensity of the environment in all pbr material.
+        * This dims or reinforces the IBL lighting overall (reflection and diffuse).
+        * As in the majority of the scene they are the same (exception for multi room and so on),
+        * this is easier to set here than in all the materials.
+        */
+        environmentIntensity: number;
+        /** @hidden */
         protected _imageProcessingConfiguration: ImageProcessingConfiguration;
         /**
          * Default image processing configuration used either in the rendering
@@ -102141,6 +102482,7 @@ declare module BABYLON {
         private _initialQuaternion;
         private _quaternionCache;
         private _tmpDragQuaternion;
+        private _disablePointerInputWhenUsingDeviceOrientation;
         /**
          * Creates a new device orientation camera
          * @param name The name of the camera
@@ -102149,10 +102491,9 @@ declare module BABYLON {
          */
         constructor(name: string, position: Vector3, scene: Scene);
         /**
-         * @hidden
-         * Disabled pointer input on first orientation sensor update (Default: true)
+         * Gets or sets a boolean indicating that pointer input must be disabled on first orientation sensor update (Default: true)
          */
-        _disablePointerInputWhenUsingDeviceOrientation: boolean;
+        disablePointerInputWhenUsingDeviceOrientation: boolean;
         private _dragFactor;
         /**
          * Enabled turning on the y axis when the orientation sensor is active
@@ -102413,6 +102754,238 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /**
+     * Defines supported buttons for DualShock compatible gamepads
+     */
+    export enum DualShockButton {
+        /** Cross */
+        Cross = 0,
+        /** Circle */
+        Circle = 1,
+        /** Square */
+        Square = 2,
+        /** Triangle */
+        Triangle = 3,
+        /** Options */
+        Options = 4,
+        /** Share */
+        Share = 5,
+        /** L1 */
+        L1 = 6,
+        /** R1 */
+        R1 = 7,
+        /** Left stick */
+        LeftStick = 8,
+        /** Right stick */
+        RightStick = 9
+    }
+    /** Defines values for DualShock DPad  */
+    export enum DualShockDpad {
+        /** Up */
+        Up = 0,
+        /** Down */
+        Down = 1,
+        /** Left */
+        Left = 2,
+        /** Right */
+        Right = 3
+    }
+    /**
+     * Defines a DualShock gamepad
+     */
+    export class DualShockPad extends Gamepad {
+        private _leftTrigger;
+        private _rightTrigger;
+        private _onlefttriggerchanged;
+        private _onrighttriggerchanged;
+        private _onbuttondown;
+        private _onbuttonup;
+        private _ondpaddown;
+        private _ondpadup;
+        /** Observable raised when a button is pressed */
+        onButtonDownObservable: Observable<DualShockButton>;
+        /** Observable raised when a button is released */
+        onButtonUpObservable: Observable<DualShockButton>;
+        /** Observable raised when a pad is pressed */
+        onPadDownObservable: Observable<DualShockDpad>;
+        /** Observable raised when a pad is released */
+        onPadUpObservable: Observable<DualShockDpad>;
+        private _buttonCross;
+        private _buttonCircle;
+        private _buttonSquare;
+        private _buttonTriangle;
+        private _buttonShare;
+        private _buttonOptions;
+        private _buttonL1;
+        private _buttonR1;
+        private _buttonLeftStick;
+        private _buttonRightStick;
+        private _dPadUp;
+        private _dPadDown;
+        private _dPadLeft;
+        private _dPadRight;
+        /**
+         * Creates a new DualShock gamepad object
+         * @param id defines the id of this gamepad
+         * @param index defines its index
+         * @param gamepad defines the internal HTML gamepad object
+         */
+        constructor(id: string, index: number, gamepad: any);
+        /**
+         * Defines the callback to call when left trigger is pressed
+         * @param callback defines the callback to use
+         */
+        onlefttriggerchanged(callback: (value: number) => void): void;
+        /**
+         * Defines the callback to call when right trigger is pressed
+         * @param callback defines the callback to use
+         */
+        onrighttriggerchanged(callback: (value: number) => void): void;
+        /**
+         * Gets the left trigger value
+         */
+        /**
+        * Sets the left trigger value
+        */
+        leftTrigger: number;
+        /**
+         * Gets the right trigger value
+         */
+        /**
+        * Sets the right trigger value
+        */
+        rightTrigger: number;
+        /**
+         * Defines the callback to call when a button is pressed
+         * @param callback defines the callback to use
+         */
+        onbuttondown(callback: (buttonPressed: DualShockButton) => void): void;
+        /**
+         * Defines the callback to call when a button is released
+         * @param callback defines the callback to use
+         */
+        onbuttonup(callback: (buttonReleased: DualShockButton) => void): void;
+        /**
+         * Defines the callback to call when a pad is pressed
+         * @param callback defines the callback to use
+         */
+        ondpaddown(callback: (dPadPressed: DualShockDpad) => void): void;
+        /**
+         * Defines the callback to call when a pad is released
+         * @param callback defines the callback to use
+         */
+        ondpadup(callback: (dPadReleased: DualShockDpad) => void): void;
+        private _setButtonValue;
+        private _setDPadValue;
+        /**
+         * Gets the value of the `Cross` button
+         */
+        /**
+        * Sets the value of the `Cross` button
+        */
+        buttonCross: number;
+        /**
+         * Gets the value of the `Circle` button
+         */
+        /**
+        * Sets the value of the `Circle` button
+        */
+        buttonCircle: number;
+        /**
+         * Gets the value of the `Square` button
+         */
+        /**
+        * Sets the value of the `Square` button
+        */
+        buttonSquare: number;
+        /**
+         * Gets the value of the `Triangle` button
+         */
+        /**
+        * Sets the value of the `Triangle` button
+        */
+        buttonTriangle: number;
+        /**
+         * Gets the value of the `Options` button
+         */
+        /**
+        * Sets the value of the `Options` button
+        */
+        buttonOptions: number;
+        /**
+         * Gets the value of the `Share` button
+         */
+        /**
+        * Sets the value of the `Share` button
+        */
+        buttonShare: number;
+        /**
+         * Gets the value of the `L1` button
+         */
+        /**
+        * Sets the value of the `L1` button
+        */
+        buttonL1: number;
+        /**
+         * Gets the value of the `R1` button
+         */
+        /**
+        * Sets the value of the `R1` button
+        */
+        buttonR1: number;
+        /**
+         * Gets the value of the Left joystick
+         */
+        /**
+        * Sets the value of the Left joystick
+        */
+        buttonLeftStick: number;
+        /**
+         * Gets the value of the Right joystick
+         */
+        /**
+        * Sets the value of the Right joystick
+        */
+        buttonRightStick: number;
+        /**
+         * Gets the value of D-pad up
+         */
+        /**
+        * Sets the value of D-pad up
+        */
+        dPadUp: number;
+        /**
+         * Gets the value of D-pad down
+         */
+        /**
+        * Sets the value of D-pad down
+        */
+        dPadDown: number;
+        /**
+         * Gets the value of D-pad left
+         */
+        /**
+        * Sets the value of D-pad left
+        */
+        dPadLeft: number;
+        /**
+         * Gets the value of D-pad right
+         */
+        /**
+        * Sets the value of D-pad right
+        */
+        dPadRight: number;
+        /**
+         * Force the gamepad to synchronize with device values
+         */
+        update(): void;
+        /**
+         * Disposes the gamepad
+         */
+        dispose(): void;
+    }
+}
+declare module BABYLON {
+    /**
      * Manager for handling gamepads
      */
     export class GamepadManager {
@@ -107797,8 +108370,9 @@ declare module BABYLON {
          * @param planeNormal The normal of the plane which the gizmo will be able to rotate on
          * @param color The color of the gizmo
          * @param tessellation Amount of tessellation to be used when creating rotation circles
+         * @param useEulerRotation Use and update Euler angle instead of quaternion
          */
-        constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number, parent?: Nullable<RotationGizmo>);
+        constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number, parent?: Nullable<RotationGizmo>, useEulerRotation?: boolean);
         protected _attachedMeshChanged(value: Nullable<AbstractMesh>): void;
         /**
              * If the gizmo is enabled
@@ -107837,8 +108411,9 @@ declare module BABYLON {
          * Creates a RotationGizmo
          * @param gizmoLayer The utility layer the gizmo will be added to
          * @param tessellation Amount of tessellation to be used when creating rotation circles
+         * @param useEulerRotation Use and update Euler angle instead of quaternion
          */
-        constructor(gizmoLayer?: UtilityLayerRenderer, tessellation?: number);
+        constructor(gizmoLayer?: UtilityLayerRenderer, tessellation?: number, useEulerRotation?: boolean);
         updateGizmoRotationToMatchAttachedMesh: boolean;
         /**
          * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
@@ -115316,6 +115891,7 @@ declare module BABYLON {
      * Class used to create a node based material built by assembling shader blocks
      */
     export class NodeMaterial extends PushMaterial {
+        private static _BuildIdGenerator;
         private _options;
         private _vertexCompilationState;
         private _fragmentCompilationState;
@@ -117021,7 +117597,7 @@ declare module BABYLON {
         /**
          * Vertex shader for the effect
          */
-        vertexShader: string;
+        vertexShader?: string;
         /**
          * Attributes to use in the shader
          */
@@ -122478,6 +123054,13 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /** @hidden */
+    export var volumetricLightScatteringPassVertexShader: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /** @hidden */
     export var volumetricLightScatteringPassPixelShader: {
         name: string;
         shader: string;
@@ -124473,6 +125056,11 @@ declare module BABYLON {
          * to the src parameter of an <img> to display it
          */
         static CreateScreenshotUsingRenderTargetAsync(engine: Engine, camera: Camera, size: any, mimeType?: string, samples?: number, antialiasing?: boolean, fileName?: string): Promise<string>;
+        /**
+         * Gets height and width for screenshot size
+         * @private
+         */
+        private static _getScreenshotSize;
     }
 }
 declare module BABYLON {

File diff suppressed because it is too large
+ 54 - 46
dist/preview release/viewer/babylon.viewer.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


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

@@ -15,6 +15,7 @@
 ## Updates
 
 ### General
+- Added support for dual shock gamepads ([Deltakosh](https://github.com/deltakosh/))
 - Support Vive Focus 3Dof controller ([TrevorDev](https://github.com/TrevorDev))
 - Planar positioning support for GizmoManager ([Balupg](https://github.com/balupg))
 - Individual gizmos can now be enabled/disabled ([Balupg](https://github.com/balupg))
@@ -31,6 +32,7 @@
 - Added `VRExperienceHelper.exitVROnDoubleTap` ([Deltakosh](https://github.com/deltakosh/))
 - Added `Scene.getTextureByUniqueID` ([aWeirdo](https://github.com/aWeirdo/))
 - Added support for 180 VR videos in `VideoDome` ([RaananW](https://github.com/RaananW/))
+- Added optional parameter to use Euler angles in planeRotationGizmo ([CedricGuillemet](https://github.com/CedricGuillemet))
 
 ### Engine
 - Morph targets now can morph UV channel as well ([Deltakosh](https://github.com/deltakosh/))
@@ -61,6 +63,7 @@
 ### Meshes
 - Added new CreateTiledPlane and CreateTiledBox ([JohnK](https://github.com/BabylonJSGuide/))
 - Added absolute scaling and rotation getters ([haroldma](https://github.com/haroldma))
+- Added `BILLBOARDMODE_USE_POSITION` flag to billboards allowing use of camera positioning instead of orientation for mesh rotation ([delaneyj](https://github.com/delaneyj))
 
 ### Physics
 - Update Ammo.js library to support global collision contact callbacks ([MackeyK24](https://github.com/MackeyK24/))
@@ -76,9 +79,11 @@
 ### Materials
 - Added `ShaderMaterial.setColor4Array` ([JonathanTron](https://github.com/JonathanTron/))
 - Added `ShaderMaterial.setArray4` ([JonathanTron](https://github.com/JonathanTron/))
+- Added `scene.environmentIntensity` to control the IBL strength overall in a scene ([Sebavan](https://github.com/sebavan/))
 
 ### ScreenshotTools
 - Added interface for argument `size` of screenshot methods ([Dok11](https://github.com/Dok11/))
+- Implementation usage of precision in combination height and width params ([Dok11](https://github.com/Dok11/))
 
 ### Sounds
 - Added `ISoundOptions.skipCodecCheck` to make `Sound` more flexible with URLs ([nbduke](https://github.com/nbduke))
@@ -94,6 +99,7 @@
 - Added a note on shallow bounding of getBoundingInfo ([tibotiber](https://github.com/tibotiber))
 
 ## Bug fixes
+- Fixed Textblock line spacing evaluation when linespacing > 0 ([Deltakosh](https://github.com/deltakosh/))
 - Fixed Xbox One gamepad controller button schemes ([MackeyK24](https://github.com/MackeyK24/))
 - Added support for `AnimationGroup` serialization ([Drigax](https://github.com/drigax/))
 - Removing assetContainer from scene will also remove gui layers ([TrevorDev](https://github.com/TrevorDev))

+ 26 - 1
gui/src/2D/controls/textBlock.ts

@@ -257,6 +257,17 @@ export class TextBlock extends Control {
             }
             let newHeight = this.paddingTopInPixels + this.paddingBottomInPixels + this._fontOffset.height * this._lines.length;
 
+            if (this._lines.length > 0 && this._lineSpacing.internalValue !== 0) {
+                let lineSpacing = 0;
+                if (this._lineSpacing.isPixel) {
+                    lineSpacing = this._lineSpacing.getValue(this._host);
+                } else {
+                    lineSpacing = (this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height));
+                }
+
+                newHeight += (this._lines.length - 1) * lineSpacing;
+            }
+
             if (newHeight !== this._height.internalValue) {
                 this._height.updateInPlace(newHeight, ValueAndUnit.UNITMODE_PIXEL);
                 this._rebuildLayout = true;
@@ -425,7 +436,21 @@ export class TextBlock extends Control {
                 }
                 const lines = this._lines ? this._lines : this._breakLines(
                     this.widthInPixels - this.paddingLeftInPixels - this.paddingRightInPixels, context);
-                return this.paddingTopInPixels + this.paddingBottomInPixels + this._fontOffset.height * lines.length;
+
+                let newHeight = this.paddingTopInPixels + this.paddingBottomInPixels + this._fontOffset.height * lines.length;
+
+                if (this._lines.length > 0 && this._lineSpacing.internalValue !== 0) {
+                    let lineSpacing = 0;
+                    if (this._lineSpacing.isPixel) {
+                        lineSpacing = this._lineSpacing.getValue(this._host);
+                    } else {
+                        lineSpacing = (this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height));
+                    }
+
+                    newHeight += (lines.length - 1) * lineSpacing;
+                }
+
+                return newHeight;
             }
         }
         return 0;

+ 2 - 10
inspector/src/components/actionTabs/tabs/propertyGrids/renderGridPropertyGridComponent.tsx

@@ -1,13 +1,13 @@
 import * as React from "react";
 
 import { Nullable } from "babylonjs/types";
-import { Tools } from "babylonjs/Misc/tools";
 import { Color3 } from "babylonjs/Maths/math";
 import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
 import { Mesh } from "babylonjs/Meshes/mesh";
 import { Texture } from "babylonjs/Materials/Textures/texture";
 import { UtilityLayerRenderer } from "babylonjs/Rendering/utilityLayerRenderer";
 import { Scene } from "babylonjs/scene";
+import { GridMaterial } from "babylonjs-materials/grid/gridMaterial";
 
 import { CheckBoxLineComponent } from "../../lines/checkBoxLineComponent";
 import { GlobalState } from '../../../globalState';
@@ -40,14 +40,6 @@ export class RenderGridPropertyGridComponent extends React.Component<IRenderGrid
     addOrRemoveGrid() {
         const scene = UtilityLayerRenderer.DefaultKeepDepthUtilityLayer.utilityLayerScene;
 
-        if (!(BABYLON as any).GridMaterial) {
-            this.setState({ isEnabled: true });
-            Tools.LoadScript("https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js", () => {
-                this.addOrRemoveGrid();
-            });
-            return;
-        }
-
         if (!this._gridMesh) {
             var extend = this.props.scene.getWorldExtends();
             var width = (extend.max.x - extend.min.x) * 5.0;
@@ -62,7 +54,7 @@ export class RenderGridPropertyGridComponent extends React.Component<IRenderGrid
             this._gridMesh.reservedDataStore.isInspectorGrid = true;
             this._gridMesh.isPickable = false;
 
-            var groundMaterial = new (BABYLON as any).GridMaterial("GridMaterial", scene);
+            var groundMaterial = new GridMaterial("GridMaterial", scene);
             groundMaterial.majorUnitFrequency = 10;
             groundMaterial.minorUnitVisibility = 0.3;
             groundMaterial.gridRatio = 0.01;

+ 1 - 0
inspector/src/components/actionTabs/tabs/propertyGrids/scenePropertyGridComponent.tsx

@@ -155,6 +155,7 @@ export class ScenePropertyGridComponent extends React.Component<IScenePropertyGr
                         <TextureLinkLineComponent label="Env. texture" texture={scene.environmentTexture} onSelectionChangedObservable={this.props.onSelectionChangedObservable} />
                     }
                     <FileButtonLineComponent label="Update environment texture" onClick={(file) => this.updateEnvironmentTexture(file)} accept=".dds, .env" />
+                    <SliderLineComponent minimum={0} maximum={2} step={0.01} label="IBL Intensity" target={scene} propertyName="environmentIntensity" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                     <FogPropertyGridComponent globalState={this.props.globalState} lockObject={this.props.lockObject} scene={scene} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                 </LineContainerComponent>
                 <LineContainerComponent globalState={this.props.globalState} title="MATERIAL IMAGE PROCESSING">

+ 1 - 1
inspector/src/components/sceneExplorer/treeItemComponent.tsx

@@ -203,7 +203,7 @@ export class TreeItemComponent extends React.Component<ITreeItemComponentProps,
                     sortedItems.map(item => {
                         return (
                             <TreeItemSelectableComponent mustExpand={this.state.mustExpand} extensibilityGroups={this.props.extensibilityGroups}
-                                key={item.uniqueId || item.name}
+                                key={item.uniqueId !== undefined && item.uniqueId !== null ? item.uniqueId : item.name}
                                 offset={this.props.offset + 1} selectedEntity={this.props.selectedEntity} entity={item}
                                 globalState={this.props.globalState} filter={this.props.filter} />
                         );

+ 1 - 1
inspector/src/components/sceneExplorer/treeItemSpecializedComponent.tsx

@@ -84,7 +84,7 @@ export class TreeItemSpecializedComponent extends React.Component<ITreeItemSpeci
                 return (<CameraTreeItemComponent extensibilityGroups={this.props.extensibilityGroups} camera={entity as Camera} onClick={() => this.onClick()} />);
             }
 
-            if (className.indexOf("Light") !== -1) {
+            if (className.indexOf("Light", className.length - 5) !== -1) {
                 return (<LightTreeItemComponent globalState={this.props.globalState} extensibilityGroups={this.props.extensibilityGroups} light={entity as Light} onClick={() => this.onClick()} />);
             }
 

+ 3 - 0
inspector/tsconfig.json

@@ -14,6 +14,9 @@
             "babylonjs-loaders/*": [
                 "../../dist/preview release/loaders/babylonjs.loaders.module.d.ts"
             ],
+            "babylonjs-materials/*": [
+                "../../dist/preview release/materialsLibrary/babylonjs.materials.module.d.ts"
+            ],
             "babylonjs-serializers/*": [
                 "../../dist/preview release/serializers/babylonjs.serializers.module.d.ts"
             ],

+ 24 - 0
materialsLibrary/src/water/water.fragment.fx

@@ -26,6 +26,9 @@ varying vec4 vColor;
 // Helper functions
 #include<helperFunctions>
 
+#include<imageProcessingDeclaration>
+#include<imageProcessingFunctions>
+
 // Lights
 #include<__decl__lightFragment>[0..maxSimultaneousLights]
 
@@ -125,6 +128,9 @@ void main(void) {
         // Water
         vec2 projectedRefractionTexCoords = clamp(vRefractionMapTexCoord.xy / vRefractionMapTexCoord.z + perturbation*0.5, 0.0, 1.0);
         vec4 refractiveColor = texture2D(refractionSampler, projectedRefractionTexCoords);
+        #ifdef IS_REFRACTION_LINEAR
+            refractiveColor.rgb = toGammaSpace(refractiveColor.rgb);
+        #endif
 
         vec2 projectedReflectionTexCoords = clamp(vec2(
             vReflectionMapTexCoord.x / vReflectionMapTexCoord.z + perturbation.x * 0.3,
@@ -132,6 +138,9 @@ void main(void) {
         ),0.0, 1.0);
 
         vec4 reflectiveColor = texture2D(reflectionSampler, projectedReflectionTexCoords);
+        #ifdef IS_REFLECTION_LINEAR
+            reflectiveColor.rgb = toGammaSpace(reflectiveColor.rgb);
+        #endif
 
         vec3 upVector = vec3(0.0, 1.0, 0.0);
 
@@ -178,9 +187,15 @@ void main(void) {
         // Water
         vec2 projectedRefractionTexCoords = clamp(vRefractionMapTexCoord.xy / vRefractionMapTexCoord.z + perturbation, 0.0, 1.0);
         vec4 refractiveColor = texture2D(refractionSampler, projectedRefractionTexCoords);
+        #ifdef IS_REFRACTION_LINEAR
+            refractiveColor.rgb = toGammaSpace(refractiveColor.rgb);
+        #endif
 
         vec2 projectedReflectionTexCoords = clamp(vReflectionMapTexCoord.xy / vReflectionMapTexCoord.z + perturbation, 0.0, 1.0);
         vec4 reflectiveColor = texture2D(reflectionSampler, projectedReflectionTexCoords);
+        #ifdef IS_REFLECTION_LINEAR
+            reflectiveColor.rgb = toGammaSpace(reflectiveColor.rgb);
+        #endif
 
         vec3 upVector = vec3(0.0, 1.0, 0.0);
 
@@ -226,6 +241,15 @@ vec4 color = vec4(finalDiffuse + finalSpecular, alpha);
 
 #include<logDepthFragment>
 #include<fogFragment>
+
+// Apply image processing if relevant. As this applies in linear space, 
+// We first move from gamma to linear.
+#ifdef IMAGEPROCESSINGPOSTPROCESS
+	color.rgb = toLinearSpace(color.rgb);
+#elif IMAGEPROCESSING
+    color.rgb = toLinearSpace(color.rgb);
+    color = applyImageProcessing(color);
+#endif
 	
 	gl_FragColor = color;
 }

+ 77 - 9
materialsLibrary/src/water/waterMaterial.ts

@@ -6,10 +6,12 @@ import { Plane } from 'babylonjs/Maths/math.plane';
 import { IAnimatable } from 'babylonjs/Animations/animatable.interface';
 import { Constants } from "babylonjs/Engines/constants";
 import { SmartArray } from "babylonjs/Misc/smartArray";
+import { Observer } from 'babylonjs/Misc/observable';
 import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
 import { RenderTargetTexture } from "babylonjs/Materials/Textures/renderTargetTexture";
 import { EffectFallbacks, EffectCreationOptions } from "babylonjs/Materials/effect";
 import { MaterialDefines } from "babylonjs/Materials/materialDefines";
+import { IImageProcessingConfigurationDefines, ImageProcessingConfiguration } from "babylonjs/Materials/imageProcessingConfiguration";
 import { MaterialHelper } from "babylonjs/Materials/materialHelper";
 import { PushMaterial } from "babylonjs/Materials/pushMaterial";
 import { MaterialFlags } from "babylonjs/Materials/materialFlags";
@@ -24,7 +26,7 @@ import { _TypeStore } from 'babylonjs/Misc/typeStore';
 import "./water.fragment";
 import "./water.vertex";
 
-class WaterMaterialDefines extends MaterialDefines {
+class WaterMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines {
     public BUMP = false;
     public REFLECTION = false;
     public CLIPPLANE = false;
@@ -49,6 +51,21 @@ class WaterMaterialDefines extends MaterialDefines {
     public BUMPSUPERIMPOSE = false;
     public BUMPAFFECTSREFLECTION = false;
 
+    public IMAGEPROCESSING = false;
+    public VIGNETTE = false;
+    public VIGNETTEBLENDMODEMULTIPLY = false;
+    public VIGNETTEBLENDMODEOPAQUE = false;
+    public TONEMAPPING = false;
+    public TONEMAPPING_ACES = false;
+    public CONTRAST = false;
+    public EXPOSURE = false;
+    public COLORCURVES = false;
+    public COLORGRADING = false;
+    public COLORGRADING3D = false;
+    public SAMPLER3DGREENDEPTH = false;
+    public SAMPLER3DBGRMAP = false;
+    public IMAGEPROCESSINGPOSTPROCESS = false;
+
     constructor() {
         super();
         this.rebuild();
@@ -158,6 +175,12 @@ export class WaterMaterial extends PushMaterial {
     */
     @serialize()
     public waveSpeed: number = 1.0;
+    /**
+     * Sets or gets wether or not automatic clipping should be enabled or not. Setting to true will save performances and
+     * will avoid calculating useless pixels in the pixel shader of the water material.
+     */
+    @serialize()
+    public disableClipPlane: boolean = false;
 
     protected _renderTargets = new SmartArray<RenderTargetTexture>(16);
 
@@ -179,6 +202,9 @@ export class WaterMaterial extends PushMaterial {
 
     private _waitingRenderList: Nullable<string[]>;
 
+    private _imageProcessingConfiguration: Nullable<ImageProcessingConfiguration>;
+    private _imageProcessingObserver: Nullable<Observer<ImageProcessingConfiguration>>;
+
     /**
      * Gets a boolean indicating that current material needs to register RTT
      */
@@ -202,6 +228,13 @@ export class WaterMaterial extends PushMaterial {
 
             return this._renderTargets;
         };
+
+        this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration;
+        if (this._imageProcessingConfiguration) {
+            this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
+                this._markAllSubMeshesAsImageProcessingDirty();
+            });
+        }
     }
 
     @serialize()
@@ -328,6 +361,18 @@ export class WaterMaterial extends PushMaterial {
         // Lights
         defines._needNormals = MaterialHelper.PrepareDefinesForLights(scene, mesh, defines, true, this._maxSimultaneousLights, this._disableLighting);
 
+        // Image processing
+        if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) {
+            if (!this._imageProcessingConfiguration.isReady()) {
+                return false;
+            }
+
+            this._imageProcessingConfiguration.prepareDefines(defines);
+
+            defines.IS_REFLECTION_LINEAR = (this.reflectionTexture != null && !this.reflectionTexture.gammaSpace);
+            defines.IS_REFRACTION_LINEAR = (this.refractionTexture != null && !this.refractionTexture.gammaSpace);
+        }
+
         // Attribs
         MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
 
@@ -405,6 +450,11 @@ export class WaterMaterial extends PushMaterial {
             ];
             var uniformBuffers = new Array<string>();
 
+            if (ImageProcessingConfiguration) {
+                ImageProcessingConfiguration.PrepareUniforms(uniforms, defines);
+                ImageProcessingConfiguration.PrepareSamplers(samplers, defines);
+            }
+
             MaterialHelper.PrepareUniformsAndSamplersList(<EffectCreationOptions>{
                 uniformsNames: uniforms,
                 uniformBuffersNames: uniformBuffers,
@@ -525,6 +575,11 @@ export class WaterMaterial extends PushMaterial {
         this._activeEffect.setFloat("colorBlendFactor2", this.colorBlendFactor2);
         this._activeEffect.setFloat("waveSpeed", this.waveSpeed);
 
+        // image processing
+        if (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess) {
+            this._imageProcessingConfiguration.bind(this._activeEffect);
+        }
+
         this._afterBind(mesh, this._activeEffect);
     }
 
@@ -550,11 +605,14 @@ export class WaterMaterial extends PushMaterial {
                 isVisible = this._mesh.isVisible;
                 this._mesh.isVisible = false;
             }
+
             // Clip plane
-            clipPlane = scene.clipPlane;
+            if (!this.disableClipPlane) {
+                clipPlane = scene.clipPlane;
 
-            var positiony = this._mesh ? this._mesh.position.y : 0.0;
-            scene.clipPlane = Plane.FromPositionAndNormal(new Vector3(0, positiony + 0.05, 0), new Vector3(0, 1, 0));
+                var positiony = this._mesh ? this._mesh.position.y : 0.0;
+                scene.clipPlane = Plane.FromPositionAndNormal(new Vector3(0, positiony + 0.05, 0), new Vector3(0, 1, 0));
+            }
         };
 
         this._refractionRTT.onAfterRender = () => {
@@ -563,7 +621,9 @@ export class WaterMaterial extends PushMaterial {
             }
 
             // Clip plane
-            scene.clipPlane = clipPlane;
+            if (!this.disableClipPlane) {
+                scene.clipPlane = clipPlane;
+            }
         };
 
         this._reflectionRTT.onBeforeRender = () => {
@@ -573,13 +633,16 @@ export class WaterMaterial extends PushMaterial {
             }
 
             // Clip plane
-            clipPlane = scene.clipPlane;
+            if (!this.disableClipPlane) {
+                clipPlane = scene.clipPlane;
+
+                var positiony = this._mesh ? this._mesh.position.y : 0.0;
+                scene.clipPlane = Plane.FromPositionAndNormal(new Vector3(0, positiony - 0.05, 0), new Vector3(0, -1, 0));
 
-            var positiony = this._mesh ? this._mesh.position.y : 0.0;
-            scene.clipPlane = Plane.FromPositionAndNormal(new Vector3(0, positiony - 0.05, 0), new Vector3(0, -1, 0));
+                Matrix.ReflectionToRef(scene.clipPlane, mirrorMatrix);
+            }
 
             // Transform
-            Matrix.ReflectionToRef(scene.clipPlane, mirrorMatrix);
             savedViewMatrix = scene.getViewMatrix();
 
             mirrorMatrix.multiplyToRef(savedViewMatrix, this._reflectionTransform);
@@ -663,6 +726,11 @@ export class WaterMaterial extends PushMaterial {
             this._refractionRTT.dispose();
         }
 
+        // Remove image-processing observer
+        if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
+            this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
+        }
+
         super.dispose(forceDisposeEffect);
     }
 

+ 21 - 14
nodeEditor/src/components/diagram/texture/texturePropertyTabComponent.tsx

@@ -19,6 +19,11 @@ interface ITexturePropertyTabComponentProps {
 
 export class TexturePropertyTabComponent extends React.Component<ITexturePropertyTabComponentProps> {
 
+    updateAftertextureLoad() {
+        this.props.globalState.onUpdateRequiredObservable.notifyObservers();
+        this.props.globalState.onRebuildRequiredObservable.notifyObservers();
+    }
+
 	/**
 	 * Replaces the texture of the node
 	 * @param file the file of the texture to use
@@ -36,23 +41,25 @@ export class TexturePropertyTabComponent extends React.Component<ITexturePropert
 
         Tools.ReadFile(file, (data) => {
             var blob = new Blob([data], { type: "octet/stream" });
-            var url = URL.createObjectURL(blob);
 
-            if (texture.isCube) {
-                let extension: string | undefined = undefined;
-                if (file.name.toLowerCase().indexOf(".dds") > 0) {
-                    extension = ".dds";
-                } else if (file.name.toLowerCase().indexOf(".env") > 0) {
-                    extension = ".env";
-                }
+            var reader = new FileReader();
+            reader.readAsDataURL(blob); 
+            reader.onloadend = () => {
+                let base64data = reader.result as string;                
 
-                (texture as Texture).updateURL(url, extension, () => this.props.globalState.onUpdateRequiredObservable.notifyObservers());
-            } else {
-                (texture as Texture).updateURL(url, null, () => this.props.globalState.onUpdateRequiredObservable.notifyObservers());
-            }
+                if (texture.isCube) {
+                    let extension: string | undefined = undefined;
+                    if (file.name.toLowerCase().indexOf(".dds") > 0) {
+                        extension = ".dds";
+                    } else if (file.name.toLowerCase().indexOf(".env") > 0) {
+                        extension = ".env";
+                    }
 
-            this.props.globalState.onUpdateRequiredObservable.notifyObservers();
-            this.props.globalState.onRebuildRequiredObservable.notifyObservers();
+                    (texture as Texture).updateURL(base64data, extension, () => this.updateAftertextureLoad());
+                } else {
+                    (texture as Texture).updateURL(base64data, null, () => this.updateAftertextureLoad());
+                }
+            }
         }, undefined, true);
     }
 

+ 105 - 0
nodeEditor/src/components/preview/previewManager.ts

@@ -0,0 +1,105 @@
+import { GlobalState } from '../../globalState';
+import { NodeMaterial } from 'babylonjs/Materials/Node/nodeMaterial';
+import { Nullable } from 'babylonjs/types';
+import { Observer } from 'babylonjs/Misc/observable';
+import { Engine } from 'babylonjs/Engines/engine';
+import { Scene } from 'babylonjs/scene';
+import { Mesh } from 'babylonjs/Meshes/mesh';
+import { Vector3 } from 'babylonjs/Maths/math.vector';
+import { HemisphericLight } from 'babylonjs/Lights/hemisphericLight';
+import { ArcRotateCamera } from 'babylonjs/Cameras/arcRotateCamera';
+import { PreviewMeshType } from './previewMeshType';
+
+export class PreviewManager {
+    private _nodeMaterial: NodeMaterial;
+    private _onBuildObserver: Nullable<Observer<NodeMaterial>>;    
+    private _onPreviewMeshTypeChangedObserver: Nullable<Observer<void>>;
+    private _engine: Engine;
+    private _scene: Scene;
+    private _light: HemisphericLight;
+    private _dummy: Mesh;
+    private _camera: ArcRotateCamera;
+    private _material: NodeMaterial;
+    private _globalState: GlobalState;    
+
+    public constructor(targetCanvas: HTMLCanvasElement, globalState: GlobalState) {
+        this._nodeMaterial = globalState.nodeMaterial;
+        this._globalState = globalState;
+
+        this._onBuildObserver = this._nodeMaterial.onBuildObservable.add((nodeMaterial) => {
+            let serializationObject = nodeMaterial.serialize();
+            this._updatePreview(serializationObject);
+        });
+
+        this._onPreviewMeshTypeChangedObserver = globalState.onPreviewMeshTypeChanged.add(() => {
+            this._refreshPreviewMesh();
+        });
+
+        this._engine = new Engine(targetCanvas, true);
+        this._scene = new Scene(this._engine);
+        this._camera = new ArcRotateCamera("Camera", 0, 0.8, 4, Vector3.Zero(), this._scene);
+        this._light = new HemisphericLight("light", new Vector3(0, 1, 0), this._scene);
+
+
+        this._camera.lowerRadiusLimit = 3;
+        this._camera.upperRadiusLimit = 10;
+        this._camera.wheelPrecision = 10;
+        this._camera.attachControl(targetCanvas, false);
+
+        this._refreshPreviewMesh();
+
+        this._engine.runRenderLoop(() => {
+            this._engine.resize();
+            this._scene.render();
+        });
+
+        let serializationObject = this._nodeMaterial.serialize();
+        this._updatePreview(serializationObject);
+    }
+
+    private _refreshPreviewMesh() {    
+        if (this._dummy) {
+            this._dummy.dispose();
+        }
+        
+        switch (this._globalState.previewMeshType) {
+            case PreviewMeshType.Box:
+                this._dummy = Mesh.CreateBox("dummy", 2, this._scene);
+                break;
+            case PreviewMeshType.Sphere:
+                this._dummy = Mesh.CreateSphere("dummy", 32, 2, this._scene);
+                break;
+            case PreviewMeshType.Torus:
+                this._dummy = Mesh.CreateTorus("dummy", 2, 0.5, 32, this._scene);
+                break;
+                case PreviewMeshType.Cylinder:
+                this._dummy = Mesh.CreateCylinder("dummy", 2, 1, 1.2, 32, 1, this._scene);
+                break;                
+        }
+        this._dummy.material = this._material;
+    }
+
+    private _updatePreview(serializationObject: any) {
+        if (this._material) {
+            this._material.dispose();
+        }        
+
+        this._material = NodeMaterial.Parse(serializationObject, this._scene);
+        this._material.build(true);
+        this._dummy.material = this._material;
+    }
+
+    public dispose() {
+        this._nodeMaterial.onBuildObservable.remove(this._onBuildObserver);
+        this._globalState.onPreviewMeshTypeChanged.remove(this._onPreviewMeshTypeChangedObserver);
+
+        if (this._material) {
+            this._material.dispose();
+        }
+
+        this._camera.dispose();
+        this._dummy.dispose();
+        this._light.dispose();
+        this._engine.dispose();
+    }
+}

+ 47 - 0
nodeEditor/src/components/preview/previewMeshControlComponent.tsx

@@ -0,0 +1,47 @@
+
+import * as React from "react";
+import { GlobalState } from '../../globalState';
+import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { faCircle, faRing, faCube, faHockeyPuck } from '@fortawesome/free-solid-svg-icons';
+import { PreviewMeshType } from './previewMeshType';
+import { DataStorage } from '../../dataStorage';
+
+interface IPreviewMeshControlComponent {
+    globalState: GlobalState;
+}
+
+export class PreviewMeshControlComponent extends React.Component<IPreviewMeshControlComponent> {
+
+    changeMeshType(newOne: PreviewMeshType) {
+        if (this.props.globalState.previewMeshType === newOne) {
+            return;
+        }
+
+        this.props.globalState.previewMeshType = newOne;
+        this.props.globalState.onPreviewMeshTypeChanged.notifyObservers();
+
+        DataStorage.StoreNumber("PreviewMeshType", newOne);
+
+        this.forceUpdate();
+    }
+
+    render() {
+        return (
+            <div id="preview-mesh-bar">
+                <div onClick={() => this.changeMeshType(PreviewMeshType.Box)} className={"button" + (this.props.globalState.previewMeshType === PreviewMeshType.Box ? " selected" : "")}>
+                    <FontAwesomeIcon icon={faCube} />
+                </div>
+                <div onClick={() => this.changeMeshType(PreviewMeshType.Sphere)} className={"button" + (this.props.globalState.previewMeshType === PreviewMeshType.Sphere ? " selected" : "")}>
+                    <FontAwesomeIcon icon={faCircle} />
+                </div>
+                <div onClick={() => this.changeMeshType(PreviewMeshType.Torus)} className={"button" + (this.props.globalState.previewMeshType === PreviewMeshType.Torus ? " selected" : "")}>
+                    <FontAwesomeIcon icon={faRing} />
+                </div>
+                <div onClick={() => this.changeMeshType(PreviewMeshType.Cylinder)} className={"button" + (this.props.globalState.previewMeshType === PreviewMeshType.Cylinder ? " selected" : "")}>
+                    <FontAwesomeIcon icon={faHockeyPuck} />
+                </div>
+            </div>
+        );
+
+    }
+}

+ 6 - 0
nodeEditor/src/components/preview/previewMeshType.ts

@@ -0,0 +1,6 @@
+export enum PreviewMeshType {
+    Sphere,
+    Box, 
+    Torus,
+    Cylinder
+}

+ 38 - 4
nodeEditor/src/components/propertyTab/propertyTabComponent.tsx

@@ -8,6 +8,7 @@ import { LineContainerComponent } from '../../sharedComponents/lineContainerComp
 import { StringTools } from '../../stringTools';
 import { FileButtonLineComponent } from '../../sharedComponents/fileButtonLineComponent';
 import { Tools } from 'babylonjs/Misc/tools';
+import { INodeLocationInfo } from '../../nodeLocationInfo';
 require("./propertyTab.scss");
 
 interface IPropertyTabComponentProps {
@@ -34,11 +35,45 @@ export class PropertyTabComponent extends React.Component<IPropertyTabComponentP
             let serializationObject = JSON.parse(decoder.decode(data));
 
             this.props.globalState.nodeMaterial!.loadFromSerialization(serializationObject, "");
+
+            // Check for id mapping
+            if (serializationObject.locations && serializationObject.map) {
+                let map: {[key: number]: number} = serializationObject.map;
+                let locations: INodeLocationInfo[] = serializationObject.locations;
+
+                for (var location of locations) {
+                    location.blockId = map[location.blockId];
+                }
+            }
             
-            this.props.globalState.onResetRequiredObservable.notifyObservers();
+            this.props.globalState.onResetRequiredObservable.notifyObservers(serializationObject.locations);
         }, undefined, true);
     }
 
+    save() {
+        let material = this.props.globalState.nodeMaterial;
+        let serializationObject = material.serialize();
+
+        // Store node locations
+        for (var block of material.attachedBlocks) {
+            let node = this.props.globalState.onGetNodeFromBlock(block);
+
+            if (!serializationObject.locations) {
+                serializationObject.locations = [];
+            }
+
+            serializationObject.locations.push({
+                blockId: block.uniqueId,
+                x: node.x,
+                y: node.y
+            });
+        }
+
+        // Output
+        let json = JSON.stringify(serializationObject, undefined, 2);
+        StringTools.DownloadAsFile(json, "nodeMaterial.json");
+    }
+
     render() {
         if (this.state.currentNode) {
             return (
@@ -66,7 +101,7 @@ export class PropertyTabComponent extends React.Component<IPropertyTabComponentP
                     <LineContainerComponent title="GENERAL">
                         <ButtonLineComponent label="Reset to default" onClick={() => {
                             this.props.globalState.nodeMaterial!.setToDefault();
-                            this.props.globalState.onResetRequiredObservable.notifyObservers();
+                            this.props.globalState.onResetRequiredObservable.notifyObservers(null);
                         }} />
                     </LineContainerComponent>
                     <LineContainerComponent title="UI">
@@ -80,8 +115,7 @@ export class PropertyTabComponent extends React.Component<IPropertyTabComponentP
                     <LineContainerComponent title="FILE">                        
                         <FileButtonLineComponent label="Load" onClick={(file) => this.load(file)} accept=".json" />
                         <ButtonLineComponent label="Save" onClick={() => {
-                            let json = JSON.stringify(this.props.globalState.nodeMaterial!.serialize(), undefined, 2);
-                            StringTools.DownloadAsFile(json, "nodeMaterial.json");
+                            this.save();
                         }} />
                         <ButtonLineComponent label="Export shaders" onClick={() => {
                             StringTools.DownloadAsFile(this.props.globalState.nodeMaterial!.compiledShaders, "shaders.txt");

+ 13 - 1
nodeEditor/src/globalState.ts

@@ -3,6 +3,11 @@ import { Nullable } from "babylonjs/types"
 import { Observable } from 'babylonjs/Misc/observable';
 import { DefaultNodeModel } from './components/diagram/defaultNodeModel';
 import { LogEntry } from './components/log/logComponent';
+import { NodeModel } from 'storm-react-diagrams';
+import { INodeLocationInfo } from './nodeLocationInfo';
+import { NodeMaterialBlock } from 'babylonjs/Materials/Node/nodeMaterialBlock';
+import { PreviewMeshType } from './components/preview/previewMeshType';
+import { DataStorage } from './dataStorage';
 
 export class GlobalState {
     nodeMaterial: NodeMaterial;
@@ -10,10 +15,17 @@ export class GlobalState {
     hostDocument: HTMLDocument;
     onSelectionChangedObservable = new Observable<Nullable<DefaultNodeModel>>();
     onRebuildRequiredObservable = new Observable<void>();
-    onResetRequiredObservable = new Observable<void>();
+    onResetRequiredObservable = new Observable<Nullable<INodeLocationInfo[]>>();
     onUpdateRequiredObservable = new Observable<void>();
     onZoomToFitRequiredObservable = new Observable<void>();
     onReOrganizedRequiredObservable = new Observable<void>();
     onLogRequiredObservable = new Observable<LogEntry>();
     onErrorMessageDialogRequiredObservable = new Observable<string>();
+    onPreviewMeshTypeChanged = new Observable<void>();
+    onGetNodeFromBlock: (block: NodeMaterialBlock) => NodeModel;
+    previewMeshType: PreviewMeshType;
+
+    public constructor() {
+        this.previewMeshType = DataStorage.ReadNumber("PreviewMeshType", PreviewMeshType.Box);
+    }
 }

+ 40 - 18
nodeEditor/src/graphEditor.tsx

@@ -37,7 +37,9 @@ import { RemapNodeFactory } from './components/diagram/remap/remapNodeFactory';
 import { RemapNodeModel } from './components/diagram/remap/remapNodeModel';
 import { RemapBlock } from 'babylonjs/Materials/Node/Blocks/remapBlock';
 import { GraphHelper } from './graphHelper';
-import { PreviewManager } from './previewManager';
+import { PreviewManager } from './components/preview/previewManager';
+import { INodeLocationInfo } from './nodeLocationInfo';
+import { PreviewMeshControlComponent } from './components/preview/previewMeshControlComponent';
 
 require("storm-react-diagrams/dist/style.min.css");
 require("./main.scss");
@@ -164,8 +166,8 @@ export class GraphEditor extends React.Component<IGraphEditorProps> {
             this.forceUpdate();
         });
 
-        this.props.globalState.onResetRequiredObservable.add(() => {
-            this.build();
+        this.props.globalState.onResetRequiredObservable.add((locations) => {
+            this.build(false, locations);
             if (this.props.globalState.nodeMaterial) {
                 this.buildMaterial();
             }
@@ -181,7 +183,11 @@ export class GraphEditor extends React.Component<IGraphEditorProps> {
 
         this.props.globalState.onReOrganizedRequiredObservable.add(() => {
             this.reOrganize();
-        })
+        });
+
+        this.props.globalState.onGetNodeFromBlock = (block) => {
+            return this._nodes.filter(n => n.block === block)[0];
+        }
 
         this.build(true);
     }
@@ -212,7 +218,7 @@ export class GraphEditor extends React.Component<IGraphEditorProps> {
         }
 
         try {
-            this.props.globalState.nodeMaterial.build(true);
+            this.props.globalState.nodeMaterial.build();
             this.props.globalState.onLogRequiredObservable.notifyObservers(new LogEntry("Node material build successful", false));
         }
         catch (err) {
@@ -220,9 +226,11 @@ export class GraphEditor extends React.Component<IGraphEditorProps> {
         }
     }
 
-    build(needToWait = false) {
+    build(needToWait = false, locations: Nullable<INodeLocationInfo[]> = null) {
         // setup the diagram model
         this._model = new DiagramModel();
+        this._nodes = [];
+        this._blocks = [];
 
         // Listen to events
         this._model.addListener({
@@ -357,23 +365,35 @@ export class GraphEditor extends React.Component<IGraphEditorProps> {
 
             this.forceUpdate();
 
-            this.reOrganize();
+            this.reOrganize(locations);
         }, needToWait ? 500 : 1);
     }
 
-    reOrganize() {
-        let nodes = GraphHelper.DistributeGraph(this._model);
-        nodes.forEach(node => {
-            for (var nodeName in this._model.nodes) {
-                let modelNode = this._model.nodes[nodeName];
+    reOrganize(locations: Nullable<INodeLocationInfo[]> = null) {
+        if (!locations) {
+            let nodes = GraphHelper.DistributeGraph(this._model);
+            nodes.forEach(node => {
+                for (var nodeName in this._model.nodes) {
+                    let modelNode = this._model.nodes[nodeName];
 
-                if (modelNode.id === node.id) {
-                    modelNode.setPosition(node.x - node.width / 2, node.y - node.height / 2);
-                    return;
+                    if (modelNode.id === node.id) {
+                        modelNode.setPosition(node.x - node.width / 2, node.y - node.height / 2);
+                        return;
+                    }
+                }
+            });
+        } else {
+            for (var location of locations) {
+                for (var node of this._nodes) {
+                    if (node.block && node.block.uniqueId === location.blockId) {
+                        node.setPosition(location.x, location.y);
+                        break;
+                    }
                 }
             }
-        });
-        this.forceUpdate();
+        }
+
+        this._engine.repaintCanvas();
     }
 
     onPointerDown(evt: React.PointerEvent<HTMLDivElement>) {
@@ -403,6 +423,7 @@ export class GraphEditor extends React.Component<IGraphEditorProps> {
             this._rightWidth -= deltaX;
             this._rightWidth = Math.max(250, Math.min(500, this._rightWidth));
             DataStorage.StoreNumber("RightWidth", this._rightWidth);
+            rootElement.ownerDocument!.getElementById("preview")!.style.height = this._rightWidth + "px";
         }
 
         rootElement.style.gridTemplateColumns = this.buildColumnLayout();
@@ -481,7 +502,8 @@ export class GraphEditor extends React.Component<IGraphEditorProps> {
                     {/* Property tab */}
                     <div className="right-panel">
                         <PropertyTabComponent globalState={this.props.globalState} />
-                        <div id="preview">
+                        <PreviewMeshControlComponent globalState={this.props.globalState} />
+                        <div id="preview" style={{height: this._rightWidth + "px"}}>
                             <canvas id="preview-canvas"/>
                         </div>
                     </div>

+ 34 - 4
nodeEditor/src/main.scss

@@ -41,7 +41,7 @@
     grid-row: 1 / span 2;
     grid-column: 5;
     display: grid;
-    grid-template-rows: 1fr auto;
+    grid-template-rows: 1fr 30px auto;
     grid-template-columns: 100%;
 
     #propertyTab {
@@ -49,17 +49,47 @@
         grid-column: 1;
     }
 
+    #preview-mesh-bar {
+        grid-row: 2;
+        grid-column: 1;
+        display: flex;
+        color: white;
+        align-items: center;
+        font-size: 18px;
+
+        .button {
+            display: grid;
+            justify-content: center;
+            align-content: center;
+            height: 30px;
+            width: calc(100% / 4);
+            cursor: pointer;
+
+            &:hover {
+                background: rgb(51, 122, 183);
+                color: white;
+                opacity: 0.8;
+            }
+
+            &.selected {
+                background: rgb(51, 122, 183);
+                color: white;
+            }
+        }        
+    }
+    
     #preview {
         border-top: 1px solid rgb(85, 85, 85);
-        grid-row: 2;
+        grid-row: 3;
         grid-column: 1;
         width: 100%;
-        padding-top: 100%;
         display: grid;
-        
+        outline: 0 !important;
+
         #preview-canvas {
             width: 100%;
             height: 100%;
+            outline: 0 !important;
         }
     }
 }

+ 5 - 0
nodeEditor/src/nodeLocationInfo.ts

@@ -0,0 +1,5 @@
+export interface INodeLocationInfo {
+    blockId: number;
+    x: number;
+    y: number;
+}

+ 0 - 54
nodeEditor/src/previewManager.ts

@@ -1,54 +0,0 @@
-import { GlobalState } from './globalState';
-import { NodeMaterial } from 'babylonjs/Materials/Node/nodeMaterial';
-import { Nullable } from 'babylonjs/types';
-import { Observer } from 'babylonjs/Misc/observable';
-import { Engine } from 'babylonjs/Engines/engine';
-import { Scene } from 'babylonjs/scene';
-import { Mesh } from 'babylonjs/Meshes/mesh';
-import { Vector3 } from 'babylonjs/Maths/math.vector';
-import { HemisphericLight } from 'babylonjs/Lights/hemisphericLight';
-import { ArcRotateCamera } from 'babylonjs/Cameras/arcRotateCamera';
-
-export class PreviewManager {
-    private _nodeMaterial: NodeMaterial;
-    private _onBuildObserver: Nullable<Observer<NodeMaterial>>;
-    private _engine: Engine;
-    private _scene: Scene;
-    private _light: HemisphericLight;
-    private _dummySphere: Mesh;
-    private _camera: ArcRotateCamera;
-
-    public constructor(targetCanvas: HTMLCanvasElement, globalState: GlobalState) {
-        this._nodeMaterial = globalState.nodeMaterial;
-
-        this._onBuildObserver = this._nodeMaterial.onBuildObservable.add(() => {
-            this._updatePreview();
-        });
-
-        this._engine = new Engine(targetCanvas, true);
-        this._scene = new Scene(this._engine);
-        this._camera = new ArcRotateCamera("Camera", 0, 0.8, 4, Vector3.Zero(), this._scene);
-        this._light = new HemisphericLight("light", new Vector3(0, 1, 0), this._scene);
-
-        this._dummySphere = Mesh.CreateSphere("sphere", 32, 2, this._scene);
-
-       // this._camera.attachControl(targetCanvas, false);
-
-        this._engine.runRenderLoop(() => {
-            this._scene.render();
-        })
-    }
-
-    private _updatePreview() {
-        
-    }
-
-    public dispose() {
-        this._nodeMaterial.onBuildObservable.remove(this._onBuildObserver);
-
-        this._camera.dispose();
-        this._dummySphere.dispose();
-        this._light.dispose();
-        this._engine.dispose();
-    }
-}

+ 5 - 5
package.json

@@ -7,7 +7,7 @@
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "4.1.0-alpha.11",
+    "version": "4.1.0-alpha.13",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -41,12 +41,12 @@
         "@fortawesome/free-solid-svg-icons": "~5.4.1",
         "@fortawesome/react-fontawesome": "~0.1.3",
         "@types/chai": "^4.1.0",
+        "@types/dagre": "^0.7.42",
         "@types/mocha": "2.2.46",
         "@types/node": "^10.5.3",
         "@types/react": "~16.7.3",
         "@types/react-dom": "~16.0.9",
         "@types/sinon": "^4.1.3",
-        "@types/dagre": "^0.7.42",
         "ajv": "^6.9.1",
         "awesome-typescript-loader": "^5.2.1",
         "base64-font-loader": "0.0.4",
@@ -54,6 +54,7 @@
         "clean-webpack-plugin": "^0.1.19",
         "color-support": "^1.1.3",
         "css-loader": "^1.0.0",
+        "dagre": "0.8.4",
         "del": "3.0.0",
         "dependency-cruiser": "^4.19.0",
         "dts-bundle": "^0.7.3",
@@ -72,7 +73,7 @@
         "karma-browserstack-launcher": "^1.4.0",
         "karma-chai": "^0.1.0",
         "karma-chrome-launcher": "^2.2.0",
-        "karma-firefox-launcher": "^1.1.0",
+        "karma-firefox-launcher": "github:karma-runner/karma-firefox-launcher#master",
         "karma-mocha": "^1.3.0",
         "karma-sinon": "^1.0.5",
         "merge2": "~1.2.2",
@@ -91,13 +92,12 @@
         "sinon": "^6.1.4",
         "split.js": "^1.5.9",
         "storm-react-diagrams": "^5.2.1",
-        "dagre": "0.8.4",
         "style-loader": "^0.21.0",
         "through2": "~2.0.3",
         "ts-loader": "^5.2.1",
         "tslib": "^1.9.3",
         "tslint": "^5.11.0",
-        "typedoc": "^0.14.2",
+        "typedoc": "^0.15.0",
         "typescript": "~3.5.1",
         "webpack": "^4.29.3",
         "webpack-bundle-analyzer": "^3.1.0",

+ 2 - 0
src/Audio/audioSceneComponent.ts

@@ -9,6 +9,8 @@ import { Scene } from "../scene";
 import { AbstractScene } from "../abstractScene";
 import { AssetContainer } from "../assetContainer";
 
+import "./audioEngine";
+
 // Adds the parser to the scene parsers.
 AbstractScene.AddParser(SceneComponentConstants.NAME_AUDIO, (parsedData: any, scene: Scene, container: AssetContainer, rootUrl: string) => {
     // TODO: add sound

+ 2 - 2
src/Cameras/Inputs/BaseCameraPointersInput.ts

@@ -228,7 +228,7 @@ export abstract class BaseCameraPointersInput implements ICameraInput<Camera> {
         element.addEventListener("contextmenu",
             <EventListener>this.onContextMenu.bind(this), false);
 
-        Tools.RegisterTopRootEvents([
+        Tools.RegisterTopRootEvents(this.camera.getScene().getEngine().getHostWindow(), [
             { name: "blur", handler: this._onLostFocus }
         ]);
     }
@@ -239,7 +239,7 @@ export abstract class BaseCameraPointersInput implements ICameraInput<Camera> {
      */
     public detachControl(element: Nullable<HTMLElement>): void {
         if (this._onLostFocus) {
-            Tools.UnregisterTopRootEvents([
+            Tools.UnregisterTopRootEvents(this.camera.getScene().getEngine().getHostWindow(), [
                 { name: "blur", handler: this._onLostFocus }
             ]);
         }

+ 4 - 1
src/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.ts

@@ -63,7 +63,10 @@ export class ArcRotateCameraVRDeviceOrientationInput implements ICameraInput<Arc
      */
     public attachControl(element: HTMLElement, noPreventDefault?: boolean): void {
         this.camera.attachControl(element, noPreventDefault);
-        window.addEventListener("deviceorientation", this._deviceOrientationHandler);
+
+        let hostWindow = this.camera.getScene().getEngine().getHostWindow();
+
+        hostWindow.addEventListener("deviceorientation", this._deviceOrientationHandler);
     }
 
     /** @hidden */

+ 6 - 2
src/Cameras/Inputs/freeCameraDeviceOrientationInput.ts

@@ -117,8 +117,12 @@ export class FreeCameraDeviceOrientationInput implements ICameraInput<FreeCamera
      * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
      */
     public attachControl(element: HTMLElement, noPreventDefault?: boolean): void {
-        window.addEventListener("orientationchange", this._orientationChanged);
-        window.addEventListener("deviceorientation", this._deviceOrientation);
+
+        let hostWindow = this.camera.getScene().getEngine().getHostWindow();
+
+        hostWindow.addEventListener("orientationchange", this._orientationChanged);
+        hostWindow.addEventListener("deviceorientation", this._deviceOrientation);
+
         //In certain cases, the attach control is called AFTER orientation was changed,
         //So this is needed.
         this._orientationChanged();

+ 5 - 2
src/Cameras/VR/vrExperienceHelper.ts

@@ -771,7 +771,10 @@ export class VRExperienceHelper {
         }
 
         // Window events
-        window.addEventListener("resize", this._onResize);
+
+        let hostWindow = this._scene.getEngine().getHostWindow();
+
+        hostWindow.addEventListener("resize", this._onResize);
         document.addEventListener("fullscreenchange", this._onFullscreenChange, false);
         document.addEventListener("mozfullscreenchange", this._onFullscreenChange, false);
         document.addEventListener("webkitfullscreenchange", this._onFullscreenChange, false);
@@ -821,7 +824,7 @@ export class VRExperienceHelper {
         scene.getEngine().onVRDisplayChangedObservable.add(this._onVRDisplayChanged);
         scene.getEngine().onVRRequestPresentStart.add(this._onVRRequestPresentStart);
         scene.getEngine().onVRRequestPresentComplete.add(this._onVRRequestPresentComplete);
-        window.addEventListener('vrdisplaypresentchange', this._onVrDisplayPresentChange);
+        hostWindow.addEventListener('vrdisplaypresentchange', this._onVrDisplayPresentChange);
 
         scene.onDisposeObservable.add(() => {
             this.dispose();

+ 3 - 1
src/Cameras/VR/webVRCamera.ts

@@ -508,7 +508,9 @@ export class WebVRFreeCamera extends FreeCamera implements PoseControlled {
         if (this._vrDevice) {
             this.getEngine().enableVR();
         }
-        window.addEventListener('vrdisplaypresentchange', this._detachIfAttached);
+
+        let hostWindow = this._scene.getEngine().getHostWindow();
+        hostWindow.addEventListener('vrdisplaypresentchange', this._detachIfAttached);
     }
 
     /**

+ 10 - 3
src/Cameras/deviceOrientationCamera.ts

@@ -20,6 +20,7 @@ export class DeviceOrientationCamera extends FreeCamera {
     private _initialQuaternion: Quaternion;
     private _quaternionCache: Quaternion;
     private _tmpDragQuaternion = new Quaternion();
+    private _disablePointerInputWhenUsingDeviceOrientation = true;
 
     /**
      * Creates a new device orientation camera
@@ -55,10 +56,16 @@ export class DeviceOrientationCamera extends FreeCamera {
     }
 
     /**
-     * @hidden
-     * Disabled pointer input on first orientation sensor update (Default: true)
+     * Gets or sets a boolean indicating that pointer input must be disabled on first orientation sensor update (Default: true)
      */
-    public _disablePointerInputWhenUsingDeviceOrientation = true;
+    public get disablePointerInputWhenUsingDeviceOrientation() {
+        return this._disablePointerInputWhenUsingDeviceOrientation;
+    }
+
+    public set disablePointerInputWhenUsingDeviceOrientation(value: boolean) {
+        this._disablePointerInputWhenUsingDeviceOrientation = value;
+    }
+
     private _dragFactor = 0;
     /**
      * Enabled turning on the y axis when the orientation sensor is active

+ 1 - 1
src/Engines/Extensions/engine.multiRender.ts

@@ -261,7 +261,7 @@ Engine.prototype.updateMultipleRenderTargetTextureSampleCount = function(texture
 
     var gl = this._gl;
 
-    samples = Math.min(samples, gl.getParameter(gl.MAX_SAMPLES));
+    samples = Math.min(samples, this.getCaps().maxMSAASamples);
 
     // Dispose previous render buffers
     if (textures[0]._depthStencilBuffer) {

+ 0 - 0
src/Engines/Extensions/engine.webVR.ts


Some files were not shown because too many files changed in this diff