THREE.EffectComposer=function(e,r){if(this.renderer=e,void 0===r){var t=e.getPixelRatio(),s=Math.floor(e.context.canvas.width/t)||1,i=Math.floor(e.context.canvas.height/t)||1,n={minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBFormat,stencilBuffer:!1};r=new THREE.WebGLRenderTarget(s,i,n)}this.renderTarget1=r,this.normalSceneRenderTarget=r.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.normalSceneRenderTarget,this.passes=[],void 0===THREE.CopyShader,this.copyPass=new THREE.ShaderPass(THREE.CopyShader)},THREE.EffectComposer.prototype={swapBuffers:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e},addPass:function(e){this.passes.push(e)},insertPass:function(e,r){this.passes.splice(r,0,e)},render:function(e){this.writeBuffer=this.renderTarget1,this.readBuffer=this.normalSceneRenderTarget;var r,t,s=!1,i=this.passes.length;for(t=0;t<i;t++)if(r=this.passes[t],r.enabled){if(r.render(this.renderer,this.writeBuffer,this.readBuffer,e,s),r.needsSwap){if(s){var n=this.renderer.context;n.stencilFunc(n.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),n.stencilFunc(n.EQUAL,1,4294967295)}this.swapBuffers()}r instanceof THREE.MaskPass?s=!0:r instanceof THREE.ClearMaskPass&&(s=!1)}},reset:function(e){if(void 0===e){e=this.renderTarget1.clone();var r=this.renderer.getPixelRatio();e.width=Math.floor(this.renderer.context.canvas.width/r),e.height=Math.floor(this.renderer.context.canvas.height/r)}this.renderTarget1.dispose(),this.renderTarget1=e,this.normalSceneRenderTarget.dispose(),this.normalSceneRenderTarget=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.normalSceneRenderTarget},setSize:function(e,r){this.renderTarget1.setSize(e,r),this.normalSceneRenderTarget.setSize(e,r)}};