Sfoglia il codice sorgente

Merge branch 'master' into useControllerWhileMeshLoading

Trevor Baron 7 anni fa
parent
commit
09b33ac032
65 ha cambiato i file con 38267 aggiunte e 36888 eliminazioni
  1. 10254 10227
      Playground/babylon.d.txt
  2. 2 0
      Tools/Gulp/config.json
  3. 19 22
      Tools/Gulp/gulp-addModuleExports.js
  4. 5 5
      Tools/Gulp/readme.md
  5. 16961 16854
      dist/preview release/babylon.d.ts
  6. 56 56
      dist/preview release/babylon.js
  7. 227 30
      dist/preview release/babylon.max.js
  8. 57 57
      dist/preview release/babylon.worker.js
  9. 9201 9094
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  10. 59 59
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  11. 230 32
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  12. 215 17
      dist/preview release/customConfigurations/minimalGLTFViewer/es6.js
  13. 212 15
      dist/preview release/es6.js
  14. 1 1
      dist/preview release/gltf2Interface/package.json
  15. 12 5
      dist/preview release/gui/babylon.gui.d.ts
  16. 68 35
      dist/preview release/gui/babylon.gui.js
  17. 4 3
      dist/preview release/gui/babylon.gui.min.js
  18. 12 5
      dist/preview release/gui/babylon.gui.module.d.ts
  19. 1 1
      dist/preview release/gui/package.json
  20. 4 4
      dist/preview release/inspector/babylon.inspector.bundle.js
  21. 1 1
      dist/preview release/inspector/package.json
  22. 3 2
      dist/preview release/loaders/babylon.glTF2FileLoader.js
  23. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  24. 3 2
      dist/preview release/loaders/babylon.glTFFileLoader.js
  25. 2 2
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  26. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  27. 17 20
      dist/preview release/loaders/babylonjs.loaders.js
  28. 3 3
      dist/preview release/loaders/babylonjs.loaders.min.js
  29. 2 2
      dist/preview release/loaders/package.json
  30. 14 18
      dist/preview release/materialsLibrary/babylonjs.materials.js
  31. 7 7
      dist/preview release/materialsLibrary/babylonjs.materials.min.js
  32. 1 1
      dist/preview release/materialsLibrary/package.json
  33. 14 18
      dist/preview release/postProcessesLibrary/babylonjs.postProcess.js
  34. 1 1
      dist/preview release/postProcessesLibrary/babylonjs.postProcess.min.js
  35. 1 1
      dist/preview release/postProcessesLibrary/package.json
  36. 14 18
      dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.js
  37. 1 1
      dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js
  38. 1 1
      dist/preview release/proceduralTexturesLibrary/package.json
  39. 3 0
      dist/preview release/serializers/babylon.glTF2Serializer.js
  40. 1 1
      dist/preview release/serializers/babylon.glTF2Serializer.min.js
  41. 17 18
      dist/preview release/serializers/babylonjs.serializers.js
  42. 1 1
      dist/preview release/serializers/babylonjs.serializers.min.js
  43. 2 2
      dist/preview release/serializers/package.json
  44. 7 84
      dist/preview release/typedocValidationBaseline.json
  45. 69 69
      dist/preview release/viewer/babylon.viewer.js
  46. 246 50
      dist/preview release/viewer/babylon.viewer.max.js
  47. 1 1
      dist/preview release/viewer/package.json
  48. 4 1
      dist/preview release/what's new.md
  49. 15 0
      gui/src/advancedDynamicTexture.ts
  50. 2 2
      gui/src/controls/button.ts
  51. 2 2
      gui/src/controls/colorpicker.ts
  52. 17 6
      gui/src/controls/control.ts
  53. 2 2
      gui/src/controls/inputText.ts
  54. 2 2
      gui/src/controls/slider.ts
  55. 17 3
      gui/src/valueAndUnit.ts
  56. 1 1
      package.json
  57. 3 0
      serializers/src/glTF/2.0/babylon.glTFMaterial.ts
  58. 3 3
      src/Collisions/babylon.collisionCoordinator.ts
  59. 6 3
      src/Collisions/babylon.collisionWorker.ts
  60. 1 1
      src/Engine/babylon.engine.ts
  61. 62 3
      src/PostProcess/RenderPipeline/Pipelines/babylon.defaultRenderingPipeline.ts
  62. 36 3
      src/PostProcess/babylon.convolutionPostProcess.ts
  63. 34 0
      src/PostProcess/babylon.sharpenPostProcess.ts
  64. 18 0
      src/Shaders/sharpen.fragment.fx
  65. 8 8
      src/babylon.scene.ts

File diff suppressed because it is too large
+ 10254 - 10227
Playground/babylon.d.txt


+ 2 - 0
Tools/Gulp/config.json

@@ -823,6 +823,7 @@
                 "../../src/PostProcess/babylon.refractionPostProcess.js",
                 "../../src/PostProcess/babylon.blackAndWhitePostProcess.js",
                 "../../src/PostProcess/babylon.convolutionPostProcess.js",
+                "../../src/PostProcess/babylon.sharpenPostProcess.js",
                 "../../src/PostProcess/babylon.filterPostProcess.js",
                 "../../src/PostProcess/babylon.fxaaPostProcess.js",
                 "../../src/PostProcess/babylon.volumetricLightScatteringPostProcess.js",
@@ -839,6 +840,7 @@
                 "refraction.fragment",
                 "blackAndWhite.fragment",
                 "convolution.fragment",
+                "sharpen.fragment",
                 "filter.fragment",
                 "fxaa.fragment",
                 "volumetricLightScattering.fragment",

+ 19 - 22
Tools/Gulp/gulp-addModuleExports.js

@@ -10,41 +10,38 @@ module.exports = function (varName, subModule, extendsRoot, externalUsingBabylon
 
         if (typeof varName === 'string') {
             varName = {
-                base: varName,
+                name: varName,
                 module: varName
             }
+            if (varName.name === 'BABYLON') {
+                varName.module = 'babylonjs';
+            }
         }
 
-        var optionalRequire = `var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
+        var optionalRequire = ''; /* `var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
 var babylonDependency = (globalObject && globalObject.BABYLON) || BABYLON || (typeof require !== 'undefined' && require("babylonjs"));
 var BABYLON = babylonDependency;
-`;
+`;*/
         function moduleExportAddition(varName) {
 
-            let base = subModule ? 'BABYLON' : varName.base;
-
-            let basicInit = `root["${base}"]${(subModule && !extendsRoot) ? '["' + varName + '"]' : ''} = f;`;
-            let sadGlobalPolution = (!subModule) ? `var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
-globalObject["${base}"] = f;` : '';
-            /*if (extendsRoot) {
-                basicInit = `__extends(root["BABYLON"], factory()); `
-            }*/
+            let base = subModule ? 'BABYLON' : varName.name;
 
             return `\n\n(function universalModuleDefinition(root, factory) {
-                var f = factory();
-                
-                ${sadGlobalPolution}
     if(typeof exports === 'object' && typeof module === 'object')
-        module.exports = f;
+        module.exports = factory(${subModule || extendsRoot ? 'require("babylonjs")' : ''});
     else if(typeof define === 'function' && define.amd)
-        define("${varName.module}", ${subModule || extendsRoot ? '["BABYLON"],' : ''} factory);
+        define("${varName.module}", ${subModule || extendsRoot ? '["babylonjs"],' : ''} factory);
     else if(typeof exports === 'object')
-        exports["${varName.module}"] = f;
+        exports["${varName.module}"] = factory(${subModule || extendsRoot ? 'require("babylonjs")' : ''});
     else {
-        ${basicInit}
+        root["${base}"]${(subModule && !extendsRoot) ? '["' + varName.name + '"]' : ''} = factory(root["BABYLON"]);
     }
-})(this, function() {
-    return ${base}${(subModule && !extendsRoot) ? '.' + varName.base : ''};
+})(this, function(BABYLON) {
+    ${String(file.contents)}
+    ${varName.name === 'BABYLON' ? `
+var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
+globalObject["${varName.name}"] = BABYLON` : ''}
+    return ${base}${(subModule && !extendsRoot) ? '.' + varName.name : ''};
 });
 `;
         }
@@ -86,10 +83,10 @@ globalObject["${base}"] = f;` : '';
 
         try {
             if (externalUsingBabylon) {
-                file.contents = new Buffer(optionalRequire.concat(new Buffer(String(file.contents).concat(moduleExportAddition(varName)))));
+                file.contents = new Buffer(optionalRequire.concat(new Buffer(String('').concat(moduleExportAddition(varName)))));
             } else {
                 let pretext = subModule ? optionalRequire : '';
-                file.contents = new Buffer(pretext.concat(decorateAddition).concat(new Buffer(extendsAddition.concat(String(file.contents)).concat(moduleExportAddition(varName)))));
+                file.contents = new Buffer(pretext.concat(decorateAddition).concat(new Buffer(extendsAddition.concat(String('')).concat(moduleExportAddition(varName)))));
             }
             this.push(file);
         } catch (err) {

+ 5 - 5
Tools/Gulp/readme.md

@@ -66,11 +66,11 @@ gulp run
 ```
 
 you can now freely test in the following URLs:
-- [Playground]("http://localhost:1338/Playground/index-local.html")
-- [Materials Library]("http://localhost:1338/materialsLibrary/index.html")
-- [Postprocess Library]("http://localhost:1338/postProcessLibrary/index.html")
-- [Procedural Textures Library]("http://localhost:1338/proceduralTexturesLibrary/index.html")
-- [Local Dev Samples]("http://localhost:1338/localDev/index.html")
+- [Playground](http://localhost:1338/Playground/index-local.html)
+- [Materials Library](http://localhost:1338/materialsLibrary/index.html)
+- [Postprocess Library](http://localhost:1338/postProcessLibrary/index.html)
+- [Procedural Textures Library](http://localhost:1338/proceduralTexturesLibrary/index.html)
+- [Local Dev Samples](http://localhost:1338/localDev/index.html)
 
 ### Compile all the typscript files to their javascript respective files including declaration file
 ```

File diff suppressed because it is too large
+ 16961 - 16854
dist/preview release/babylon.d.ts


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


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


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


File diff suppressed because it is too large
+ 9201 - 9094
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


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


File diff suppressed because it is too large
+ 230 - 32
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js


File diff suppressed because it is too large
+ 215 - 17
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js


File diff suppressed because it is too large
+ 212 - 15
dist/preview release/es6.js


+ 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": "3.2.0-alpha10",
+    "version": "3.2.0-alphaA",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 12 - 5
dist/preview release/gui/babylon.gui.d.ts

@@ -32,6 +32,7 @@ declare module BABYLON.GUI {
         private _fullscreenViewport;
         private _idealWidth;
         private _idealHeight;
+        private _useSmallestIdeal;
         private _renderAtIdealSize;
         private _focusedControl;
         private _blockNextFocusCheck;
@@ -40,6 +41,7 @@ declare module BABYLON.GUI {
         background: string;
         idealWidth: number;
         idealHeight: number;
+        useSmallestIdeal: boolean;
         renderAtIdealSize: boolean;
         readonly layer: Nullable<Layer>;
         readonly rootContainer: Container;
@@ -227,6 +229,11 @@ declare module BABYLON.GUI {
         */
         onPointerUpObservable: Observable<Vector2WithInfo>;
         /**
+        * An event triggered when a control is clicked on
+        * @type {BABYLON.Observable}
+        */
+        onPointerClickObservable: Observable<Vector2WithInfo>;
+        /**
         * An event triggered when pointer enters the control
         * @type {BABYLON.Observable}
         */
@@ -311,7 +318,7 @@ declare module BABYLON.GUI {
         _onPointerEnter(target: Control): boolean;
         _onPointerOut(target: Control): void;
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): void;
+        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         forcePointerUp(pointerId?: Nullable<number>): void;
         _processObservables(type: number, x: number, y: number, pointerId: number, buttonIndex: number): boolean;
         private _prepareFont();
@@ -496,7 +503,7 @@ declare module BABYLON.GUI {
         private _updateValueFromPointer(x, y);
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
         _onPointerMove(target: Control, coordinates: Vector2): void;
-        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): void;
+        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
     }
 }
 
@@ -710,7 +717,7 @@ declare module BABYLON.GUI {
         _onPointerEnter(target: Control): boolean;
         _onPointerOut(target: Control): void;
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): void;
+        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         static CreateImageButton(name: string, text: string, imageUrl: string): Button;
         static CreateImageOnlyButton(name: string, imageUrl: string): Button;
         static CreateSimpleButton(name: string, text: string): Button;
@@ -753,7 +760,7 @@ declare module BABYLON.GUI {
         private _isPointOnWheel(coordinates);
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
         _onPointerMove(target: Control, coordinates: Vector2): void;
-        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): void;
+        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
     }
 }
 
@@ -801,7 +808,7 @@ declare module BABYLON.GUI {
         processKeyboard(evt: KeyboardEvent): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): void;
+        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         dispose(): void;
     }
 }

+ 68 - 35
dist/preview release/gui/babylon.gui.js

@@ -1,6 +1,3 @@
-var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
-var babylonDependency = (globalObject && globalObject.BABYLON) || BABYLON || (typeof require !== 'undefined' && require("babylonjs"));
-var BABYLON = babylonDependency;
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -17,7 +14,20 @@ var __extends = (this && this.__extends) || (function () {
                 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
             };
         })();
-        /// <reference path="../../dist/preview release/babylon.d.ts"/>
+        
+
+(function universalModuleDefinition(root, factory) {
+    if(typeof exports === 'object' && typeof module === 'object')
+        module.exports = factory(require("babylonjs"));
+    else if(typeof define === 'function' && define.amd)
+        define("babylonjs-gui", ["babylonjs"], factory);
+    else if(typeof exports === 'object')
+        exports["babylonjs-gui"] = factory(require("babylonjs"));
+    else {
+        root["BABYLON"]["GUI"] = factory(root["BABYLON"]);
+    }
+})(this, function(BABYLON) {
+    /// <reference path="../../dist/preview release/babylon.d.ts"/>
 
 var BABYLON;
 (function (BABYLON) {
@@ -41,6 +51,7 @@ var BABYLON;
                 _this._fullscreenViewport = new BABYLON.Viewport(0, 0, 1, 1);
                 _this._idealWidth = 0;
                 _this._idealHeight = 0;
+                _this._useSmallestIdeal = false;
                 _this._renderAtIdealSize = false;
                 _this._blockNextFocusCheck = false;
                 _this._renderScale = 1;
@@ -125,6 +136,21 @@ var BABYLON;
                 enumerable: true,
                 configurable: true
             });
+            Object.defineProperty(AdvancedDynamicTexture.prototype, "useSmallestIdeal", {
+                get: function () {
+                    return this._useSmallestIdeal;
+                },
+                set: function (value) {
+                    if (this._useSmallestIdeal === value) {
+                        return;
+                    }
+                    this._useSmallestIdeal = value;
+                    this.markAsDirty();
+                    this._rootContainer._markAllAsDirty();
+                },
+                enumerable: true,
+                configurable: true
+            });
             Object.defineProperty(AdvancedDynamicTexture.prototype, "renderAtIdealSize", {
                 get: function () {
                     return this._renderAtIdealSize;
@@ -739,11 +765,22 @@ var BABYLON;
             };
             ValueAndUnit.prototype.getValue = function (host) {
                 if (host && !this.ignoreAdaptiveScaling && this.unit !== ValueAndUnit.UNITMODE_PERCENTAGE) {
+                    var width = 0;
+                    var height = 0;
                     if (host.idealWidth) {
-                        return (this._value * host.getSize().width) / host.idealWidth;
+                        width = (this._value * host.getSize().width) / host.idealWidth;
                     }
                     if (host.idealHeight) {
-                        return (this._value * host.getSize().height) / host.idealHeight;
+                        height = (this._value * host.getSize().height) / host.idealHeight;
+                    }
+                    if (host.useSmallestIdeal && host.idealWidth && host.idealHeight) {
+                        return window.innerWidth < window.innerHeight ? width : height;
+                    }
+                    if (host.idealWidth) {
+                        return width;
+                    }
+                    if (host.idealHeight) {
+                        return height;
                     }
                 }
                 return this._value;
@@ -889,6 +926,11 @@ var BABYLON;
                 */
                 this.onPointerUpObservable = new BABYLON.Observable();
                 /**
+                * An event triggered when a control is clicked on
+                * @type {BABYLON.Observable}
+                */
+                this.onPointerClickObservable = new BABYLON.Observable();
+                /**
                 * An event triggered when pointer enters the control
                 * @type {BABYLON.Observable}
                 */
@@ -1706,21 +1748,25 @@ var BABYLON;
                     this.parent._onPointerDown(target, coordinates, pointerId, buttonIndex);
                 return true;
             };
-            Control.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex) {
+            Control.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick) {
                 this._downCount = 0;
                 delete this._downPointerIds[pointerId];
+                var canNotifyClick = notifyClick;
+                if (notifyClick && this._enterCount > 0) {
+                    canNotifyClick = this.onPointerClickObservable.notifyObservers(new GUI.Vector2WithInfo(coordinates, buttonIndex), -1, target, this);
+                }
                 var canNotify = this.onPointerUpObservable.notifyObservers(new GUI.Vector2WithInfo(coordinates, buttonIndex), -1, target, this);
                 if (canNotify && this.parent != null)
-                    this.parent._onPointerUp(target, coordinates, pointerId, buttonIndex);
+                    this.parent._onPointerUp(target, coordinates, pointerId, buttonIndex, canNotifyClick);
             };
             Control.prototype.forcePointerUp = function (pointerId) {
                 if (pointerId === void 0) { pointerId = null; }
                 if (pointerId !== null) {
-                    this._onPointerUp(this, BABYLON.Vector2.Zero(), pointerId, 0);
+                    this._onPointerUp(this, BABYLON.Vector2.Zero(), pointerId, 0, true);
                 }
                 else {
                     for (var key in this._downPointerIds) {
-                        this._onPointerUp(this, BABYLON.Vector2.Zero(), +key, 0);
+                        this._onPointerUp(this, BABYLON.Vector2.Zero(), +key, 0, true);
                     }
                 }
             };
@@ -1746,7 +1792,7 @@ var BABYLON;
                 }
                 if (type === BABYLON.PointerEventTypes.POINTERUP) {
                     if (this._host._lastControlDown[pointerId]) {
-                        this._host._lastControlDown[pointerId]._onPointerUp(this, this._dummyVector2, pointerId, buttonIndex);
+                        this._host._lastControlDown[pointerId]._onPointerUp(this, this._dummyVector2, pointerId, buttonIndex, true);
                     }
                     delete this._host._lastControlDown[pointerId];
                     return true;
@@ -1768,6 +1814,7 @@ var BABYLON;
                 this.onPointerMoveObservable.clear();
                 this.onPointerOutObservable.clear();
                 this.onPointerUpObservable.clear();
+                this.onPointerClickObservable.clear();
                 if (this._root) {
                     this._root.removeControl(this);
                     this._root = null;
@@ -2963,10 +3010,10 @@ var BABYLON;
                 }
                 _super.prototype._onPointerMove.call(this, target, coordinates);
             };
-            Slider.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex) {
+            Slider.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick) {
                 this._pointerIsDown = false;
                 delete this._host._capturingControl[pointerId];
-                _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex);
+                _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex, notifyClick);
             };
             return Slider;
         }(GUI.Control));
@@ -3978,11 +4025,11 @@ var BABYLON;
                 }
                 return true;
             };
-            Button.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex) {
+            Button.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick) {
                 if (this.pointerUpAnimation) {
                     this.pointerUpAnimation();
                 }
-                _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex);
+                _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex, notifyClick);
             };
             // Statics
             Button.CreateImageButton = function (name, text, imageUrl) {
@@ -4387,10 +4434,10 @@ var BABYLON;
                 }
                 _super.prototype._onPointerMove.call(this, target, coordinates);
             };
-            ColorPicker.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex) {
+            ColorPicker.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick) {
                 this._pointerIsDown = false;
                 delete this._host._capturingControl[pointerId];
-                _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex);
+                _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex, notifyClick);
             };
             return ColorPicker;
         }(GUI.Control));
@@ -4826,8 +4873,8 @@ var BABYLON;
                 this._host.focusedControl = this;
                 return true;
             };
-            InputText.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex) {
-                _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex);
+            InputText.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick) {
+                _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex, notifyClick);
             };
             InputText.prototype.dispose = function () {
                 _super.prototype.dispose.call(this);
@@ -5002,20 +5049,6 @@ var BABYLON;
     })(GUI = BABYLON.GUI || (BABYLON.GUI = {}));
 })(BABYLON || (BABYLON = {}));
 
-
-(function universalModuleDefinition(root, factory) {
-                var f = factory();
-                
-                
-    if(typeof exports === 'object' && typeof module === 'object')
-        module.exports = f;
-    else if(typeof define === 'function' && define.amd)
-        define("babylonjs-gui", ["BABYLON"], factory);
-    else if(typeof exports === 'object')
-        exports["babylonjs-gui"] = f;
-    else {
-        root["BABYLON"]["[object Object]"] = f;
-    }
-})(this, function() {
-    return BABYLON.undefined;
+    
+    return BABYLON.GUI;
 });

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


+ 12 - 5
dist/preview release/gui/babylon.gui.module.d.ts

@@ -38,6 +38,7 @@ declare module BABYLON.GUI {
         private _fullscreenViewport;
         private _idealWidth;
         private _idealHeight;
+        private _useSmallestIdeal;
         private _renderAtIdealSize;
         private _focusedControl;
         private _blockNextFocusCheck;
@@ -46,6 +47,7 @@ declare module BABYLON.GUI {
         background: string;
         idealWidth: number;
         idealHeight: number;
+        useSmallestIdeal: boolean;
         renderAtIdealSize: boolean;
         readonly layer: Nullable<Layer>;
         readonly rootContainer: Container;
@@ -233,6 +235,11 @@ declare module BABYLON.GUI {
         */
         onPointerUpObservable: Observable<Vector2WithInfo>;
         /**
+        * An event triggered when a control is clicked on
+        * @type {BABYLON.Observable}
+        */
+        onPointerClickObservable: Observable<Vector2WithInfo>;
+        /**
         * An event triggered when pointer enters the control
         * @type {BABYLON.Observable}
         */
@@ -317,7 +324,7 @@ declare module BABYLON.GUI {
         _onPointerEnter(target: Control): boolean;
         _onPointerOut(target: Control): void;
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): void;
+        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         forcePointerUp(pointerId?: Nullable<number>): void;
         _processObservables(type: number, x: number, y: number, pointerId: number, buttonIndex: number): boolean;
         private _prepareFont();
@@ -502,7 +509,7 @@ declare module BABYLON.GUI {
         private _updateValueFromPointer(x, y);
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
         _onPointerMove(target: Control, coordinates: Vector2): void;
-        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): void;
+        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
     }
 }
 
@@ -716,7 +723,7 @@ declare module BABYLON.GUI {
         _onPointerEnter(target: Control): boolean;
         _onPointerOut(target: Control): void;
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): void;
+        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         static CreateImageButton(name: string, text: string, imageUrl: string): Button;
         static CreateImageOnlyButton(name: string, imageUrl: string): Button;
         static CreateSimpleButton(name: string, text: string): Button;
@@ -759,7 +766,7 @@ declare module BABYLON.GUI {
         private _isPointOnWheel(coordinates);
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
         _onPointerMove(target: Control, coordinates: Vector2): void;
-        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): void;
+        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
     }
 }
 
@@ -807,7 +814,7 @@ declare module BABYLON.GUI {
         processKeyboard(evt: KeyboardEvent): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): void;
+        _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         dispose(): void;
     }
 }

+ 1 - 1
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": "3.2.0-alpha10",
+    "version": "3.2.0-alphaA",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

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


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

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "3.2.0-alpha10",
+    "version": "3.2.0-alphaA",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 3 - 2
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -1074,8 +1074,9 @@ var BABYLON;
                     node._babylonMesh.scaling = BABYLON.Vector3.One();
                 };
                 if (skin._loaded) {
-                    assignSkeleton();
-                    return skin._loaded;
+                    return skin._loaded.then(function () {
+                        assignSkeleton();
+                    });
                 }
                 // TODO: split into two parts so that bones are created before inverseBindMatricesData is loaded (for compiling materials).
                 return (skin._loaded = this._loadSkinInverseBindMatricesDataAsync(context, skin).then(function (inverseBindMatricesData) {

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


+ 3 - 2
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -3250,8 +3250,9 @@ var BABYLON;
                     node._babylonMesh.scaling = BABYLON.Vector3.One();
                 };
                 if (skin._loaded) {
-                    assignSkeleton();
-                    return skin._loaded;
+                    return skin._loaded.then(function () {
+                        assignSkeleton();
+                    });
                 }
                 // TODO: split into two parts so that bones are created before inverseBindMatricesData is loaded (for compiling materials).
                 return (skin._loaded = this._loadSkinInverseBindMatricesDataAsync(context, skin).then(function (inverseBindMatricesData) {

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


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


+ 17 - 20
dist/preview release/loaders/babylonjs.loaders.js

@@ -1,6 +1,3 @@
-var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
-var babylonDependency = (globalObject && globalObject.BABYLON) || BABYLON || (typeof require !== 'undefined' && require("babylonjs"));
-var BABYLON = babylonDependency;
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -18,6 +15,19 @@ var __extends = (this && this.__extends) || (function () {
             };
         })();
         
+
+(function universalModuleDefinition(root, factory) {
+    if(typeof exports === 'object' && typeof module === 'object')
+        module.exports = factory(require("babylonjs"));
+    else if(typeof define === 'function' && define.amd)
+        define("babylonjs-loaders", ["babylonjs"], factory);
+    else if(typeof exports === 'object')
+        exports["babylonjs-loaders"] = factory(require("babylonjs"));
+    else {
+        root["BABYLON"] = factory(root["BABYLON"]);
+    }
+})(this, function(BABYLON) {
+    
 var BABYLON;
 (function (BABYLON) {
     var STLFileLoader = /** @class */ (function () {
@@ -4218,8 +4228,9 @@ var BABYLON;
                     node._babylonMesh.scaling = BABYLON.Vector3.One();
                 };
                 if (skin._loaded) {
-                    assignSkeleton();
-                    return skin._loaded;
+                    return skin._loaded.then(function () {
+                        assignSkeleton();
+                    });
                 }
                 // TODO: split into two parts so that bones are created before inverseBindMatricesData is loaded (for compiling materials).
                 return (skin._loaded = this._loadSkinInverseBindMatricesDataAsync(context, skin).then(function (inverseBindMatricesData) {
@@ -5457,20 +5468,6 @@ var BABYLON;
 
 //# sourceMappingURL=KHR_lights.js.map
 
-
-(function universalModuleDefinition(root, factory) {
-                var f = factory();
-                
-                
-    if(typeof exports === 'object' && typeof module === 'object')
-        module.exports = f;
-    else if(typeof define === 'function' && define.amd)
-        define("babylonjs-loaders", ["BABYLON"], factory);
-    else if(typeof exports === 'object')
-        exports["babylonjs-loaders"] = f;
-    else {
-        root["BABYLON"] = f;
-    }
-})(this, function() {
+    
     return BABYLON;
 });

File diff suppressed because it is too large
+ 3 - 3
dist/preview release/loaders/babylonjs.loaders.min.js


+ 2 - 2
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": "3.2.0-alpha10",
+    "version": "3.2.0-alphaA",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "3.2.0-alpha10"
+        "babylonjs-gltf2interface": "3.2.0-alphaA"
     },
     "peerDependencies": {
         "babylonjs": ">=3.2.0-alpha"

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


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


+ 1 - 1
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": "3.2.0-alpha10",
+    "version": "3.2.0-alphaA",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

File diff suppressed because it is too large
+ 14 - 18
dist/preview release/postProcessesLibrary/babylonjs.postProcess.js


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


+ 1 - 1
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": "3.2.0-alpha10",
+    "version": "3.2.0-alphaA",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

File diff suppressed because it is too large
+ 14 - 18
dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.js


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


+ 1 - 1
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": "3.2.0-alpha10",
+    "version": "3.2.0-alphaA",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 3 - 0
dist/preview release/serializers/babylon.glTF2Serializer.js

@@ -973,6 +973,9 @@ var BABYLON;
                         BABYLON.Tools.Warn(babylonStandardMaterial.name + ": glTF 2.0 does not support alpha mode: " + babylonStandardMaterial.alphaMode.toString());
                     }
                 }
+                if (babylonStandardMaterial.emissiveColor) {
+                    glTFMaterial.emissiveFactor = babylonStandardMaterial.emissiveColor.asArray();
+                }
                 glTFMaterial.pbrMetallicRoughness = glTFPbrMetallicRoughness;
                 materials.push(glTFMaterial);
             };

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


+ 17 - 18
dist/preview release/serializers/babylonjs.serializers.js

@@ -1,6 +1,3 @@
-var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
-var babylonDependency = (globalObject && globalObject.BABYLON) || BABYLON || (typeof require !== 'undefined' && require("babylonjs"));
-var BABYLON = babylonDependency;
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -18,6 +15,19 @@ var __extends = (this && this.__extends) || (function () {
             };
         })();
         
+
+(function universalModuleDefinition(root, factory) {
+    if(typeof exports === 'object' && typeof module === 'object')
+        module.exports = factory(require("babylonjs"));
+    else if(typeof define === 'function' && define.amd)
+        define("babylonjs-serializers", ["babylonjs"], factory);
+    else if(typeof exports === 'object')
+        exports["babylonjs-serializers"] = factory(require("babylonjs"));
+    else {
+        root["BABYLON"] = factory(root["BABYLON"]);
+    }
+})(this, function(BABYLON) {
+    
 var BABYLON;
 (function (BABYLON) {
     var OBJExport = /** @class */ (function () {
@@ -1117,6 +1127,9 @@ var BABYLON;
                         BABYLON.Tools.Warn(babylonStandardMaterial.name + ": glTF 2.0 does not support alpha mode: " + babylonStandardMaterial.alphaMode.toString());
                     }
                 }
+                if (babylonStandardMaterial.emissiveColor) {
+                    glTFMaterial.emissiveFactor = babylonStandardMaterial.emissiveColor.asArray();
+                }
                 glTFMaterial.pbrMetallicRoughness = glTFPbrMetallicRoughness;
                 materials.push(glTFMaterial);
             };
@@ -1292,20 +1305,6 @@ var BABYLON;
 
 //# sourceMappingURL=babylon.glTFMaterial.js.map
 
-
-(function universalModuleDefinition(root, factory) {
-                var f = factory();
-                
-                
-    if(typeof exports === 'object' && typeof module === 'object')
-        module.exports = f;
-    else if(typeof define === 'function' && define.amd)
-        define("babylonjs-serializers", ["BABYLON"], factory);
-    else if(typeof exports === 'object')
-        exports["babylonjs-serializers"] = f;
-    else {
-        root["BABYLON"] = f;
-    }
-})(this, function() {
+    
     return BABYLON;
 });

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


+ 2 - 2
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": "3.2.0-alpha10",
+    "version": "3.2.0-alphaA",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "3.2.0-alpha10"
+        "babylonjs-gltf2interface": "3.2.0-alphaA"
     },
     "peerDependencies": {
         "babylonjs": ">=3.2.0-alpha"

+ 7 - 84
dist/preview release/typedocValidationBaseline.json

@@ -1,7 +1,7 @@
 {
-  "errors": 7231,
+  "errors": 7218,
   "babylon.typedoc.json": {
-    "errors": 7231,
+    "errors": 7218,
     "AnimationKeyInterpolation": {
       "Enumeration": {
         "Comments": {
@@ -8113,50 +8113,6 @@
         }
       }
     },
-    "ConvolutionPostProcess": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Property": {
-        "kernel": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "EdgeDetect0Kernel": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "EdgeDetect1Kernel": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "EdgeDetect2Kernel": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "EmbossKernel": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "GaussianKernel": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "SharpenKernel": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      }
-    },
     "CubeTexture": {
       "Class": {
         "Comments": {
@@ -8870,6 +8826,11 @@
           "Naming": {
             "NotCamelCase": true
           }
+        },
+        "SharpenPostProcessId": {
+          "Naming": {
+            "NotCamelCase": true
+          }
         }
       }
     },
@@ -14211,13 +14172,6 @@
             "MissingText": true
           }
         }
-      },
-      "Method": {
-        "handleButtonChange": {
-          "Naming": {
-            "NotUnderscoreCamelCase": true
-          }
-        }
       }
     },
     "GenericController": {
@@ -14237,13 +14191,6 @@
             "MissingText": true
           }
         }
-      },
-      "Method": {
-        "handleButtonChange": {
-          "Naming": {
-            "NotUnderscoreCamelCase": true
-          }
-        }
       }
     },
     "GenericPad": {
@@ -20416,13 +20363,6 @@
             "MissingText": true
           }
         }
-      },
-      "Method": {
-        "handleButtonChange": {
-          "Naming": {
-            "NotUnderscoreCamelCase": true
-          }
-        }
       }
     },
     "OimoJSPlugin": {
@@ -37366,13 +37306,6 @@
             "MissingText": true
           }
         }
-      },
-      "Method": {
-        "handleButtonChange": {
-          "Naming": {
-            "NotUnderscoreCamelCase": true
-          }
-        }
       }
     },
     "VolumetricLightScatteringPostProcess": {
@@ -37468,11 +37401,6 @@
         }
       },
       "Method": {
-        "handleButtonChange": {
-          "Naming": {
-            "NotUnderscoreCamelCase": true
-          }
-        },
         "initControllerMesh": {
           "Comments": {
             "MissingText": true
@@ -37578,11 +37506,6 @@
         }
       },
       "Method": {
-        "handleButtonChange": {
-          "Naming": {
-            "NotUnderscoreCamelCase": true
-          }
-        },
         "lerpAxisTransform": {
           "Naming": {
             "NotUnderscoreCamelCase": true

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


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


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

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-viewer",
     "description": "A simple-to-use viewer based on BabylonJS to display 3D elements natively",
-    "version": "3.2.0-alpha10",
+    "version": "3.2.0-alphaA",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

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

@@ -81,7 +81,8 @@
 - Integrates depth texture support in the engine ([sebavan](https://github.com/sebavan))
 - NPM package now has a dependency system, updated during build. ([RaananW](https://github.com/RaananW))
 - WebVRExperienceHelper will create an empty controller model so that controller interactions can be used while the actual model is still loading ([trevordev](https://github.com/trevordev))
-- Default pipeline will use webGL 2.0 anti aliasing by default if supported, default fragment shader will clamp negative values to avoid underflow, webVR post processing will render to eye texture size ([trevordev](https://github.com/trevordev))
+- Default fragment shader will clamp negative values to avoid underflow, webVR post processing will render to eye texture size ([trevordev](https://github.com/trevordev))
+- Add msaa and sharpening options to the default pipeline ([trevordev](https://github.com/trevordev))
 
 ## Bug fixes
 
@@ -94,6 +95,8 @@
 - (Viewer) Fixed a bug where loading another mesh positioned it incorrectly ([RaananW](https://github.com/RaananW))
 - (Viewer) Disabling templates now work correctly ([RaananW](https://github.com/RaananW))
 - AMD "define" declaration is no longer anonymous ([RaananW](https://github.com/RaananW))
+- Collision worker didn't initialize instanced meshes correctly - [#3819](https://github.com/BabylonJS/Babylon.js/issues/3819) ([RaananW](https://github.com/RaananW))
+- postMessage calls in webworkers were fixed ([RaananW](https://github.com/RaananW))
 
 ## Breaking changes
 

+ 15 - 0
gui/src/advancedDynamicTexture.ts

@@ -28,6 +28,7 @@ module BABYLON.GUI {
         private _fullscreenViewport = new Viewport(0, 0, 1, 1);
         private _idealWidth = 0;
         private _idealHeight = 0;
+        private _useSmallestIdeal: boolean = false;
         private _renderAtIdealSize = false;
         private _focusedControl: Nullable<IFocusableControl>;
         private _blockNextFocusCheck = false;
@@ -88,6 +89,20 @@ module BABYLON.GUI {
             this._rootContainer._markAllAsDirty();
         }
 
+        public get useSmallestIdeal(): boolean {
+            return this._useSmallestIdeal;
+        }
+
+        public set useSmallestIdeal(value: boolean) {
+            if (this._useSmallestIdeal === value) {
+                return;
+            }
+
+            this._useSmallestIdeal = value;
+            this.markAsDirty();
+            this._rootContainer._markAllAsDirty();
+        }
+
         public get renderAtIdealSize(): boolean {
             return this._renderAtIdealSize;
         }

+ 2 - 2
gui/src/controls/button.ts

@@ -84,12 +84,12 @@ module BABYLON.GUI {
             return true;
         }
 
-        public _onPointerUp(target: Control, coordinates: Vector2, pointerId:number, buttonIndex: number): void {
+        public _onPointerUp(target: Control, coordinates: Vector2, pointerId:number, buttonIndex: number, notifyClick: boolean): void {
             if (this.pointerUpAnimation) {
                 this.pointerUpAnimation();
             }
 
-            super._onPointerUp(target, coordinates, pointerId, buttonIndex);
+            super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);
         }        
 
         // Statics

+ 2 - 2
gui/src/controls/colorpicker.ts

@@ -407,11 +407,11 @@ module BABYLON.GUI {
             super._onPointerMove(target, coordinates);
         }
 
-        public _onPointerUp (target: Control, coordinates: Vector2, pointerId:number, buttonIndex: number): void {
+        public _onPointerUp (target: Control, coordinates: Vector2, pointerId:number, buttonIndex: number, notifyClick: boolean): void {
             this._pointerIsDown = false;
             
             delete this._host._capturingControl[pointerId];
-            super._onPointerUp(target, coordinates, pointerId, buttonIndex);
+            super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);
         }     
     }    
 }

+ 17 - 6
gui/src/controls/control.ts

@@ -91,6 +91,12 @@ module BABYLON.GUI {
         public onPointerUpObservable = new Observable<Vector2WithInfo>();
 
         /**
+        * An event triggered when a control is clicked on
+        * @type {BABYLON.Observable}
+        */
+        public onPointerClickObservable = new Observable<Vector2WithInfo>();
+
+        /**
         * An event triggered when pointer enters the control
         * @type {BABYLON.Observable}
         */
@@ -918,22 +924,26 @@ module BABYLON.GUI {
             return true;
         }
 
-        public _onPointerUp(target: Control, coordinates: Vector2, pointerId:number, buttonIndex: number): void {
+        public _onPointerUp(target: Control, coordinates: Vector2, pointerId:number, buttonIndex: number, notifyClick: boolean): void {
             this._downCount = 0;
 
             delete this._downPointerIds[pointerId];
 
-            var canNotify: boolean = this.onPointerUpObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this);
+            var canNotifyClick: boolean = notifyClick;
+			if (notifyClick && this._enterCount > 0) {
+				canNotifyClick = this.onPointerClickObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this);
+			}
+			var canNotify: boolean = this.onPointerUpObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this);
 
-            if (canNotify && this.parent != null) this.parent._onPointerUp(target, coordinates, pointerId, buttonIndex);
+            if (canNotify && this.parent != null) this.parent._onPointerUp(target, coordinates, pointerId, buttonIndex, canNotifyClick);
         }
 
         public forcePointerUp(pointerId:Nullable<number> = null) {
             if(pointerId !== null){
-                this._onPointerUp(this, Vector2.Zero(), pointerId, 0);
+                this._onPointerUp(this, Vector2.Zero(), pointerId, 0, true);
             }else{
                 for(var key in this._downPointerIds){
-                    this._onPointerUp(this, Vector2.Zero(), +key as number, 0);
+                    this._onPointerUp(this, Vector2.Zero(), +key as number, 0, true);
                 }
             }
         }
@@ -965,7 +975,7 @@ module BABYLON.GUI {
 
             if (type === BABYLON.PointerEventTypes.POINTERUP) {
                 if (this._host._lastControlDown[pointerId]) {
-                    this._host._lastControlDown[pointerId]._onPointerUp(this, this._dummyVector2, pointerId, buttonIndex);
+                    this._host._lastControlDown[pointerId]._onPointerUp(this, this._dummyVector2, pointerId, buttonIndex, true);
                 }
                 delete this._host._lastControlDown[pointerId];
                 return true;
@@ -993,6 +1003,7 @@ module BABYLON.GUI {
             this.onPointerMoveObservable.clear();
             this.onPointerOutObservable.clear();
             this.onPointerUpObservable.clear();
+			this.onPointerClickObservable.clear();
 
             if (this._root) {
                 this._root.removeControl(this);

+ 2 - 2
gui/src/controls/inputText.ts

@@ -449,8 +449,8 @@ module BABYLON.GUI {
             return true;
         }
 
-        public _onPointerUp(target: Control, coordinates: Vector2, pointerId:number, buttonIndex: number): void {
-            super._onPointerUp(target, coordinates, pointerId, buttonIndex);
+        public _onPointerUp(target: Control, coordinates: Vector2, pointerId:number, buttonIndex: number, notifyClick: boolean): void {
+            super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);
         }
 
         public dispose() {

+ 2 - 2
gui/src/controls/slider.ts

@@ -287,11 +287,11 @@ module BABYLON.GUI {
             super._onPointerMove(target, coordinates);
         }
 
-        public _onPointerUp(target: Control, coordinates: Vector2, pointerId:number, buttonIndex: number): void {
+        public _onPointerUp(target: Control, coordinates: Vector2, pointerId:number, buttonIndex: number, notifyClick: boolean): void {
             this._pointerIsDown = false;
 
             delete this._host._capturingControl[pointerId];
-            super._onPointerUp(target, coordinates, pointerId, buttonIndex);
+            super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);
         }
     }
 }

+ 17 - 3
gui/src/valueAndUnit.ts

@@ -31,13 +31,27 @@ module BABYLON.GUI {
 
         public getValue(host: AdvancedDynamicTexture): number {
             if (host && !this.ignoreAdaptiveScaling && this.unit !== ValueAndUnit.UNITMODE_PERCENTAGE) {
+                var width: number = 0;
+                var height: number = 0;
 
-                if (host.idealWidth) { // horizontal
-                    return (this._value * host.getSize().width) / host.idealWidth;
+                if (host.idealWidth) {
+                    width = (this._value * host.getSize().width) / host.idealWidth;
+                }
+                
+                if (host.idealHeight) {
+                    height = (this._value * host.getSize().height) / host.idealHeight;
+                }
+
+                if (host.useSmallestIdeal && host.idealWidth && host.idealHeight) {
+                    return window.innerWidth < window.innerHeight ? width : height;
                 }
 
+                if (host.idealWidth) { // horizontal
+                    return width;
+                }
+                
                 if (host.idealHeight) { // vertical
-                    return (this._value * host.getSize().height) / host.idealHeight;
+                    return height;
                 }
             }
             return this._value;

+ 1 - 1
package.json

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

+ 3 - 0
serializers/src/glTF/2.0/babylon.glTFMaterial.ts

@@ -221,6 +221,9 @@ module BABYLON.GLTF2 {
                     Tools.Warn(babylonStandardMaterial.name + ": glTF 2.0 does not support alpha mode: " + babylonStandardMaterial.alphaMode.toString());
                 }
             }
+            if (babylonStandardMaterial.emissiveColor) {
+                glTFMaterial.emissiveFactor = babylonStandardMaterial.emissiveColor.asArray();
+            }
 
             glTFMaterial.pbrMetallicRoughness = glTFPbrMetallicRoughness;
 

+ 3 - 3
src/Collisions/babylon.collisionCoordinator.ts

@@ -58,11 +58,11 @@ module BABYLON {
         positions: Float32Array;
         /**
          * Defines the array containing the indices
-         */        
+         */
         indices: Uint32Array;
         /**
          * Defines the array containing the normals
-         */        
+         */
         normals: Float32Array;
     }
 
@@ -173,7 +173,7 @@ module BABYLON {
                 let geometry = (<Mesh>mesh).geometry;
                 geometryId = geometry ? geometry.id : null;
             } else if (mesh instanceof InstancedMesh) {
-                let geometry = (<InstancedMesh>mesh).sourceMesh.geometry;
+                let geometry = (<InstancedMesh>mesh).sourceMesh && (<InstancedMesh>mesh).sourceMesh.geometry;
                 geometryId = geometry ? geometry.id : null;
             }
 

+ 6 - 3
src/Collisions/babylon.collisionWorker.ts

@@ -1,5 +1,8 @@
 declare function importScripts(...urls: string[]): void;
 
+// since typescript doesn't understand the file's execution context, we need to override postMessage's signature for error-free compilation
+const safePostMessage: any = self.postMessage;
+
 module BABYLON {
 
     //If this file is included in the main thread, this will be initialized.
@@ -192,7 +195,7 @@ module BABYLON {
                 error: WorkerReplyType.SUCCESS,
                 taskType: WorkerTaskType.INIT
             }
-            postMessage(reply, "");
+            safePostMessage(reply);
         }
 
         public onUpdate(payload: UpdatePayload) {
@@ -226,7 +229,7 @@ module BABYLON {
             }
 
 
-            postMessage(replay, "");
+            safePostMessage(replay);
         }
 
         public onCollision(payload: CollidePayload) {
@@ -247,7 +250,7 @@ module BABYLON {
                 taskType: WorkerTaskType.COLLIDE,
                 payload: replyPayload
             }
-            postMessage(reply, "");
+            safePostMessage(reply);
         }
     }
 

+ 1 - 1
src/Engine/babylon.engine.ts

@@ -586,7 +586,7 @@
         }
 
         public static get Version(): string {
-            return "3.2.0-alpha10";
+            return "3.2.0-alphaA";
         }
 
         // Updatable statics so stick with vars here

+ 62 - 3
src/PostProcess/RenderPipeline/Pipelines/babylon.defaultRenderingPipeline.ts

@@ -7,6 +7,10 @@
         private _scene: Scene;
 
         /**
+		 * ID of the sharpen post process,
+		 */
+        readonly SharpenPostProcessId: string = "SharpenPostProcessEffect";
+        /**
 		 * ID of the pass post process used for bloom,
 		 */
         readonly PassPostProcessId: string = "PassPostProcessEffect";
@@ -41,6 +45,10 @@
 
         // Post-processes
         /**
+		 * Sharpen post process which will apply a sharpen convolution to enhance edges
+		 */
+        public sharpen: SharpenPostProcess;
+        /**
 		 * First pass of bloom to capture the original image texture for later use.
 		 */
         public pass: PassPostProcess;
@@ -82,11 +90,13 @@
          */
         public animations: Animation[] = [];
 
-        // Values       
+        // Values   
+        private _sharpenEnabled:boolean = false;    
         private _bloomEnabled: boolean = false;
         private _depthOfFieldEnabled: boolean = false;
         private _depthOfFieldBlurLevel = DepthOfFieldEffectBlurLevel.Low;
         private _fxaaEnabled: boolean = false;
+        private _msaaEnabled: boolean = false;
         private _imageProcessingEnabled: boolean = true;
         private _defaultPipelineTextureType: number;
         private _bloomScale: number = 0.6;
@@ -94,6 +104,24 @@
         private _buildAllowed = true;
 
         /**
+         * Enable or disable the sharpen process from the pipeline
+         */
+        public set sharpenEnabled(enabled: boolean) {
+            if (this._sharpenEnabled === enabled) {
+                return;
+            }
+            this._sharpenEnabled = enabled;
+
+            this._buildPipeline();
+        }
+
+        @serialize()
+        public get sharpenEnabled(): boolean {
+            return this._sharpenEnabled;
+        }
+
+
+        /**
 		 * Specifies the size of the bloom blur kernel, relative to the final output size
 		 */
         @serialize()
@@ -212,6 +240,23 @@
         }
 
         /**
+         * If the multisample anti-aliasing is enabled.
+         */
+        public set msaaEnabled(enabled: boolean) {
+            if (this._msaaEnabled === enabled) {
+                return;
+            }
+            this._msaaEnabled = enabled;
+
+            this._buildPipeline();
+        }
+
+        @serialize()
+        public get msaaEnabled(): boolean {
+            return this._msaaEnabled;
+        }
+
+        /**
          * If image processing is enabled.
          */
         public set imageProcessingEnabled(enabled: boolean) {
@@ -285,6 +330,11 @@
             this._disposePostProcesses();
             this._reset();
 
+            if (this.sharpenEnabled) {
+                this.sharpen = new SharpenPostProcess("sharpen", 1.0, null, Texture.BILINEAR_SAMPLINGMODE, engine, false, this._defaultPipelineTextureType);
+                this.addEffect(new PostProcessRenderEffect(engine, this.SharpenPostProcessId, () => { return this.sharpen; }, true));
+            }
+
             if(this.depthOfFieldEnabled){
                 // Enable and get current depth map
                 var depthTexture = this._scene.enableDepthRenderer(this._cameras[0]).getDepthMap();
@@ -382,14 +432,22 @@
             if (this._cameras !== null) {
                 this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras);
             }
-
-            this._enableMSAAOnFirstPostProcess();
+            
+            if(this.msaaEnabled){
+                if(!this._enableMSAAOnFirstPostProcess()){
+                    BABYLON.Tools.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0");
+                }
+            }
         }
 
         private _disposePostProcesses(): void {
             for (var i = 0; i < this._cameras.length; i++) {
                 var camera = this._cameras[i];
 
+                if (this.sharpen) {
+                    this.sharpen.dispose(camera);
+                }
+
                 if (this.pass) {
                     this.pass.dispose(camera);
                 }
@@ -427,6 +485,7 @@
                 }
             }
 
+            (<any>this.sharpen) = null;
             (<any>this.pass) = null;
             (<any>this.highlights) = null;
             (<any>this.blurX) = null;

+ 36 - 3
src/PostProcess/babylon.convolutionPostProcess.ts

@@ -1,7 +1,23 @@
 module BABYLON {
+    /**
+     * The ConvolutionPostProcess applies a 3x3 kernel to every pixel of the
+     * input texture to perform effects such as edge detection or sharpening
+     * See http://en.wikipedia.org/wiki/Kernel_(image_processing)
+     */
     export class ConvolutionPostProcess extends PostProcess{
-        constructor(name: string, public kernel: number[], options: number | PostProcessOptions, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean) {
-            super(name, "convolution", ["kernel", "screenSize"], null, options, camera, samplingMode, engine, reusable);
+        /**
+         * Creates a new instance of @see ConvolutionPostProcess
+         * @param name The name of the effect.
+         * @param kernel Array of 9 values corrisponding to the 3x3 kernel to be applied
+         * @param options The required width/height ratio to downsize to before computing the render pass.
+         * @param camera The camera to apply the render pass to.
+         * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
+         * @param engine The engine which the post process will be applied. (default: current engine)
+         * @param reusable If the post process can be reused on the same frame. (default: false)
+         * @param textureType Type of textures used when performing the post process. (default: 0)
+         */
+        constructor(name: string, /** Array of 9 values corrisponding to the 3x3 kernel to be applied */ public kernel: number[], options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: Engine, reusable?: boolean, textureType: number = Engine.TEXTURETYPE_UNSIGNED_INT) {
+            super(name, "convolution", ["kernel", "screenSize"], null, options, camera, samplingMode, engine, reusable, null, textureType);
 
             this.onApply = (effect: Effect) => {
                 effect.setFloat2("screenSize", this.width, this.height);
@@ -10,12 +26,29 @@
         }
 
     // Statics
-    // Based on http://en.wikipedia.org/wiki/Kernel_(image_processing)
+    /**
+     * Edge detection 0 see https://en.wikipedia.org/wiki/Kernel_(image_processing)
+     */
     public static EdgeDetect0Kernel = [1, 0, -1, 0, 0, 0, -1, 0, 1];
+    /**
+     * Edge detection 1 see https://en.wikipedia.org/wiki/Kernel_(image_processing)
+     */
     public static EdgeDetect1Kernel = [0, 1, 0, 1, -4, 1, 0, 1, 0];
+    /**
+     * Edge detection 2 see https://en.wikipedia.org/wiki/Kernel_(image_processing)
+     */
     public static EdgeDetect2Kernel = [-1, -1, -1, -1, 8, -1, -1, -1, -1];
+    /**
+     * Kernel to sharpen an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)
+     */
     public static SharpenKernel = [0, -1, 0, -1, 5, -1, 0, -1, 0];
+    /**
+     * Kernel to emboss an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)
+     */
     public static EmbossKernel = [-2, -1, 0, -1, 1, 1, 0, 1, 2];
+    /**
+     * Kernel to blur an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)
+     */
     public static GaussianKernel = [0, 1, 0, 1, 1, 1, 0, 1, 0];
     }
 }

+ 34 - 0
src/PostProcess/babylon.sharpenPostProcess.ts

@@ -0,0 +1,34 @@
+module BABYLON {
+    /**
+     * The SharpenPostProcess applies a sharpen kernel to every pixel
+     * See http://en.wikipedia.org/wiki/Kernel_(image_processing)
+     */
+    export class SharpenPostProcess extends PostProcess{
+        /**
+         * How much of the original color should be applied. Setting this to 0 will display edge detection. (default: 1)
+         */
+        public colorAmount:number = 1.0;
+        /**
+         * How much sharpness should be applied (default: 0.3)
+         */
+        public edgeAmount:number = 0.3;
+        /**
+         * Creates a new instance of @see ConvolutionPostProcess
+         * @param name The name of the effect.
+         * @param options The required width/height ratio to downsize to before computing the render pass.
+         * @param camera The camera to apply the render pass to.
+         * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
+         * @param engine The engine which the post process will be applied. (default: current engine)
+         * @param reusable If the post process can be reused on the same frame. (default: false)
+         * @param textureType Type of textures used when performing the post process. (default: 0)
+         */
+        constructor(name: string, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: Engine, reusable?: boolean, textureType: number = Engine.TEXTURETYPE_UNSIGNED_INT) {
+            super(name, "sharpen", ["sharpnessAmounts", "screenSize"], null, options, camera, samplingMode, engine, reusable, null, textureType);
+
+            this.onApply = (effect: Effect) => {
+                effect.setFloat2("screenSize", this.width, this.height);
+                effect.setFloat2("sharpnessAmounts", this.edgeAmount, this.colorAmount);
+            };
+        }
+    }
+}

+ 18 - 0
src/Shaders/sharpen.fragment.fx

@@ -0,0 +1,18 @@
+// Samplers
+varying vec2 vUV;
+uniform sampler2D textureSampler;
+uniform vec2 screenSize;
+uniform vec2 sharpnessAmounts;
+
+void main(void)
+{
+	vec2 onePixel = vec2(1.0, 1.0) / screenSize;
+    vec4 color = texture2D(textureSampler, vUV);
+	vec4 edgeDetection = texture2D(textureSampler, vUV + onePixel * vec2(0, -1)) +
+		texture2D(textureSampler, vUV + onePixel * vec2(-1, 0)) +
+		texture2D(textureSampler, vUV + onePixel * vec2(1, 0)) +
+		texture2D(textureSampler, vUV + onePixel * vec2(0, 1)) -
+        color * 4.0;
+	
+	gl_FragColor = max(vec4(color.rgb * sharpnessAmounts.y, color.a) - (sharpnessAmounts.x * vec4(edgeDetection.rgb, 0)), 0.);
+}

+ 8 - 8
src/babylon.scene.ts

@@ -934,7 +934,7 @@
 
         private _debugLayer: DebugLayer;
 
-        private _depthRenderer: {[id:string]:DepthRenderer} = {};
+        private _depthRenderer: { [id: string]: DepthRenderer } = {};
         private _geometryBufferRenderer: Nullable<GeometryBufferRenderer>;
 
         /**
@@ -1008,7 +1008,7 @@
                 return;
             }
 
-            enabled = (enabled && !!Worker);
+            enabled = (enabled && !!Worker && !!CollisionWorker);
 
             this._workerCollisions = enabled;
             if (this.collisionCoordinator) {
@@ -3420,7 +3420,7 @@
                 this._renderTargets.concatWithNoDuplicate(rigParent.customRenderTargets);
             }
 
-            if (this.renderTargetsEnabled && this._renderTargets.length > 0) {                
+            if (this.renderTargetsEnabled && this._renderTargets.length > 0) {
                 this._intermediateRendering = true;
                 Tools.StartPerformanceCounter("Render targets", this._renderTargets.length > 0);
                 for (var renderIndex = 0; renderIndex < this._renderTargets.length; renderIndex++) {
@@ -3573,7 +3573,7 @@
             }
 
             this.activeCamera = camera;
-            this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix());           
+            this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix());
         }
 
         private _checkIntersections(): void {
@@ -3803,7 +3803,7 @@
             }
 
             // Depth renderer
-            for(var key in this._depthRenderer){
+            for (var key in this._depthRenderer) {
                 this._renderTargets.push(this._depthRenderer[key].getDepthMap());
             }
 
@@ -3998,12 +3998,12 @@
          */
         public enableDepthRenderer(camera?: Nullable<Camera>): DepthRenderer {
             camera = camera || this.activeCamera;
-            if(!camera){
+            if (!camera) {
                 throw "No camera available to enable depth renderer";
             }
             if (!this._depthRenderer[camera.id]) {
                 this._depthRenderer[camera.id] = new DepthRenderer(this, Engine.TEXTURETYPE_FLOAT, camera);
-            }            
+            }
 
             return this._depthRenderer[camera.id];
         }
@@ -4069,7 +4069,7 @@
 
             this.resetCachedMaterial();
 
-            for(var key in this._depthRenderer){
+            for (var key in this._depthRenderer) {
                 this._depthRenderer[key].dispose();
             }