Browse Source

OutlinePass: change var to const (#23294)

* change var to const

* remove unused material

* remove unused class (MeshBasicMaterial)
Yao Hsiao 3 years ago
parent
commit
08f0972241
1 changed files with 1 additions and 4 deletions
  1. 1 4
      examples/jsm/postprocessing/OutlinePass.js

+ 1 - 4
examples/jsm/postprocessing/OutlinePass.js

@@ -4,7 +4,6 @@ import {
 	DoubleSide,
 	DoubleSide,
 	LinearFilter,
 	LinearFilter,
 	Matrix4,
 	Matrix4,
-	MeshBasicMaterial,
 	MeshDepthMaterial,
 	MeshDepthMaterial,
 	NoBlending,
 	NoBlending,
 	RGBADepthPacking,
 	RGBADepthPacking,
@@ -46,8 +45,6 @@ class OutlinePass extends Pass {
 		const resx = Math.round( this.resolution.x / this.downSampleRatio );
 		const resx = Math.round( this.resolution.x / this.downSampleRatio );
 		const resy = Math.round( this.resolution.y / this.downSampleRatio );
 		const resy = Math.round( this.resolution.y / this.downSampleRatio );
 
 
-		this.maskBufferMaterial = new MeshBasicMaterial( { color: 0xffffff } );
-		this.maskBufferMaterial.side = DoubleSide;
 		this.renderTargetMaskBuffer = new WebGLRenderTarget( this.resolution.x, this.resolution.y, pars );
 		this.renderTargetMaskBuffer = new WebGLRenderTarget( this.resolution.x, this.resolution.y, pars );
 		this.renderTargetMaskBuffer.texture.name = 'OutlinePass.mask';
 		this.renderTargetMaskBuffer.texture.name = 'OutlinePass.mask';
 		this.renderTargetMaskBuffer.texture.generateMipmaps = false;
 		this.renderTargetMaskBuffer.texture.generateMipmaps = false;
@@ -129,7 +126,7 @@ class OutlinePass extends Pass {
 
 
 		function replaceDepthToViewZ( string, camera ) {
 		function replaceDepthToViewZ( string, camera ) {
 
 
-			var type = camera.isPerspectiveCamera ? 'perspective' : 'orthographic';
+			const type = camera.isPerspectiveCamera ? 'perspective' : 'orthographic';
 
 
 			return string.replace( /DEPTH_TO_VIEW_Z/g, type + 'DepthToViewZ' );
 			return string.replace( /DEPTH_TO_VIEW_Z/g, type + 'DepthToViewZ' );