|
@@ -2,12 +2,10 @@ import {
|
|
|
AdditiveBlending,
|
|
|
Color,
|
|
|
DoubleSide,
|
|
|
- LinearFilter,
|
|
|
Matrix4,
|
|
|
MeshDepthMaterial,
|
|
|
NoBlending,
|
|
|
RGBADepthPacking,
|
|
|
- RGBAFormat,
|
|
|
ShaderMaterial,
|
|
|
UniformsUtils,
|
|
|
Vector2,
|
|
@@ -40,12 +38,10 @@ class OutlinePass extends Pass {
|
|
|
|
|
|
this.resolution = ( resolution !== undefined ) ? new Vector2( resolution.x, resolution.y ) : new Vector2( 256, 256 );
|
|
|
|
|
|
- const pars = { minFilter: LinearFilter, magFilter: LinearFilter, format: RGBAFormat };
|
|
|
-
|
|
|
const resx = Math.round( this.resolution.x / this.downSampleRatio );
|
|
|
const resy = Math.round( this.resolution.y / this.downSampleRatio );
|
|
|
|
|
|
- this.renderTargetMaskBuffer = new WebGLRenderTarget( this.resolution.x, this.resolution.y, pars );
|
|
|
+ this.renderTargetMaskBuffer = new WebGLRenderTarget( this.resolution.x, this.resolution.y );
|
|
|
this.renderTargetMaskBuffer.texture.name = 'OutlinePass.mask';
|
|
|
this.renderTargetMaskBuffer.texture.generateMipmaps = false;
|
|
|
|
|
@@ -58,26 +54,26 @@ class OutlinePass extends Pass {
|
|
|
this.prepareMaskMaterial.side = DoubleSide;
|
|
|
this.prepareMaskMaterial.fragmentShader = replaceDepthToViewZ( this.prepareMaskMaterial.fragmentShader, this.renderCamera );
|
|
|
|
|
|
- this.renderTargetDepthBuffer = new WebGLRenderTarget( this.resolution.x, this.resolution.y, pars );
|
|
|
+ this.renderTargetDepthBuffer = new WebGLRenderTarget( this.resolution.x, this.resolution.y );
|
|
|
this.renderTargetDepthBuffer.texture.name = 'OutlinePass.depth';
|
|
|
this.renderTargetDepthBuffer.texture.generateMipmaps = false;
|
|
|
|
|
|
- this.renderTargetMaskDownSampleBuffer = new WebGLRenderTarget( resx, resy, pars );
|
|
|
+ this.renderTargetMaskDownSampleBuffer = new WebGLRenderTarget( resx, resy );
|
|
|
this.renderTargetMaskDownSampleBuffer.texture.name = 'OutlinePass.depthDownSample';
|
|
|
this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps = false;
|
|
|
|
|
|
- this.renderTargetBlurBuffer1 = new WebGLRenderTarget( resx, resy, pars );
|
|
|
+ this.renderTargetBlurBuffer1 = new WebGLRenderTarget( resx, resy );
|
|
|
this.renderTargetBlurBuffer1.texture.name = 'OutlinePass.blur1';
|
|
|
this.renderTargetBlurBuffer1.texture.generateMipmaps = false;
|
|
|
- this.renderTargetBlurBuffer2 = new WebGLRenderTarget( Math.round( resx / 2 ), Math.round( resy / 2 ), pars );
|
|
|
+ this.renderTargetBlurBuffer2 = new WebGLRenderTarget( Math.round( resx / 2 ), Math.round( resy / 2 ) );
|
|
|
this.renderTargetBlurBuffer2.texture.name = 'OutlinePass.blur2';
|
|
|
this.renderTargetBlurBuffer2.texture.generateMipmaps = false;
|
|
|
|
|
|
this.edgeDetectionMaterial = this.getEdgeDetectionMaterial();
|
|
|
- this.renderTargetEdgeBuffer1 = new WebGLRenderTarget( resx, resy, pars );
|
|
|
+ this.renderTargetEdgeBuffer1 = new WebGLRenderTarget( resx, resy );
|
|
|
this.renderTargetEdgeBuffer1.texture.name = 'OutlinePass.edge1';
|
|
|
this.renderTargetEdgeBuffer1.texture.generateMipmaps = false;
|
|
|
- this.renderTargetEdgeBuffer2 = new WebGLRenderTarget( Math.round( resx / 2 ), Math.round( resy / 2 ), pars );
|
|
|
+ this.renderTargetEdgeBuffer2 = new WebGLRenderTarget( Math.round( resx / 2 ), Math.round( resy / 2 ) );
|
|
|
this.renderTargetEdgeBuffer2.texture.name = 'OutlinePass.edge2';
|
|
|
this.renderTargetEdgeBuffer2.texture.generateMipmaps = false;
|
|
|
|