Browse Source

Integrating latest PR

David Catuhe 10 years ago
parent
commit
5eee708739

+ 1 - 1
Babylon/Audio/babylon.audioEngine.js

@@ -66,4 +66,4 @@ var BABYLON;
     })();
     BABYLON.AudioEngine = AudioEngine;
 })(BABYLON || (BABYLON = {}));
-//# sourceMappingURL=babylon.audioengine.js.map
+//# sourceMappingURL=babylon.audioEngine.js.map

+ 3 - 2
Babylon/Debug/babylon.debugLayer.js

@@ -355,8 +355,9 @@ var BABYLON;
             if (tag === void 0) { tag = null; }
             var button = document.createElement("button");
             button.innerHTML = title;
-            button.style.height = "20px";
-            button.style.color = "#222222";
+            button.style.height = "24px";
+            button.style.color = "#444444";
+            button.style.border = "1px solid white";
             button.className = "debugLayerButton";
             button.addEventListener("click", function (evt) {
                 task(evt.target, tag);

+ 3 - 2
Babylon/Debug/babylon.debugLayer.ts

@@ -482,8 +482,9 @@
         private _generateButton(root: HTMLDivElement, title: string, task: (element, tag) => void, tag: any = null): void {
             var button = document.createElement("button");
             button.innerHTML = title;
-            button.style.height = "20px";
-            button.style.color = "#222222";
+            button.style.height = "24px";
+            button.style.color = "#444444";
+            button.style.border = "1px solid white"; 
             button.className = "debugLayerButton";
 
             button.addEventListener("click",(evt: Event) => {

+ 11 - 7
Babylon/Lights/Shadows/babylon.shadowGenerator.js

@@ -7,8 +7,8 @@ var BABYLON;
             this.filter = ShadowGenerator.FILTER_NONE;
             this.blurScale = 2;
             this._blurBoxOffset = 0;
-            this._darkness = 0;
             this._bias = 0.00005;
+            this._darkness = 0;
             this._transparencyShadow = false;
             this._viewMatrix = BABYLON.Matrix.Zero();
             this._projectionMatrix = BABYLON.Matrix.Zero();
@@ -127,6 +127,16 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(ShadowGenerator.prototype, "bias", {
+            get: function () {
+                return this._bias;
+            },
+            set: function (bias) {
+                this._bias = bias;
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(ShadowGenerator.prototype, "blurBoxOffset", {
             get: function () {
                 return this._blurBoxOffset;
@@ -265,12 +275,6 @@ var BABYLON;
             else
                 this._darkness = darkness;
         };
-        ShadowGenerator.prototype.getBias = function () {
-            return this._bias;
-        };
-        ShadowGenerator.prototype.setBias = function (bias) {
-            this._bias = bias;
-        };
         ShadowGenerator.prototype.setTransparencyShadow = function (hasShadow) {
             this._transparencyShadow = hasShadow;
         };

+ 8 - 9
Babylon/Lights/Shadows/babylon.shadowGenerator.ts

@@ -26,7 +26,15 @@
         public filter = ShadowGenerator.FILTER_NONE;
         public blurScale = 2;
         private _blurBoxOffset = 0;
+        private _bias = 0.00005;
+
+        public get bias(): number {
+            return this._bias;
+        }
 
+        public set bias(bias: number) {
+            this._bias = bias;
+        }
         public get blurBoxOffset(): number {
             return this._blurBoxOffset;
         }
@@ -78,7 +86,6 @@
         private _shadowMap: RenderTargetTexture;
         private _shadowMap2: RenderTargetTexture;
         private _darkness = 0;
-        private _bias = 0.00005;
         private _transparencyShadow = false;
         private _effect: Effect;
 
@@ -316,14 +323,6 @@
                 this._darkness = darkness;
         }
 
-        public getBias(): number {
-            return this._bias;
-        }
-
-        public setBias(bias: number): void {
-            this._bias = bias;
-        }
-
         public setTransparencyShadow(hasShadow: boolean): void {
             this._transparencyShadow = hasShadow;
         }

+ 1 - 1
Babylon/Loading/Plugins/babylon.babylonFileLoader.js

@@ -222,7 +222,7 @@ var BABYLON;
                 shadowGenerator.useBlurVarianceShadowMap = true;
             }
             if (parsedShadowGenerator.bias) {
-                shadowGenerator.setBias(parsedShadowGenerator.bias);
+                shadowGenerator.bias = parsedShadowGenerator.bias;
             }
             return shadowGenerator;
         };

+ 1 - 1
Babylon/Loading/Plugins/babylon.babylonFileLoader.ts

@@ -276,7 +276,7 @@
         }
 
         if (parsedShadowGenerator.bias) {
-            shadowGenerator.setBias(parsedShadowGenerator.bias);
+            shadowGenerator.bias = parsedShadowGenerator.bias;
         }
 
         return shadowGenerator;

+ 1 - 1
Babylon/Materials/babylon.standardMaterial.js

@@ -477,7 +477,7 @@ var BABYLON;
                         if (mesh.receiveShadows && shadowGenerator) {
                             this._effect.setMatrix("lightMatrix" + lightIndex, shadowGenerator.getTransformMatrix());
                             this._effect.setTexture("shadowSampler" + lightIndex, shadowGenerator.getShadowMapForRendering());
-                            this._effect.setFloat3("shadowsInfo" + lightIndex, shadowGenerator.getDarkness(), shadowGenerator.getShadowMap().getSize().width, shadowGenerator.getBias());
+                            this._effect.setFloat3("shadowsInfo" + lightIndex, shadowGenerator.getDarkness(), shadowGenerator.getShadowMap().getSize().width, shadowGenerator.bias);
                         }
                     }
                     lightIndex++;

+ 1 - 1
Babylon/Materials/babylon.standardMaterial.ts

@@ -585,7 +585,7 @@
                         if (mesh.receiveShadows && shadowGenerator) {
                             this._effect.setMatrix("lightMatrix" + lightIndex, shadowGenerator.getTransformMatrix());
                             this._effect.setTexture("shadowSampler" + lightIndex, shadowGenerator.getShadowMapForRendering());
-                            this._effect.setFloat3("shadowsInfo" + lightIndex, shadowGenerator.getDarkness(), shadowGenerator.getShadowMap().getSize().width, shadowGenerator.getBias());
+                            this._effect.setFloat3("shadowsInfo" + lightIndex, shadowGenerator.getDarkness(), shadowGenerator.getShadowMap().getSize().width, shadowGenerator.bias);
                         }
                     }
 

+ 1 - 1
Babylon/Mesh/babylon.instancedMesh.js

@@ -150,4 +150,4 @@ var BABYLON;
     })(BABYLON.AbstractMesh);
     BABYLON.InstancedMesh = InstancedMesh;
 })(BABYLON || (BABYLON = {}));
-//# sourceMappingURL=babylon.instancedMesh.js.map
+//# sourceMappingURL=babylon.instancedMesh.js.map

+ 39 - 0
Babylon/PostProcess/babylon.colorCorrectionPostProcess.js

@@ -0,0 +1,39 @@
+//
+//  This post-process allows the modification of rendered colors by using
+//  a 'look-up table' (LUT). This effect is also called Color Grading.
+// 
+//  The object needs to be provided an url to a texture containing the color
+//  look-up table: the texture must be 256 pixels wide and 16 pixels high.
+//  Use an image editing software to tweak the LUT to match your needs.
+// 
+//  For an example of a color LUT, see here:
+//      http://udn.epicgames.com/Three/rsrc/Three/ColorGrading/RGBTable16x1.png
+//  For explanations on color grading, see here:
+//      http://udn.epicgames.com/Three/ColorGrading.html
+//
+var __extends = this.__extends || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    __.prototype = b.prototype;
+    d.prototype = new __();
+};
+var BABYLON;
+(function (BABYLON) {
+    var ColorCorrectionPostProcess = (function (_super) {
+        __extends(ColorCorrectionPostProcess, _super);
+        function ColorCorrectionPostProcess(name, colorTableUrl, ratio, camera, samplingMode, engine, reusable) {
+            var _this = this;
+            _super.call(this, name, 'colorCorrection', null, ['colorTable'], ratio, camera, samplingMode, engine, reusable);
+            this._colorTableTexture = new BABYLON.Texture(colorTableUrl, camera.getScene(), true, false, BABYLON.Texture.TRILINEAR_SAMPLINGMODE);
+            this._colorTableTexture.anisotropicFilteringLevel = 1;
+            this._colorTableTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
+            this._colorTableTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
+            this.onApply = function (effect) {
+                effect.setTexture("colorTable", _this._colorTableTexture);
+            };
+        }
+        return ColorCorrectionPostProcess;
+    })(BABYLON.PostProcess);
+    BABYLON.ColorCorrectionPostProcess = ColorCorrectionPostProcess;
+})(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.colorCorrectionPostProcess.js.map

+ 24 - 25
Babylon/PostProcess/babylon.colorCorrectionPostProcess.ts

@@ -1,34 +1,33 @@
-/*
- *  This post-process allows the modification of rendered colors by using
- *  a 'look-up table' (LUT). This effect is also called Color Grading.
- * 
- *  The object needs to be provided an url to a texture containing the color
- *  look-up table: the texture must be 256 pixels wide and 16 pixels high.
- *  Use an image editing software to tweak the LUT to match your needs.
- * 
- *  For an example of a color LUT, see here:
- *      http://udn.epicgames.com/Three/rsrc/Three/ColorGrading/RGBTable16x1.png
- *  For explanations on color grading, see here:
- *      http://udn.epicgames.com/Three/ColorGrading.html
- */
+//
+//  This post-process allows the modification of rendered colors by using
+//  a 'look-up table' (LUT). This effect is also called Color Grading.
+// 
+//  The object needs to be provided an url to a texture containing the color
+//  look-up table: the texture must be 256 pixels wide and 16 pixels high.
+//  Use an image editing software to tweak the LUT to match your needs.
+// 
+//  For an example of a color LUT, see here:
+//      http://udn.epicgames.com/Three/rsrc/Three/ColorGrading/RGBTable16x1.png
+//  For explanations on color grading, see here:
+//      http://udn.epicgames.com/Three/ColorGrading.html
+//
 
 module BABYLON {
-    export class ColorCorrectionPostProcess extends PostProcess{
+    export class ColorCorrectionPostProcess extends PostProcess {
 
-    	private _colorTableTexture: BABYLON.Texture;
+        private _colorTableTexture: Texture;
 
-    	constructor(name: string, colorTableUrl: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean) {
-    		super(name, 'colorCorrection', null, ['colorTable'], ratio, camera, samplingMode, engine, reusable);
+        constructor(name: string, colorTableUrl: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean) {
+            super(name, 'colorCorrection', null, ['colorTable'], ratio, camera, samplingMode, engine, reusable);
 
-    		this._colorTableTexture = new BABYLON.Texture(colorTableUrl, camera.getScene(), true, false, BABYLON.Texture.TRILINEAR_SAMPLINGMODE);
-    		this._colorTableTexture.anisotropicFilteringLevel = 1;
-    		this._colorTableTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
-    		this._colorTableTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
+            this._colorTableTexture = new Texture(colorTableUrl, camera.getScene(), true, false, Texture.TRILINEAR_SAMPLINGMODE);
+            this._colorTableTexture.anisotropicFilteringLevel = 1;
+            this._colorTableTexture.wrapU = Texture.CLAMP_ADDRESSMODE;
+            this._colorTableTexture.wrapV = Texture.CLAMP_ADDRESSMODE;
 
-    		this.onApply = (effect: Effect) => {
-            	effect.setTexture("colorTable", this._colorTableTexture);
+            this.onApply = (effect: Effect) => {
+                effect.setTexture("colorTable", this._colorTableTexture);
             };
-    	}
-
+        }
     }
 }

+ 15 - 17
Babylon/Shaders/colorCorrection.fragment.fx

@@ -1,4 +1,4 @@
-#ifdef GL_ES
+#ifdef GL_ES
 precision highp float;
 #endif
 
@@ -11,26 +11,24 @@ varying vec2 vUV;
 
 // constants
 const float SLICE_COUNT = 16.0;		// how many slices in the color cube; 1 slice = 1 pixel
-									// it means the image is 256x16 pixels
-
+// it means the image is 256x16 pixels
 
 vec4 sampleAs3DTexture(sampler2D texture, vec3 uv, float width) {
-    float sliceSize = 1.0 / width;              // space of 1 slice
-    float slicePixelSize = sliceSize / width;           // space of 1 pixel
-    float sliceInnerSize = slicePixelSize * (width - 1.0);  // space of width pixels
-    float zSlice0 = min(floor(uv.z * width), width - 1.0);
-    float zSlice1 = min(zSlice0 + 1.0, width - 1.0);
-    float xOffset = slicePixelSize * 0.5 + uv.x * sliceInnerSize;
-    float s0 = xOffset + (zSlice0 * sliceSize);
-    float s1 = xOffset + (zSlice1 * sliceSize);
-    vec4 slice0Color = texture2D(texture, vec2(s0, uv.y));
-    vec4 slice1Color = texture2D(texture, vec2(s1, uv.y));
-    float zOffset = mod(uv.z * width, 1.0);
-    vec4 result = mix(slice0Color, slice1Color, zOffset);
-    return result;
+	float sliceSize = 1.0 / width;              // space of 1 slice
+	float slicePixelSize = sliceSize / width;           // space of 1 pixel
+	float sliceInnerSize = slicePixelSize * (width - 1.0);  // space of width pixels
+	float zSlice0 = min(floor(uv.z * width), width - 1.0);
+	float zSlice1 = min(zSlice0 + 1.0, width - 1.0);
+	float xOffset = slicePixelSize * 0.5 + uv.x * sliceInnerSize;
+	float s0 = xOffset + (zSlice0 * sliceSize);
+	float s1 = xOffset + (zSlice1 * sliceSize);
+	vec4 slice0Color = texture2D(texture, vec2(s0, uv.y));
+	vec4 slice1Color = texture2D(texture, vec2(s1, uv.y));
+	float zOffset = mod(uv.z * width, 1.0);
+	vec4 result = mix(slice0Color, slice1Color, zOffset);
+	return result;
 }
 
-
 void main(void)
 {
 	vec4 screen_color = texture2D(textureSampler, vUV);

+ 9 - 5
Babylon/Shaders/default.fragment.fx

@@ -216,7 +216,8 @@ float unpackHalf(vec2 color)
 float computeShadow(vec4 vPositionFromLight, sampler2D shadowSampler, float darkness, float bias)
 {
 	vec3 depth = vPositionFromLight.xyz / vPositionFromLight.w;
-	vec2 uv = 0.5 * depth.xy + vec2(0.5, 0.5);
+	depth = 0.5 * depth + vec3(0.5);
+	vec2 uv = depth.xy;
 
 	if (uv.x < 0. || uv.x > 1.0 || uv.y < 0. || uv.y > 1.0)
 	{
@@ -235,7 +236,8 @@ float computeShadow(vec4 vPositionFromLight, sampler2D shadowSampler, float dark
 float computeShadowWithPCF(vec4 vPositionFromLight, sampler2D shadowSampler, float mapSize, float bias)
 {
 	vec3 depth = vPositionFromLight.xyz / vPositionFromLight.w;
-	vec2 uv = 0.5 * depth.xy + vec2(0.5, 0.5);
+	depth = 0.5 * depth + vec3(0.5);
+	vec2 uv = depth.xy;
 
 	if (uv.x < 0. || uv.x > 1.0 || uv.y < 0. || uv.y > 1.0)
 	{
@@ -262,23 +264,25 @@ float computeShadowWithPCF(vec4 vPositionFromLight, sampler2D shadowSampler, flo
 // Thanks to http://devmaster.net/
 float ChebychevInequality(vec2 moments, float t, float bias)
 {
+	bias = 0.02 + bias;
 	if (t <= moments.x)
 	{
 		return 0.0;
 	}
 
 	float variance = moments.y - (moments.x * moments.x);
-	variance = max(variance, 0.02 + bias);
+	variance = max(variance, bias);
 
 	float d = t - moments.x;
 
-	return clamp(variance / (variance + d * d) - 0.05, 0.0, 1.0);
+	return clamp(variance / (variance + d * d) - 0.05 - bias, 0.0, 1.0);
 }
 
 float computeShadowWithVSM(vec4 vPositionFromLight, sampler2D shadowSampler, float bias)
 {
 	vec3 depth = vPositionFromLight.xyz / vPositionFromLight.w;
-	vec2 uv = 0.5 * depth.xy + vec2(0.5, 0.5);
+	depth = 0.5 * depth + vec3(0.5);
+	vec2 uv = depth.xy;
 
 	if (uv.x < 0. || uv.x > 1.0 || uv.y < 0. || uv.y > 1.0 || depth.z > 1.0)
 	{

+ 3 - 3
Babylon/Shaders/shadowMap.fragment.fx

@@ -35,15 +35,15 @@ void main(void)
 	if (texture2D(diffuseSampler, vUV).a < 0.4)
 		discard;
 #endif
-
-#ifdef VSM
 	float depth = vPosition.z / vPosition.w;
+	depth = depth * 0.5 + 0.5;
 
+#ifdef VSM
 	float moment1 = depth;
 	float moment2 = moment1 * moment1;
 
 	gl_FragColor = vec4(packHalf(moment1), packHalf(moment2));
 #else
-	gl_FragColor = pack(vPosition.z / vPosition.w);
+	gl_FragColor = pack(depth);
 #endif
 }

+ 11 - 6
Babylon/Sprites/babylon.spriteManager.js

@@ -1,7 +1,8 @@
 var BABYLON;
 (function (BABYLON) {
     var SpriteManager = (function () {
-        function SpriteManager(name, imgUrl, capacity, cellSize, scene, epsilon) {
+        function SpriteManager(name, imgUrl, capacity, cellSize, scene, epsilon, samplingMode) {
+            if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
             this.name = name;
             this.cellSize = cellSize;
             this.sprites = new Array();
@@ -10,9 +11,13 @@ var BABYLON;
             this._vertexDeclaration = [3, 4, 4, 4];
             this._vertexStrideSize = 15 * 4; // 15 floats per sprite (x, y, z, angle, size, offsetX, offsetY, invertU, invertV, cellIndexX, cellIndexY, color)
             this._capacity = capacity;
-            this._spriteTexture = new BABYLON.Texture(imgUrl, scene, true, false);
+            this._spriteTexture = new BABYLON.Texture(imgUrl, scene, true, false, samplingMode);
             this._spriteTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
             this._spriteTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
+            // temp fix for correct 'pixelated' appearance
+            if (samplingMode === BABYLON.Texture.NEAREST_SAMPLINGMODE) {
+                this._spriteTexture.anisotropicFilteringLevel = 1;
+            }
             this._epsilon = epsilon === undefined ? 0.01 : epsilon;
             this._scene = scene;
             this._scene.spriteManagers.push(this);
@@ -39,13 +44,13 @@ var BABYLON;
         }
         SpriteManager.prototype._appendSpriteVertex = function (index, sprite, offsetX, offsetY, rowSize) {
             var arrayOffset = index * 15;
-            if (offsetX == 0)
+            if (offsetX === 0)
                 offsetX = this._epsilon;
-            else if (offsetX == 1)
+            else if (offsetX === 1)
                 offsetX = 1 - this._epsilon;
-            if (offsetY == 0)
+            if (offsetY === 0)
                 offsetY = this._epsilon;
-            else if (offsetY == 1)
+            else if (offsetY === 1)
                 offsetY = 1 - this._epsilon;
             this._vertices[arrayOffset] = sprite.position.x;
             this._vertices[arrayOffset + 1] = sprite.position.y;

+ 13 - 13
Babylon/Sprites/babylon.spriteManager.ts

@@ -13,20 +13,20 @@
 
         private _vertexDeclaration = [3, 4, 4, 4];
         private _vertexStrideSize = 15 * 4; // 15 floats per sprite (x, y, z, angle, size, offsetX, offsetY, invertU, invertV, cellIndexX, cellIndexY, color)
-        private _vertexBuffer: WebGLBuffer
+        private _vertexBuffer: WebGLBuffer;
         private _indexBuffer: WebGLBuffer;
         private _vertices: Float32Array;
         private _effectBase: Effect;
         private _effectFog: Effect;
 
-        constructor(public name: string, imgUrl: string, capacity: number, public cellSize: number, scene: Scene, epsilon?: number, samplingMode?: number = Texture.TRILINEAR_SAMPLINGMODE) {
+        constructor(public name: string, imgUrl: string, capacity: number, public cellSize: number, scene: Scene, epsilon?: number, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE) {
             this._capacity = capacity;
-            this._spriteTexture = new BABYLON.Texture(imgUrl, scene, true, false, samplingMode);
-            this._spriteTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
-            this._spriteTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
-            
+            this._spriteTexture = new Texture(imgUrl, scene, true, false, samplingMode);
+            this._spriteTexture.wrapU = Texture.CLAMP_ADDRESSMODE;
+            this._spriteTexture.wrapV = Texture.CLAMP_ADDRESSMODE;
+
             // temp fix for correct 'pixelated' appearance
-            if(samplingMode === Texture.NEAREST_SAMPLINGMODE) {
+            if (samplingMode === Texture.NEAREST_SAMPLINGMODE) {
                 this._spriteTexture.anisotropicFilteringLevel = 1;
             }
 
@@ -70,14 +70,14 @@
         private _appendSpriteVertex(index: number, sprite: Sprite, offsetX: number, offsetY: number, rowSize: number): void {
             var arrayOffset = index * 15;
 
-            if (offsetX == 0)
+            if (offsetX === 0)
                 offsetX = this._epsilon;
-            else if (offsetX == 1)
+            else if (offsetX === 1)
                 offsetX = 1 - this._epsilon;
 
-            if (offsetY == 0)
+            if (offsetY === 0)
                 offsetY = this._epsilon;
-            else if (offsetY == 1)
+            else if (offsetY === 1)
                 offsetY = 1 - this._epsilon;
 
             this._vertices[arrayOffset] = sprite.position.x;
@@ -160,9 +160,9 @@
             engine.setColorWrite(true);
             effect.setBool("alphaTest", false);
 
-            engine.setAlphaMode(BABYLON.Engine.ALPHA_COMBINE);
+            engine.setAlphaMode(Engine.ALPHA_COMBINE);
             engine.draw(true, 0, max * 6);
-            engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE);
+            engine.setAlphaMode(Engine.ALPHA_DISABLE);
         }
 
         public dispose(): void {

+ 33 - 33
Babylon/Tools/babylon.sceneSerializer.ts

@@ -1,7 +1,7 @@
 module BABYLON {
 
     var serializeLight = (light: Light): any => {
-        var serializationObject:any = {};
+        var serializationObject: any = {};
         serializationObject.name = light.name;
         serializationObject.id = light.id;
         serializationObject.tags = Tags.GetTags(light);
@@ -53,7 +53,7 @@
     }
 
     var serializeCamera = (camera: Camera): any => {
-        var serializationObject:any = {};
+        var serializationObject: any = {};
         serializationObject.name = camera.name;
         serializationObject.tags = Tags.GetTags(camera);
         serializationObject.id = camera.id;
@@ -164,7 +164,7 @@
     };
 
     var serializeAnimation = (animation: Animation): any => {
-        var serializationObject:any = {};
+        var serializationObject: any = {};
 
         serializationObject.name = animation.name;
         serializationObject.property = animation.targetProperty;
@@ -178,18 +178,18 @@
         for (var index = 0; index < keys.length; index++) {
             var animationKey = keys[index];
 
-            var key:any = {};
+            var key: any = {};
             key.frame = animationKey.frame;
 
             switch (dataType) {
-            case Animation.ANIMATIONTYPE_FLOAT:
-                key.values = [animationKey.value];
-                break;
-            case Animation.ANIMATIONTYPE_QUATERNION:
-            case Animation.ANIMATIONTYPE_MATRIX:
-            case Animation.ANIMATIONTYPE_VECTOR3:
-                key.values = animationKey.value.asArray();
-                break;
+                case Animation.ANIMATIONTYPE_FLOAT:
+                    key.values = [animationKey.value];
+                    break;
+                case Animation.ANIMATIONTYPE_QUATERNION:
+                case Animation.ANIMATIONTYPE_MATRIX:
+                case Animation.ANIMATIONTYPE_VECTOR3:
+                    key.values = animationKey.value.asArray();
+                    break;
             }
 
             serializationObject.keys.push(key);
@@ -199,7 +199,7 @@
     };
 
     var serializeMultiMaterial = (material: MultiMaterial): any => {
-        var serializationObject:any = {};
+        var serializationObject: any = {};
 
         serializationObject.name = material.name;
         serializationObject.id = material.id;
@@ -221,7 +221,7 @@
     };
 
     var serializeMaterial = (material: StandardMaterial): any => {
-        var serializationObject:any = {};
+        var serializationObject: any = {};
 
         serializationObject.name = material.name;
 
@@ -285,7 +285,7 @@
     };
 
     var serializeTexture = (texture: BaseTexture): any => {
-        var serializationObject:any = {};
+        var serializationObject: any = {};
 
         if (!texture.name) {
             return null;
@@ -345,8 +345,8 @@
         return serializationObject;
     };
 
-    var serializeSkeleton = (skeleton:Skeleton): any => {
-        var serializationObject:any = {};
+    var serializeSkeleton = (skeleton: Skeleton): any => {
+        var serializationObject: any = {};
 
         serializationObject.name = skeleton.name;
         serializationObject.id = skeleton.id;
@@ -356,7 +356,7 @@
         for (var index = 0; index < skeleton.bones.length; index++) {
             var bone = skeleton.bones[index];
 
-            var serializedBone:any = {
+            var serializedBone: any = {
                 parentBoneIndex: bone.getParent() ? skeleton.bones.indexOf(bone.getParent()) : -1,
                 name: bone.name,
                 matrix: bone.getLocalMatrix().toArray()
@@ -371,8 +371,8 @@
         return serializationObject;
     };
 
-    var serializeParticleSystem = (particleSystem:ParticleSystem): any => {
-        var serializationObject:any = {};
+    var serializeParticleSystem = (particleSystem: ParticleSystem): any => {
+        var serializationObject: any = {};
 
         serializationObject.emitterId = particleSystem.emitter.id;
         serializationObject.capacity = particleSystem.getCapacity();
@@ -404,8 +404,8 @@
         return serializationObject;
     };
 
-    var serializeLensFlareSystem = (lensFlareSystem:LensFlareSystem):any => {
-        var serializationObject:any = {};
+    var serializeLensFlareSystem = (lensFlareSystem: LensFlareSystem): any => {
+        var serializationObject: any = {};
 
         serializationObject.emitterId = lensFlareSystem.getEmitter().id;
         serializationObject.borderLimit = lensFlareSystem.borderLimit;
@@ -426,8 +426,8 @@
         return serializationObject;
     };
 
-    var serializeShadowGenerator = (light: Light):any => {
-        var serializationObject:any = {};
+    var serializeShadowGenerator = (light: Light): any => {
+        var serializationObject: any = {};
         var shadowGenerator = light.getShadowGenerator();
 
         serializationObject.lightId = light.id;
@@ -607,8 +607,8 @@
         return serializationObject;
     };
 
-    var serializeMesh = (mesh: Mesh, serializationScene: any):any => {
-        var serializationObject:any = {};
+    var serializeMesh = (mesh: Mesh, serializationScene: any): any => {
+        var serializationObject: any = {};
 
         serializationObject.name = mesh.name;
         serializationObject.id = mesh.id;
@@ -690,12 +690,12 @@
             serializationObject.physicsRestitution = mesh.getPhysicsRestitution();
 
             switch (mesh.getPhysicsImpostor()) {
-            case PhysicsEngine.BoxImpostor:
-                serializationObject.physicsImpostor = 1;
-                break;
-            case PhysicsEngine.SphereImpostor:
-                serializationObject.physicsImpostor = 2;
-                break;
+                case PhysicsEngine.BoxImpostor:
+                    serializationObject.physicsImpostor = 1;
+                    break;
+                case PhysicsEngine.SphereImpostor:
+                    serializationObject.physicsImpostor = 2;
+                    break;
             }
         }
 
@@ -728,7 +728,7 @@
 
     export class SceneSerializer {
         public static Serialize(scene: Scene): any {
-            var serializationObject:any = {};
+            var serializationObject: any = {};
 
             // Scene
             serializationObject.useDelayedTextureLoading = scene.useDelayedTextureLoading;

+ 1 - 1
Babylon/babylon.engine.js

@@ -546,7 +546,7 @@ var BABYLON;
         });
         Object.defineProperty(Engine, "Version", {
             get: function () {
-                return "2.0.0";
+                return "2.1.0 alpha";
             },
             enumerable: true,
             configurable: true

+ 1 - 1
Babylon/babylon.engine.ts

@@ -431,7 +431,7 @@
         }
 
         public static get Version(): string {
-            return "2.0.0";
+            return "2.1.0 alpha";
         }
 
         // Updatable statics so stick with vars here

+ 2 - 1
Tools/BuildOurOwnBabylonJS/BuildOurOwnBabylonJS/babylonJS.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<files xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="babylonJS.xsd">
+<files xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="babylonJS.xsd">  
+  <script src="Babylon/PostProcess/babylon.colorCorrectionPostProcess.js"></script>
   <script src="Babylon/PostProcess/babylon.lensRenderingPipeline.js"></script>
   <script src="Babylon/PostProcess/babylon.volumetricLightScatteringPostProcess.js"></script>
   <script src="Babylon/PostProcess/babylon.ssaoRenderingPipeline.js"></script>

+ 2 - 1
Tools/Gulp/gulpfile.js

@@ -183,7 +183,8 @@ gulp.task('scripts', ['shaders'] ,function() {
       '../../Babylon/Rendering/babylon.depthRenderer.js',
       '../../Babylon/PostProcess/babylon.ssaoRenderingPipeline.js',
       '../../Babylon/PostProcess/babylon.volumetricLightScatteringPostProcess.js',
-      '../../Babylon/PostProcess/babylon.lensRenderingPipeline.js'
+      '../../Babylon/PostProcess/babylon.lensRenderingPipeline.js',
+	  '../../Babylon/PostProcess/babylon.colorCorrectionPostProcess.js'
     ])
     .pipe(concat('babylon.js'))
     .pipe(gulp.dest('build/'))

File diff suppressed because it is too large
+ 146 - 36
babylon.2.1-alpha.debug.js


File diff suppressed because it is too large
+ 13 - 13
babylon.2.1-alpha.js