Bläddra i källkod

Build + bug fix in PP rendering pipeline

David Catuhe 9 år sedan
förälder
incheckning
b7b05d78ee

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 15 - 15
dist/preview release/babylon.core.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 2454 - 2433
dist/preview release/babylon.d.ts


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 21 - 21
dist/preview release/babylon.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 186 - 103
dist/preview release/babylon.max.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 31 - 31
dist/preview release/babylon.noworker.js


+ 4 - 0
src/Bones/babylon.skeleton.js

@@ -272,6 +272,7 @@ var BABYLON;
             var serializationObject = {};
             var serializationObject = {};
             serializationObject.name = this.name;
             serializationObject.name = this.name;
             serializationObject.id = this.id;
             serializationObject.id = this.id;
+            serializationObject.dimensionsAtRest = this.dimensionsAtRest;
             serializationObject.bones = [];
             serializationObject.bones = [];
             serializationObject.needInitialSkinMatrix = this.needInitialSkinMatrix;
             serializationObject.needInitialSkinMatrix = this.needInitialSkinMatrix;
             for (var index = 0; index < this.bones.length; index++) {
             for (var index = 0; index < this.bones.length; index++) {
@@ -302,6 +303,9 @@ var BABYLON;
         };
         };
         Skeleton.Parse = function (parsedSkeleton, scene) {
         Skeleton.Parse = function (parsedSkeleton, scene) {
             var skeleton = new Skeleton(parsedSkeleton.name, parsedSkeleton.id, scene);
             var skeleton = new Skeleton(parsedSkeleton.name, parsedSkeleton.id, scene);
+            if (parsedSkeleton.dimensionsAtRest) {
+                skeleton.dimensionsAtRest = BABYLON.Vector3.FromArray(parsedSkeleton.dimensionsAtRest);
+            }
             skeleton.needInitialSkinMatrix = parsedSkeleton.needInitialSkinMatrix;
             skeleton.needInitialSkinMatrix = parsedSkeleton.needInitialSkinMatrix;
             var index;
             var index;
             for (index = 0; index < parsedSkeleton.bones.length; index++) {
             for (index = 0; index < parsedSkeleton.bones.length; index++) {

+ 20 - 16
src/Bones/babylon.skeleton.ts

@@ -1,7 +1,7 @@
 module BABYLON {
 module BABYLON {
     export class Skeleton {
     export class Skeleton {
         public bones = new Array<Bone>();
         public bones = new Array<Bone>();
-
+        public dimensionsAtRest: Vector3;
         public needInitialSkinMatrix = false;
         public needInitialSkinMatrix = false;
 
 
         private _scene: Scene;
         private _scene: Scene;
@@ -41,23 +41,23 @@
         /**
         /**
          * @param {boolean} fullDetails - support for multiple levels of logging within scene loading
          * @param {boolean} fullDetails - support for multiple levels of logging within scene loading
          */
          */
-        public toString(fullDetails? : boolean) : string {
+        public toString(fullDetails?: boolean): string {
             var ret = `Name: ${this.name}, nBones: ${this.bones.length}`;
             var ret = `Name: ${this.name}, nBones: ${this.bones.length}`;
             ret += `, nAnimationRanges: ${this._ranges ? Object.keys(this._ranges).length : "none"}`;
             ret += `, nAnimationRanges: ${this._ranges ? Object.keys(this._ranges).length : "none"}`;
             if (fullDetails) {
             if (fullDetails) {
-                ret += ", Ranges: {"; 
+                ret += ", Ranges: {";
                 let first = true;
                 let first = true;
                 for (let name in this._ranges) {
                 for (let name in this._ranges) {
                     if (first) {
                     if (first) {
                         ret += ", ";
                         ret += ", ";
-                        first = false; 
+                        first = false;
                     }
                     }
-                    ret += name; 
+                    ret += name;
                 }
                 }
                 ret += "}";
                 ret += "}";
             }
             }
             return ret;
             return ret;
-        } 
+        }
 
 
         /**
         /**
         * Get bone's index searching by name
         * Get bone's index searching by name
@@ -72,7 +72,7 @@
             }
             }
             return -1;
             return -1;
         }
         }
-        
+
         public createAnimationRange(name: string, from: number, to: number): void {
         public createAnimationRange(name: string, from: number, to: number): void {
             // check name not already in use
             // check name not already in use
             if (!this._ranges[name]) {
             if (!this._ranges[name]) {
@@ -97,15 +97,15 @@
         public getAnimationRange(name: string): AnimationRange {
         public getAnimationRange(name: string): AnimationRange {
             return this._ranges[name];
             return this._ranges[name];
         }
         }
-        
+
         /**
         /**
          *  Returns as an Array, all AnimationRanges defined on this skeleton
          *  Returns as an Array, all AnimationRanges defined on this skeleton
          */
          */
         public getAnimationRanges(): AnimationRange[] {
         public getAnimationRanges(): AnimationRange[] {
-            var animationRanges :  AnimationRange[] = [];
-            var name : string;
+            var animationRanges: AnimationRange[] = [];
+            var name: string;
             var i: number = 0;
             var i: number = 0;
-            for (name in this._ranges){
+            for (name in this._ranges) {
                 animationRanges[i] = this._ranges[name];
                 animationRanges[i] = this._ranges[name];
                 i++;
                 i++;
             }
             }
@@ -121,7 +121,7 @@
             }
             }
             var ret = true;
             var ret = true;
             var frameOffset = this._getHighestAnimationFrame() + 1;
             var frameOffset = this._getHighestAnimationFrame() + 1;
-            
+
             // make a dictionary of source skeleton's bones, so exact same order or doublely nested loop is not required
             // make a dictionary of source skeleton's bones, so exact same order or doublely nested loop is not required
             var boneDict = {};
             var boneDict = {};
             var sourceBones = source.bones;
             var sourceBones = source.bones;
@@ -131,11 +131,11 @@
                 boneDict[sourceBones[i].name] = sourceBones[i];
                 boneDict[sourceBones[i].name] = sourceBones[i];
             }
             }
 
 
-            if (this.bones.length !== sourceBones.length){
+            if (this.bones.length !== sourceBones.length) {
                 Tools.Warn(`copyAnimationRange: this rig has ${this.bones.length} bones, while source as ${sourceBones.length}`);
                 Tools.Warn(`copyAnimationRange: this rig has ${this.bones.length} bones, while source as ${sourceBones.length}`);
                 ret = false;
                 ret = false;
             }
             }
-            
+
             for (i = 0, nBones = this.bones.length; i < nBones; i++) {
             for (i = 0, nBones = this.bones.length; i < nBones; i++) {
                 var boneName = this.bones[i].name;
                 var boneName = this.bones[i].name;
                 var sourceBone = boneDict[boneName];
                 var sourceBone = boneDict[boneName];
@@ -325,6 +325,7 @@
 
 
             serializationObject.name = this.name;
             serializationObject.name = this.name;
             serializationObject.id = this.id;
             serializationObject.id = this.id;
+            serializationObject.dimensionsAtRest = this.dimensionsAtRest;
 
 
             serializationObject.bones = [];
             serializationObject.bones = [];
 
 
@@ -364,6 +365,9 @@
 
 
         public static Parse(parsedSkeleton: any, scene: Scene): Skeleton {
         public static Parse(parsedSkeleton: any, scene: Scene): Skeleton {
             var skeleton = new Skeleton(parsedSkeleton.name, parsedSkeleton.id, scene);
             var skeleton = new Skeleton(parsedSkeleton.name, parsedSkeleton.id, scene);
+            if (parsedSkeleton.dimensionsAtRest) {
+                skeleton.dimensionsAtRest = Vector3.FromArray(parsedSkeleton.dimensionsAtRest);
+            }
 
 
             skeleton.needInitialSkinMatrix = parsedSkeleton.needInitialSkinMatrix;
             skeleton.needInitialSkinMatrix = parsedSkeleton.needInitialSkinMatrix;
 
 
@@ -386,7 +390,7 @@
                     bone.animations.push(Animation.Parse(parsedBone.animation));
                     bone.animations.push(Animation.Parse(parsedBone.animation));
                 }
                 }
             }
             }
-            
+
             // placed after bones, so createAnimationRange can cascade down
             // placed after bones, so createAnimationRange can cascade down
             if (parsedSkeleton.ranges) {
             if (parsedSkeleton.ranges) {
                 for (index = 0; index < parsedSkeleton.ranges.length; index++) {
                 for (index = 0; index < parsedSkeleton.ranges.length; index++) {
@@ -397,4 +401,4 @@
             return skeleton;
             return skeleton;
         }
         }
     }
     }
-}
+}

+ 3 - 0
src/Cameras/babylon.camera.js

@@ -247,6 +247,9 @@ var BABYLON;
                     cam._postProcesses = this._postProcesses.slice(0).concat(rigPostProcess);
                     cam._postProcesses = this._postProcesses.slice(0).concat(rigPostProcess);
                     rigPostProcess.markTextureDirty();
                     rigPostProcess.markTextureDirty();
                 }
                 }
+                else {
+                    cam._postProcesses = this._postProcesses.slice(0);
+                }
             }
             }
         };
         };
         Camera.prototype.attachPostProcess = function (postProcess, insertAt) {
         Camera.prototype.attachPostProcess = function (postProcess, insertAt) {

+ 37 - 38
src/Cameras/babylon.camera.ts

@@ -1,7 +1,7 @@
 module BABYLON {
 module BABYLON {
     export class Camera extends Node {
     export class Camera extends Node {
         public inputs: CameraInputsManager<Camera>;
         public inputs: CameraInputsManager<Camera>;
-        
+
         // Statics
         // Statics
         private static _PERSPECTIVE_CAMERA = 0;
         private static _PERSPECTIVE_CAMERA = 0;
         private static _ORTHOGRAPHIC_CAMERA = 1;
         private static _ORTHOGRAPHIC_CAMERA = 1;
@@ -57,7 +57,7 @@
         }
         }
 
 
         public static ForceAttachControlToAlwaysPreventDefault = false;
         public static ForceAttachControlToAlwaysPreventDefault = false;
-        
+
         // Members
         // Members
         @serializeAsVector3()
         @serializeAsVector3()
         public position: Vector3;
         public position: Vector3;
@@ -100,7 +100,7 @@
 
 
         @serialize()
         @serialize()
         public fovMode: number = Camera.FOVMODE_VERTICAL_FIXED;
         public fovMode: number = Camera.FOVMODE_VERTICAL_FIXED;
-   
+
         // Camera rig members
         // Camera rig members
         @serialize()
         @serialize()
         public cameraRigMode = Camera.RIG_MODE_NONE;
         public cameraRigMode = Camera.RIG_MODE_NONE;
@@ -113,7 +113,7 @@
 
 
         public _cameraRigParams: any;
         public _cameraRigParams: any;
         public _rigCameras = new Array<Camera>();
         public _rigCameras = new Array<Camera>();
-        public _rigPostProcess : PostProcess;
+        public _rigPostProcess: PostProcess;
 
 
         // Cache
         // Cache
         private _computedViewMatrix = Matrix.Identity();
         private _computedViewMatrix = Matrix.Identity();
@@ -274,27 +274,30 @@
 
 
         public _checkInputs(): void {
         public _checkInputs(): void {
         }
         }
-        
-        private _cascadePostProcessesToRigCams() : void {
+
+        private _cascadePostProcessesToRigCams(): void {
             // invalidate framebuffer
             // invalidate framebuffer
-            if (this._postProcesses.length > 0){
+            if (this._postProcesses.length > 0) {
                 this._postProcesses[0].markTextureDirty();
                 this._postProcesses[0].markTextureDirty();
             }
             }
-            
+
             // glue the rigPostProcess to the end of the user postprocesses & assign to each sub-camera
             // glue the rigPostProcess to the end of the user postprocesses & assign to each sub-camera
-            for(var i = 0, len = this._rigCameras.length; i < len; i++){
+            for (var i = 0, len = this._rigCameras.length; i < len; i++) {
                 var cam = this._rigCameras[i];
                 var cam = this._rigCameras[i];
                 var rigPostProcess = cam._rigPostProcess;
                 var rigPostProcess = cam._rigPostProcess;
-                
+
                 // for VR rig, there does not have to be a post process 
                 // for VR rig, there does not have to be a post process 
-                if (rigPostProcess){
+                if (rigPostProcess) {
                     var isPass = rigPostProcess instanceof PassPostProcess;
                     var isPass = rigPostProcess instanceof PassPostProcess;
-                    if (isPass){
+                    if (isPass) {
                         // any rig which has a PassPostProcess for rig[0], cannot be isIntermediate when there are also user postProcesses
                         // any rig which has a PassPostProcess for rig[0], cannot be isIntermediate when there are also user postProcesses
                         cam.isIntermediate = this._postProcesses.length === 0;
                         cam.isIntermediate = this._postProcesses.length === 0;
-                    }               
+                    }
                     cam._postProcesses = this._postProcesses.slice(0).concat(rigPostProcess);
                     cam._postProcesses = this._postProcesses.slice(0).concat(rigPostProcess);
                     rigPostProcess.markTextureDirty();
                     rigPostProcess.markTextureDirty();
+
+                } else {
+                    cam._postProcesses = this._postProcesses.slice(0);
                 }
                 }
             }
             }
         }
         }
@@ -304,17 +307,17 @@
                 Tools.Error("You're trying to reuse a post process not defined as reusable.");
                 Tools.Error("You're trying to reuse a post process not defined as reusable.");
                 return 0;
                 return 0;
             }
             }
-            
+
             if (insertAt == null || insertAt < 0) {
             if (insertAt == null || insertAt < 0) {
                 this._postProcesses.push(postProcess);
                 this._postProcesses.push(postProcess);
-                
-            }else{
+
+            } else {
                 this._postProcesses.splice(insertAt, 0, postProcess);
                 this._postProcesses.splice(insertAt, 0, postProcess);
             }
             }
             this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated            
             this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated            
             return this._postProcesses.indexOf(postProcess);
             return this._postProcesses.indexOf(postProcess);
         }
         }
-        
+
         public detachPostProcess(postProcess: PostProcess, atIndices: any = null): number[] {
         public detachPostProcess(postProcess: PostProcess, atIndices: any = null): number[] {
             var result = [];
             var result = [];
             var i: number;
             var i: number;
@@ -322,14 +325,14 @@
 
 
             if (!atIndices) {
             if (!atIndices) {
                 var idx = this._postProcesses.indexOf(postProcess);
                 var idx = this._postProcesses.indexOf(postProcess);
-                if (idx !== -1){
+                if (idx !== -1) {
                     this._postProcesses.splice(idx, 1);
                     this._postProcesses.splice(idx, 1);
                 }
                 }
             } else {
             } else {
                 atIndices = (atIndices instanceof Array) ? atIndices : [atIndices];
                 atIndices = (atIndices instanceof Array) ? atIndices : [atIndices];
                 // iterate descending, so can just splice as we go
                 // iterate descending, so can just splice as we go
                 for (i = atIndices.length - 1; i >= 0; i--) {
                 for (i = atIndices.length - 1; i >= 0; i--) {
-                    if ( this._postProcesses[atIndices[i]] !== postProcess) {
+                    if (this._postProcesses[atIndices[i]] !== postProcess) {
                         result.push(i);
                         result.push(i);
                         continue;
                         continue;
                     }
                     }
@@ -339,7 +342,7 @@
             this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated
             this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated
             return result;
             return result;
         }
         }
-        
+
         public getWorldMatrix(): Matrix {
         public getWorldMatrix(): Matrix {
             if (!this._worldMatrix) {
             if (!this._worldMatrix) {
                 this._worldMatrix = Matrix.Identity();
                 this._worldMatrix = Matrix.Identity();
@@ -434,7 +437,7 @@
 
 
             super.dispose();
             super.dispose();
         }
         }
-        
+
         // ---- Camera rigs section ----
         // ---- Camera rigs section ----
         public setCameraRigMode(mode: number, rigParams: any): void {
         public setCameraRigMode(mode: number, rigParams: any): void {
             while (this._rigCameras.length > 0) {
             while (this._rigCameras.length > 0) {
@@ -448,7 +451,7 @@
             this._cameraRigParams.stereoHalfAngle = BABYLON.Tools.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637);
             this._cameraRigParams.stereoHalfAngle = BABYLON.Tools.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637);
 
 
             // create the rig cameras, unless none
             // create the rig cameras, unless none
-            if (this.cameraRigMode !== Camera.RIG_MODE_NONE){
+            if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {
                 this._rigCameras.push(this.createRigCamera(this.name + "_L", 0));
                 this._rigCameras.push(this.createRigCamera(this.name + "_L", 0));
                 this._rigCameras.push(this.createRigCamera(this.name + "_R", 1));
                 this._rigCameras.push(this.createRigCamera(this.name + "_R", 1));
             }
             }
@@ -463,14 +466,14 @@
                 case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
                 case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
                 case Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:
                 case Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:
                     var isStereoscopicHoriz = this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL || this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;
                     var isStereoscopicHoriz = this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL || this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;
-                    
+
                     this._rigCameras[0]._rigPostProcess = new PassPostProcess(this.name + "_passthru", 1.0, this._rigCameras[0]);
                     this._rigCameras[0]._rigPostProcess = new PassPostProcess(this.name + "_passthru", 1.0, this._rigCameras[0]);
                     this._rigCameras[1]._rigPostProcess = new StereoscopicInterlacePostProcess(this.name + "_stereoInterlace", this._rigCameras, isStereoscopicHoriz);
                     this._rigCameras[1]._rigPostProcess = new StereoscopicInterlacePostProcess(this.name + "_stereoInterlace", this._rigCameras, isStereoscopicHoriz);
                     break;
                     break;
 
 
                 case Camera.RIG_MODE_VR:
                 case Camera.RIG_MODE_VR:
                     var metrics = rigParams.vrCameraMetrics || VRCameraMetrics.GetDefault();
                     var metrics = rigParams.vrCameraMetrics || VRCameraMetrics.GetDefault();
-                    
+
                     this._rigCameras[0]._cameraRigParams.vrMetrics = metrics;
                     this._rigCameras[0]._cameraRigParams.vrMetrics = metrics;
                     this._rigCameras[0].viewport = new Viewport(0, 0, 0.5, 1.0);
                     this._rigCameras[0].viewport = new Viewport(0, 0, 0.5, 1.0);
                     this._rigCameras[0]._cameraRigParams.vrWorkMatrix = new Matrix();
                     this._rigCameras[0]._cameraRigParams.vrWorkMatrix = new Matrix();
@@ -492,7 +495,7 @@
                     break;
                     break;
             }
             }
 
 
-            this._cascadePostProcessesToRigCams(); 
+            this._cascadePostProcessesToRigCams();
             this._update();
             this._update();
         }
         }
 
 
@@ -503,8 +506,8 @@
         }
         }
 
 
         public setCameraRigParameter(name: string, value: any) {
         public setCameraRigParameter(name: string, value: any) {
-            if (!this._cameraRigParams){
-               this._cameraRigParams = {}; 
+            if (!this._cameraRigParams) {
+                this._cameraRigParams = {};
             }
             }
             this._cameraRigParams[name] = value;
             this._cameraRigParams[name] = value;
             //provisionnally:
             //provisionnally:
@@ -512,14 +515,14 @@
                 this._cameraRigParams.stereoHalfAngle = Tools.ToRadians(value / 0.0637);
                 this._cameraRigParams.stereoHalfAngle = Tools.ToRadians(value / 0.0637);
             }
             }
         }
         }
-        
+
         /**
         /**
          * needs to be overridden by children so sub has required properties to be copied
          * needs to be overridden by children so sub has required properties to be copied
          */
          */
         public createRigCamera(name: string, cameraIndex: number): Camera {
         public createRigCamera(name: string, cameraIndex: number): Camera {
-           return null;
+            return null;
         }
         }
-        
+
         /**
         /**
          * May need to be overridden by children
          * May need to be overridden by children
          */
          */
@@ -529,7 +532,7 @@
                 this._rigCameras[i].maxZ = this.maxZ;
                 this._rigCameras[i].maxZ = this.maxZ;
                 this._rigCameras[i].fov = this.fov;
                 this._rigCameras[i].fov = this.fov;
             }
             }
-            
+
             // only update viewport when ANAGLYPH
             // only update viewport when ANAGLYPH
             if (this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH) {
             if (this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH) {
                 this._rigCameras[0].viewport = this._rigCameras[1].viewport = this.viewport;
                 this._rigCameras[0].viewport = this._rigCameras[1].viewport = this.viewport;
@@ -621,14 +624,14 @@
             if (parsedCamera.parentId) {
             if (parsedCamera.parentId) {
                 camera._waitingParentId = parsedCamera.parentId;
                 camera._waitingParentId = parsedCamera.parentId;
             }
             }
-            
+
             //If camera has an input manager, let it parse inputs settings
             //If camera has an input manager, let it parse inputs settings
             if (camera.inputs) {
             if (camera.inputs) {
                 camera.inputs.parse(parsedCamera);
                 camera.inputs.parse(parsedCamera);
 
 
                 camera._setupInputs();
                 camera._setupInputs();
             }
             }
-            
+
             // Target
             // Target
             if (parsedCamera.target) {
             if (parsedCamera.target) {
                 if ((<any>camera).setTarget) {
                 if ((<any>camera).setTarget) {
@@ -659,8 +662,4 @@
             return camera;
             return camera;
         }
         }
     }
     }
-}
-
-
-
-
+}

+ 2 - 12
src/PostProcess/babylon.ssaoRenderingPipeline.js

@@ -140,16 +140,6 @@ var BABYLON;
                 this._scene.disableDepthRenderer();
                 this._scene.disableDepthRenderer();
             this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras);
             this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras);
         };
         };
-        // Serialize rendering pipeline
-        SSAORenderingPipeline.prototype.serialize = function () {
-            var serializationObject = BABYLON.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
-            serializationObject.customType = "BABYLON.SSAORenderingPipeline";
-            return serializationObject;
-        };
-        // Parse serialized pipeline
-        SSAORenderingPipeline.Parse = function (source, scene, rootUrl) {
-            return BABYLON.SerializationHelper.Parse(function () { return new SSAORenderingPipeline(source._name, scene, source._ratio); }, source, scene, rootUrl);
-        };
         // Private Methods
         // Private Methods
         SSAORenderingPipeline.prototype._createBlurPostProcess = function (ratio) {
         SSAORenderingPipeline.prototype._createBlurPostProcess = function (ratio) {
             var _this = this;
             var _this = this;
@@ -165,7 +155,7 @@ var BABYLON;
             for (var i = -8; i < 8; i++) {
             for (var i = -8; i < 8; i++) {
                 samplerOffsets.push(i * 2);
                 samplerOffsets.push(i * 2);
             }
             }
-            this._blurHPostProcess = new BABYLON.PostProcess("BlurH", "ssao", ["outSize", "samplerOffsets"], ["depthSampler"], ratio, null, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, "#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 9");
+            this._blurHPostProcess = new BABYLON.PostProcess("BlurH", "ssao", ["outSize", "samplerOffsets"], ["depthSampler"], ratio, null, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, "#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16");
             this._blurHPostProcess.onApply = function (effect) {
             this._blurHPostProcess.onApply = function (effect) {
                 effect.setFloat("outSize", _this._ssaoCombinePostProcess.width);
                 effect.setFloat("outSize", _this._ssaoCombinePostProcess.width);
                 effect.setTexture("depthSampler", _this._depthTexture);
                 effect.setTexture("depthSampler", _this._depthTexture);
@@ -173,7 +163,7 @@ var BABYLON;
                     effect.setArray("samplerOffsets", samplerOffsets);
                     effect.setArray("samplerOffsets", samplerOffsets);
                 }
                 }
             };
             };
-            this._blurVPostProcess = new BABYLON.PostProcess("BlurV", "ssao", ["outSize", "samplerOffsets"], ["depthSampler"], ratio, null, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, "#define BILATERAL_BLUR\n#define SAMPLES 9");
+            this._blurVPostProcess = new BABYLON.PostProcess("BlurV", "ssao", ["outSize", "samplerOffsets"], ["depthSampler"], ratio, null, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, "#define BILATERAL_BLUR\n#define SAMPLES 16");
             this._blurVPostProcess.onApply = function (effect) {
             this._blurVPostProcess.onApply = function (effect) {
                 effect.setFloat("outSize", _this._ssaoCombinePostProcess.height);
                 effect.setFloat("outSize", _this._ssaoCombinePostProcess.height);
                 effect.setTexture("depthSampler", _this._depthTexture);
                 effect.setTexture("depthSampler", _this._depthTexture);

+ 2 - 15
src/PostProcess/babylon.ssaoRenderingPipeline.ts

@@ -166,19 +166,6 @@
             this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras);
             this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras);
         }
         }
 
 
-        // Serialize rendering pipeline
-        public serialize(): any {
-            var serializationObject = SerializationHelper.Serialize(this, super.serialize());
-            serializationObject.customType = "BABYLON.SSAORenderingPipeline";
-
-            return serializationObject;
-        }
-
-        // Parse serialized pipeline
-        public static Parse(source: any, scene: Scene, rootUrl: string): SSAORenderingPipeline {
-            return SerializationHelper.Parse(() => new SSAORenderingPipeline(source._name, scene, source._ratio), source, scene, rootUrl);
-        }
-
         // Private Methods
         // Private Methods
         private _createBlurPostProcess(ratio: number): void {
         private _createBlurPostProcess(ratio: number): void {
             /*
             /*
@@ -195,7 +182,7 @@
                 samplerOffsets.push(i * 2);
                 samplerOffsets.push(i * 2);
             }
             }
 
 
-            this._blurHPostProcess = new PostProcess("BlurH", "ssao", ["outSize", "samplerOffsets"], ["depthSampler"], ratio, null, Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, "#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 9");
+            this._blurHPostProcess = new PostProcess("BlurH", "ssao", ["outSize", "samplerOffsets"], ["depthSampler"], ratio, null, Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, "#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16");
             this._blurHPostProcess.onApply = (effect: Effect) => {
             this._blurHPostProcess.onApply = (effect: Effect) => {
                 effect.setFloat("outSize", this._ssaoCombinePostProcess.width);
                 effect.setFloat("outSize", this._ssaoCombinePostProcess.width);
                 effect.setTexture("depthSampler", this._depthTexture);
                 effect.setTexture("depthSampler", this._depthTexture);
@@ -205,7 +192,7 @@
                 }
                 }
             };
             };
 
 
-            this._blurVPostProcess = new PostProcess("BlurV", "ssao", ["outSize", "samplerOffsets"], ["depthSampler"], ratio, null, Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, "#define BILATERAL_BLUR\n#define SAMPLES 9");
+            this._blurVPostProcess = new PostProcess("BlurV", "ssao", ["outSize", "samplerOffsets"], ["depthSampler"], ratio, null, Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, "#define BILATERAL_BLUR\n#define SAMPLES 16");
             this._blurVPostProcess.onApply = (effect: Effect) => {
             this._blurVPostProcess.onApply = (effect: Effect) => {
                 effect.setFloat("outSize", this._ssaoCombinePostProcess.height);
                 effect.setFloat("outSize", this._ssaoCombinePostProcess.height);
                 effect.setTexture("depthSampler", this._depthTexture);
                 effect.setTexture("depthSampler", this._depthTexture);