Browse Source

Merge remote-tracking branch 'BabylonJS/master' into umd-change

Raanan Weber 7 năm trước cách đây
mục cha
commit
5349efefac
54 tập tin đã thay đổi với 24186 bổ sung21848 xóa
  1. 8299 8282
      Playground/babylon.d.txt
  2. BIN
      Playground/scenes/Alien/Alien.bin
  3. 1562 0
      Playground/scenes/Alien/Alien.gltf
  4. BIN
      Playground/scenes/Alien/Alien_baseColor.png
  5. BIN
      Playground/scenes/Alien/Alien_normal.png
  6. BIN
      Playground/scenes/Alien/Alien_occlusionRoughnessMetallic.png
  7. 4 1
      Tools/Gulp/config.json
  8. 5 5
      Tools/Gulp/readme.md
  9. 6586 6557
      dist/preview release/babylon.d.ts
  10. 38 38
      dist/preview release/babylon.js
  11. 120 20
      dist/preview release/babylon.max.js
  12. 38 38
      dist/preview release/babylon.worker.js
  13. 6633 6604
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  14. 40 40
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  15. 123 22
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  16. 125 24
      dist/preview release/customConfigurations/minimalGLTFViewer/es6.js
  17. 122 22
      dist/preview release/es6.js
  18. 3 2
      dist/preview release/loaders/babylon.glTF2FileLoader.js
  19. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  20. 3 2
      dist/preview release/loaders/babylon.glTFFileLoader.js
  21. 2 2
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  22. 3 2
      dist/preview release/loaders/babylonjs.loaders.js
  23. 1 1
      dist/preview release/loaders/babylonjs.loaders.min.js
  24. 3 0
      dist/preview release/serializers/babylon.glTF2Serializer.js
  25. 1 1
      dist/preview release/serializers/babylon.glTF2Serializer.min.js
  26. 3 0
      dist/preview release/serializers/babylonjs.serializers.js
  27. 1 1
      dist/preview release/serializers/babylonjs.serializers.min.js
  28. 7 89
      dist/preview release/typedocValidationBaseline.json
  29. 38 38
      dist/preview release/viewer/babylon.viewer.js
  30. 120 20
      dist/preview release/viewer/babylon.viewer.max.js
  31. 3 2
      dist/preview release/what's new.md
  32. 15 0
      gui/src/advancedDynamicTexture.ts
  33. 2 2
      gui/src/controls/button.ts
  34. 2 2
      gui/src/controls/colorpicker.ts
  35. 17 6
      gui/src/controls/control.ts
  36. 2 2
      gui/src/controls/inputText.ts
  37. 2 2
      gui/src/controls/slider.ts
  38. 17 3
      gui/src/valueAndUnit.ts
  39. 3 2
      loaders/src/glTF/2.0/babylon.glTFLoader.ts
  40. 3 0
      serializers/src/glTF/2.0/babylon.glTFMaterial.ts
  41. 50 0
      src/Gamepad/Controllers/babylon.daydreamController.ts
  42. 1 1
      src/Gamepad/Controllers/babylon.gearVRController.ts
  43. 1 1
      src/Gamepad/Controllers/babylon.genericController.ts
  44. 1 1
      src/Gamepad/Controllers/babylon.oculusTouchController.ts
  45. 8 1
      src/Gamepad/Controllers/babylon.poseEnabledController.ts
  46. 1 1
      src/Gamepad/Controllers/babylon.viveController.ts
  47. 2 2
      src/Gamepad/Controllers/babylon.webVRController.ts
  48. 1 1
      src/Gamepad/Controllers/babylon.windowsMotionController.ts
  49. 62 3
      src/PostProcess/RenderPipeline/Pipelines/babylon.defaultRenderingPipeline.ts
  50. 36 3
      src/PostProcess/babylon.convolutionPostProcess.ts
  51. 34 0
      src/PostProcess/babylon.sharpenPostProcess.ts
  52. 1 1
      src/Shaders/default.fragment.fx
  53. 18 0
      src/Shaders/sharpen.fragment.fx
  54. 23 0
      tests/unit/babylon/src/Loading/babylon.sceneLoader.tests.ts

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 8299 - 8282
Playground/babylon.d.txt


BIN
Playground/scenes/Alien/Alien.bin


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1562 - 0
Playground/scenes/Alien/Alien.gltf


BIN
Playground/scenes/Alien/Alien_baseColor.png


BIN
Playground/scenes/Alien/Alien_normal.png


BIN
Playground/scenes/Alien/Alien_occlusionRoughnessMetallic.png


+ 4 - 1
Tools/Gulp/config.json

@@ -660,7 +660,8 @@
                 "../../src/Gamepad/Controllers/babylon.viveController.js",
                 "../../src/Gamepad/Controllers/babylon.genericController.js",
                 "../../src/Gamepad/Controllers/babylon.windowsMotionController.js",
-                "../../src/Gamepad/Controllers/babylon.gearVRController.js"
+                "../../src/Gamepad/Controllers/babylon.gearVRController.js",
+                "../../src/Gamepad/Controllers/babylon.daydreamController.js"
             ],
             "dependUpon": [
                 "core"
@@ -822,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",
@@ -838,6 +840,7 @@
                 "refraction.fragment",
                 "blackAndWhite.fragment",
                 "convolution.fragment",
+                "sharpen.fragment",
                 "filter.fragment",
                 "fxaa.fragment",
                 "volumetricLightScattering.fragment",

+ 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
 ```

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 6586 - 6557
dist/preview release/babylon.d.ts


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 38 - 38
dist/preview release/babylon.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 120 - 20
dist/preview release/babylon.max.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 38 - 38
dist/preview release/babylon.worker.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 6633 - 6604
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 40 - 40
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 123 - 22
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 125 - 24
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 122 - 22
dist/preview release/es6.js


+ 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) {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 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) {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 2 - 2
dist/preview release/loaders/babylon.glTFFileLoader.min.js


+ 3 - 2
dist/preview release/loaders/babylonjs.loaders.js

@@ -4218,8 +4218,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) {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.min.js


+ 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);
             };

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/serializers/babylon.glTF2Serializer.min.js


+ 3 - 0
dist/preview release/serializers/babylonjs.serializers.js

@@ -1117,6 +1117,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);
             };

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/serializers/babylonjs.serializers.min.js


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

@@ -1,7 +1,7 @@
 {
-  "errors": 7232,
+  "errors": 7218,
   "babylon.typedoc.json": {
-    "errors": 7232,
+    "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": {
@@ -25315,11 +25255,6 @@
             "MissingText": true
           }
         },
-        "invertYAxis": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
         "name": {
           "Comments": {
             "MissingText": true
@@ -37371,13 +37306,6 @@
             "MissingText": true
           }
         }
-      },
-      "Method": {
-        "handleButtonChange": {
-          "Naming": {
-            "NotUnderscoreCamelCase": true
-          }
-        }
       }
     },
     "VolumetricLightScatteringPostProcess": {
@@ -37473,11 +37401,6 @@
         }
       },
       "Method": {
-        "handleButtonChange": {
-          "Naming": {
-            "NotUnderscoreCamelCase": true
-          }
-        },
         "initControllerMesh": {
           "Comments": {
             "MissingText": true
@@ -37583,11 +37506,6 @@
         }
       },
       "Method": {
-        "handleButtonChange": {
-          "Naming": {
-            "NotUnderscoreCamelCase": true
-          }
-        },
         "lerpAxisTransform": {
           "Naming": {
             "NotUnderscoreCamelCase": true

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 38 - 38
dist/preview release/viewer/babylon.viewer.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 120 - 20
dist/preview release/viewer/babylon.viewer.max.js


+ 3 - 2
dist/preview release/what's new.md

@@ -6,7 +6,7 @@
 - Improved building process: We now run a full visual validation test for each pull request. Furthermore, code comments and what's new updates are now mandatory ([sebavan](https://github.com/sebavan))
 - Introduced texture binding atlas. This optimization allows the engine to reuse texture bindings instead of rebinding textures when they are not on constant sampler indexes ([deltakosh](https://github.com/deltakosh))
 - New [AnimationGroup class](http://doc.babylonjs.com/how_to/group) to control simultaneously multiple animations with different targets ([deltakosh](https://github.com/deltakosh))
-- `WebVRCamera` now supports GearVR ([brianzinn](https://github.com/brianzinn))
+- `WebVRCamera` add basic support for Daydream and Gear VR ([brianzinn](https://github.com/brianzinn))
 - New glTF [serializer](https://github.com/BabylonJS/Babylon.js/tree/master/serializers/src/glTF/2.0). You can now export glTF or glb files directly from a Babylon scene ([kcoley](https://github.com/kcoley))
 - Babylon.js now uses Promises in addition to callbacks. We created several `xxxAsync` functions all over the framework (`SceneLoader.AppendAsync` for instance, which returns a Promise). A polyfill is also integrated to support older browsers ([deltakosh](https://github.com/deltakosh))
 - Introduced [Projection Texture on SpotLight](http://doc.babylonjs.com/babylon101/lights#projection-texture) ([lostink](https://github.com/lostink))
@@ -80,7 +80,8 @@
 - Support depth maps for multiple active cameras for post processes like depth of field ([trevordev](https://github.com/trevordev))
 - 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))
-- Default pipeline will use webGL 2.0 anti aliasing by default if supported, 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
 

+ 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;

+ 3 - 2
loaders/src/glTF/2.0/babylon.glTFLoader.ts

@@ -706,8 +706,9 @@ module BABYLON.GLTF2 {
             };
 
             if (skin._loaded) {
-                assignSkeleton();
-                return skin._loaded;
+                return skin._loaded.then(() => {
+                    assignSkeleton();
+                });
             }
 
             // TODO: split into two parts so that bones are created before inverseBindMatricesData is loaded (for compiling materials).

+ 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;
 

+ 50 - 0
src/Gamepad/Controllers/babylon.daydreamController.ts

@@ -0,0 +1,50 @@
+module BABYLON {
+    /**
+     * Google Daydream controller
+     */
+    export class DaydreamController extends WebVRController {
+        /**
+         * Base Url for the controller model.
+         */
+        public static MODEL_BASE_URL: string = 'https://controllers.babylonjs.com/generic/';
+
+        /**
+         * File name for the controller model.
+         */
+        public static MODEL_FILENAME: string = 'generic.babylon';
+
+        /**
+         * Gamepad Id prefix used to identify Daydream Controller.
+         */
+        public static readonly GAMEPAD_ID_PREFIX: string = 'Daydream'; // id is 'Daydream Controller'
+
+        constructor(vrGamepad: any) {
+            super(vrGamepad);
+            this.controllerType = PoseEnabledControllerType.DAYDREAM;
+        }
+
+        public initControllerMesh(scene: Scene, meshLoaded?: (mesh: AbstractMesh) => void) {
+            SceneLoader.ImportMesh("", DaydreamController.MODEL_BASE_URL, DaydreamController.MODEL_FILENAME, scene, (newMeshes) => {
+                this._defaultModel = newMeshes[1];
+                this.attachToMesh(this._defaultModel);
+
+                if (meshLoaded) {
+                    meshLoaded(this._defaultModel);
+                }
+            });
+        }
+
+        protected _handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton, changes: GamepadButtonChanges) {
+            // Daydream controller only has 1 GamepadButton (on the trackpad).
+            if (buttonIdx === 0) {
+                let observable = this.onTriggerStateChangedObservable;
+                if (observable) {
+                    observable.notifyObservers(state);
+                }
+            } else {
+                // If the app or home buttons are ever made available
+                Tools.Warn(`Unrecognized Daydream button index: ${buttonIdx}`)
+            }
+        }
+    }
+}

+ 1 - 1
src/Gamepad/Controllers/babylon.gearVRController.ts

@@ -26,7 +26,7 @@ module BABYLON {
             });
         }
 
-        protected handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton, changes: GamepadButtonChanges) {
+        protected _handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton, changes: GamepadButtonChanges) {
             if (buttonIdx < this._buttonIndexToObservableNameMap.length) {
                 const observableName : string = this._buttonIndexToObservableNameMap[buttonIdx];
                 

+ 1 - 1
src/Gamepad/Controllers/babylon.genericController.ts

@@ -18,7 +18,7 @@ module BABYLON {
             });
         }
 
-        protected handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton, changes: GamepadButtonChanges) {
+        protected _handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton, changes: GamepadButtonChanges) {
             console.log("Button id: " + buttonIdx + "state: ");
             console.dir(state);
         }

+ 1 - 1
src/Gamepad/Controllers/babylon.oculusTouchController.ts

@@ -87,7 +87,7 @@ module BABYLON {
          4) B / Y 
          5) thumb rest
         */
-        protected handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton, changes: GamepadButtonChanges) {
+        protected _handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton, changes: GamepadButtonChanges) {
             let notifyObject = state; //{ state: state, changes: changes };
             let triggerDirection = this.hand === 'right' ? -1 : 1;
             switch (buttonIdx) {

+ 8 - 1
src/Gamepad/Controllers/babylon.poseEnabledController.ts

@@ -5,6 +5,10 @@ module BABYLON {
         OCULUS,
         WINDOWS,
         GEAR_VR,
+        /**
+         * Google Daydream
+         */
+        DAYDREAM,
         GENERIC
     }
 
@@ -38,6 +42,10 @@ module BABYLON {
             else if (vrGamepad.id.indexOf(GearVRController.GAMEPAD_ID_PREFIX) === 0) {
                 return new GearVRController(vrGamepad);
             }
+            // Google Daydream
+            else if (vrGamepad.id.indexOf(DaydreamController.GAMEPAD_ID_PREFIX) === 0) {
+                return new DaydreamController(vrGamepad);
+            }
             // Generic 
             else {
                 return new GenericController(vrGamepad);
@@ -115,7 +123,6 @@ module BABYLON {
 
                     this._deviceRoomPosition.scaleToRef(this.deviceScaleFactor, this._calculatedPosition);
                     this._calculatedPosition.addInPlace(this.position);
-
                 }
                 let pose = this.rawPose;
                 if (poseData.orientation && pose.orientation) {

+ 1 - 1
src/Gamepad/Controllers/babylon.viveController.ts

@@ -50,7 +50,7 @@ module BABYLON {
          * 2: left AND right buttons
          * 3: menu button
          */
-        protected handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton, changes: GamepadButtonChanges) {
+        protected _handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton, changes: GamepadButtonChanges) {
             let notifyObject = state; //{ state: state, changes: changes };
             switch (buttonIdx) {
                 case 0:

+ 2 - 2
src/Gamepad/Controllers/babylon.webVRController.ts

@@ -45,7 +45,7 @@ module BABYLON {
             }
         }
 
-        protected abstract handleButtonChange(buttonIdx: number, value: ExtendedGamepadButton, changes: GamepadButtonChanges): void;
+        protected abstract _handleButtonChange(buttonIdx: number, value: ExtendedGamepadButton, changes: GamepadButtonChanges): void;
 
         public abstract initControllerMesh(scene: Scene, meshLoaded?: (mesh: AbstractMesh) => void): void;
 
@@ -69,7 +69,7 @@ module BABYLON {
             if (this._changes.changed) {
                 this._onButtonStateChange && this._onButtonStateChange(this.index, buttonIndex, newState);
 
-                this.handleButtonChange(buttonIndex, newState, this._changes);
+                this._handleButtonChange(buttonIndex, newState, this._changes);
             }
             this._buttons[buttonIndex].pressed = newState.pressed;
             this._buttons[buttonIndex].touched = newState.touched;

+ 1 - 1
src/Gamepad/Controllers/babylon.windowsMotionController.ts

@@ -126,7 +126,7 @@ module BABYLON {
          * @param state New state of the button
          * @param changes Which properties on the state changed since last frame
          */
-        protected handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton, changes: GamepadButtonChanges) {
+        protected _handleButtonChange(buttonIdx: number, state: ExtendedGamepadButton, changes: GamepadButtonChanges) {
             let buttonName = this._mapping.buttons[buttonIdx];
             if (!buttonName) {
                 return;

+ 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);
+            };
+        }
+    }
+}

+ 1 - 1
src/Shaders/default.fragment.fx

@@ -418,7 +418,7 @@ void main(void) {
 #endif
 
 #define CUSTOM_FRAGMENT_BEFORE_FOG
-
+color.rgb = max(color.rgb, 0.);
 #include<logDepthFragment>
 #include<fogFragment>
 

+ 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.);
+}

+ 23 - 0
tests/unit/babylon/src/Loading/babylon.sceneLoader.tests.ts

@@ -181,6 +181,29 @@ describe('Babylon Scene Loader', function () {
             return Promise.all([promise, deferred.promise, scene.whenReadyAsync()]);
         });
 
+        it('Load Alien', () => {
+            const scene = new BABYLON.Scene(subject);
+            return BABYLON.SceneLoader.ImportMeshAsync(null, "/Playground/scenes/Alien/", "Alien.gltf", scene).then(result => {
+                expect(result.skeletons.length, "skeletons.length").to.equal(scene.skeletons.length);
+
+                const mapping = {
+                    "AlienHead_0": "skeleton0",
+                    "Collar_0": "skeleton1",
+                    "LeftEye_0": "skeleton2",
+                    "RightEye_0": "skeleton3",
+                    "CollarClasp_0": "skeleton1",
+                    "Shirt_0": "skeleton1",
+                    "ShirtPlate_0": "skeleton1",
+                    "Teeth_0": "skeleton1",
+                };
+
+                for (const meshName in mapping) {
+                    const skeletonName = mapping[meshName];
+                    expect(scene.getMeshByName(meshName).skeleton.name, `skeleton name of mesh '${meshName}'`).to.equal(skeletonName);
+                }
+            });
+        });
+
         // TODO: test material instancing
         // TODO: test ImportMesh with specific node name
         // TODO: test KHR_materials_pbrSpecularGlossiness