From 317b7fcd3cdabbae41bd99074af7fa2b346935ce Mon Sep 17 00:00:00 2001 From: ChenX Date: Thu, 27 Jun 2019 09:29:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/GraphicsSystem/OutlinePass.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/GraphicsSystem/OutlinePass.ts b/src/GraphicsSystem/OutlinePass.ts index 0906b4c14..44f250406 100644 --- a/src/GraphicsSystem/OutlinePass.ts +++ b/src/GraphicsSystem/OutlinePass.ts @@ -23,12 +23,12 @@ export class OutlinePass extends Pass maskBufferMaterial: MeshBasicMaterial; renderTargetMaskBuffer: WebGLRenderTarget; depthMaterial: MeshDepthMaterial; - prepareMaskMaterial; + prepareMaskMaterial: ShaderMaterial; renderTargetDepthBuffer: WebGLRenderTarget; renderTargetMaskDownSampleBuffer: WebGLRenderTarget; renderTargetBlurBuffer1: WebGLRenderTarget; renderTargetBlurBuffer2: WebGLRenderTarget; - edgeDetectionMaterial; + edgeDetectionMaterial: ShaderMaterial; renderTargetEdgeBuffer1: WebGLRenderTarget; renderTargetEdgeBuffer2: WebGLRenderTarget; separableBlurMaterial1: ShaderMaterial; @@ -38,8 +38,6 @@ export class OutlinePass extends Pass materialCopy: ShaderMaterial; oldClearColor: Color; oldClearAlpha: number; - camera: OrthographicCamera; - scene: Scene; fsQuad: Pass.FullScreenQuad; tempPulseColor1: Color; tempPulseColor2: Color; @@ -63,7 +61,6 @@ export class OutlinePass extends Pass this.downSampleRatio = 2; this.pulsePeriod = 0; - this.resolution = (resolution !== undefined) ? new Vector2(resolution.x, resolution.y) : new Vector2(256, 256); var pars = { minFilter: LinearFilter, magFilter: LinearFilter, format: RGBAFormat }; @@ -147,12 +144,7 @@ export class OutlinePass extends Pass this.oldClearColor = new Color(); this.oldClearAlpha = 1; - this.camera = new OrthographicCamera(- 1, 1, 1, - 1, 0, 1); - this.scene = new Scene(); - this.fsQuad = new Pass.FullScreenQuad(null); - this.fsQuad.frustumCulled = false; // Avoid getting clipped - this.scene.add(this.fsQuad); this.tempPulseColor1 = new Color(); this.tempPulseColor2 = new Color();