Forráskód Böngészése

Addons: Disable depth buffer when possible. (#34043)

Michael Herzog 1 hete
szülő
commit
e5342d2571

+ 4 - 2
examples/jsm/postprocessing/AfterimagePass.js

@@ -76,12 +76,14 @@ class AfterimagePass extends Pass {
 
 
 		this._textureComp = new WebGLRenderTarget( window.innerWidth, window.innerHeight, {
 		this._textureComp = new WebGLRenderTarget( window.innerWidth, window.innerHeight, {
 			magFilter: NearestFilter,
 			magFilter: NearestFilter,
-			type: HalfFloatType
+			type: HalfFloatType,
+			depthBuffer: false
 		} );
 		} );
 
 
 		this._textureOld = new WebGLRenderTarget( window.innerWidth, window.innerHeight, {
 		this._textureOld = new WebGLRenderTarget( window.innerWidth, window.innerHeight, {
 			magFilter: NearestFilter,
 			magFilter: NearestFilter,
-			type: HalfFloatType
+			type: HalfFloatType,
+			depthBuffer: false
 		} );
 		} );
 
 
 		this._compFsQuad = new FullScreenQuad( this.compFsMaterial );
 		this._compFsQuad = new FullScreenQuad( this.compFsMaterial );

+ 2 - 2
examples/jsm/postprocessing/BloomPass.js

@@ -104,9 +104,9 @@ class BloomPass extends Pass {
 
 
 		// internals
 		// internals
 
 
-		this._renderTargetX = new WebGLRenderTarget( 1, 1, { type: HalfFloatType } ); // will be resized later
+		this._renderTargetX = new WebGLRenderTarget( 1, 1, { type: HalfFloatType, depthBuffer: false } ); // will be resized later
 		this._renderTargetX.texture.name = 'BloomPass.x';
 		this._renderTargetX.texture.name = 'BloomPass.x';
-		this._renderTargetY = new WebGLRenderTarget( 1, 1, { type: HalfFloatType } ); // will be resized later
+		this._renderTargetY = new WebGLRenderTarget( 1, 1, { type: HalfFloatType, depthBuffer: false } ); // will be resized later
 		this._renderTargetY.texture.name = 'BloomPass.y';
 		this._renderTargetY.texture.name = 'BloomPass.y';
 
 
 		this._fsQuad = new FullScreenQuad( null );
 		this._fsQuad = new FullScreenQuad( null );

+ 1 - 1
examples/jsm/postprocessing/GTAOPass.js

@@ -140,7 +140,7 @@ class GTAOPass extends Pass {
 		this.gtaoNoiseTexture = generateMagicSquareNoise();
 		this.gtaoNoiseTexture = generateMagicSquareNoise();
 		this.pdNoiseTexture = this._generateNoise();
 		this.pdNoiseTexture = this._generateNoise();
 
 
-		this.gtaoRenderTarget = new WebGLRenderTarget( this.width, this.height, { type: HalfFloatType } );
+		this.gtaoRenderTarget = new WebGLRenderTarget( this.width, this.height, { type: HalfFloatType, depthBuffer: false } );
 		this.pdRenderTarget = this.gtaoRenderTarget.clone();
 		this.pdRenderTarget = this.gtaoRenderTarget.clone();
 
 
 		this.gtaoMaterial = new ShaderMaterial( {
 		this.gtaoMaterial = new ShaderMaterial( {

+ 5 - 5
examples/jsm/postprocessing/OutlinePass.js

@@ -170,22 +170,22 @@ class OutlinePass extends Pass {
 		this.renderTargetDepthBuffer.texture.name = 'OutlinePass.depth';
 		this.renderTargetDepthBuffer.texture.name = 'OutlinePass.depth';
 		this.renderTargetDepthBuffer.texture.generateMipmaps = false;
 		this.renderTargetDepthBuffer.texture.generateMipmaps = false;
 
 
-		this.renderTargetMaskDownSampleBuffer = new WebGLRenderTarget( resx, resy, { type: HalfFloatType } );
+		this.renderTargetMaskDownSampleBuffer = new WebGLRenderTarget( resx, resy, { type: HalfFloatType, depthBuffer: false } );
 		this.renderTargetMaskDownSampleBuffer.texture.name = 'OutlinePass.depthDownSample';
 		this.renderTargetMaskDownSampleBuffer.texture.name = 'OutlinePass.depthDownSample';
 		this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps = false;
 		this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps = false;
 
 
-		this.renderTargetBlurBuffer1 = new WebGLRenderTarget( resx, resy, { type: HalfFloatType } );
+		this.renderTargetBlurBuffer1 = new WebGLRenderTarget( resx, resy, { type: HalfFloatType, depthBuffer: false } );
 		this.renderTargetBlurBuffer1.texture.name = 'OutlinePass.blur1';
 		this.renderTargetBlurBuffer1.texture.name = 'OutlinePass.blur1';
 		this.renderTargetBlurBuffer1.texture.generateMipmaps = false;
 		this.renderTargetBlurBuffer1.texture.generateMipmaps = false;
-		this.renderTargetBlurBuffer2 = new WebGLRenderTarget( Math.round( resx / 2 ), Math.round( resy / 2 ), { type: HalfFloatType } );
+		this.renderTargetBlurBuffer2 = new WebGLRenderTarget( Math.round( resx / 2 ), Math.round( resy / 2 ), { type: HalfFloatType, depthBuffer: false } );
 		this.renderTargetBlurBuffer2.texture.name = 'OutlinePass.blur2';
 		this.renderTargetBlurBuffer2.texture.name = 'OutlinePass.blur2';
 		this.renderTargetBlurBuffer2.texture.generateMipmaps = false;
 		this.renderTargetBlurBuffer2.texture.generateMipmaps = false;
 
 
 		this.edgeDetectionMaterial = this._getEdgeDetectionMaterial();
 		this.edgeDetectionMaterial = this._getEdgeDetectionMaterial();
-		this.renderTargetEdgeBuffer1 = new WebGLRenderTarget( resx, resy, { type: HalfFloatType } );
+		this.renderTargetEdgeBuffer1 = new WebGLRenderTarget( resx, resy, { type: HalfFloatType, depthBuffer: false } );
 		this.renderTargetEdgeBuffer1.texture.name = 'OutlinePass.edge1';
 		this.renderTargetEdgeBuffer1.texture.name = 'OutlinePass.edge1';
 		this.renderTargetEdgeBuffer1.texture.generateMipmaps = false;
 		this.renderTargetEdgeBuffer1.texture.generateMipmaps = false;
-		this.renderTargetEdgeBuffer2 = new WebGLRenderTarget( Math.round( resx / 2 ), Math.round( resy / 2 ), { type: HalfFloatType } );
+		this.renderTargetEdgeBuffer2 = new WebGLRenderTarget( Math.round( resx / 2 ), Math.round( resy / 2 ), { type: HalfFloatType, depthBuffer: false } );
 		this.renderTargetEdgeBuffer2.texture.name = 'OutlinePass.edge2';
 		this.renderTargetEdgeBuffer2.texture.name = 'OutlinePass.edge2';
 		this.renderTargetEdgeBuffer2.texture.generateMipmaps = false;
 		this.renderTargetEdgeBuffer2.texture.generateMipmaps = false;
 
 

+ 1 - 1
examples/jsm/postprocessing/SAOPass.js

@@ -108,7 +108,7 @@ class SAOPass extends Pass {
 		 */
 		 */
 		this.resolution = new Vector2( resolution.x, resolution.y );
 		this.resolution = new Vector2( resolution.x, resolution.y );
 
 
-		this.saoRenderTarget = new WebGLRenderTarget( this.resolution.x, this.resolution.y, { type: HalfFloatType } );
+		this.saoRenderTarget = new WebGLRenderTarget( this.resolution.x, this.resolution.y, { type: HalfFloatType, depthBuffer: false } );
 		this.blurIntermediateRenderTarget = this.saoRenderTarget.clone();
 		this.blurIntermediateRenderTarget = this.saoRenderTarget.clone();
 
 
 		const depthTexture = new DepthTexture();
 		const depthTexture = new DepthTexture();

+ 1 - 1
examples/jsm/postprocessing/SSAOPass.js

@@ -163,7 +163,7 @@ class SSAOPass extends Pass {
 
 
 		// ssao render target
 		// ssao render target
 
 
-		this.ssaoRenderTarget = new WebGLRenderTarget( this.width, this.height, { type: HalfFloatType } );
+		this.ssaoRenderTarget = new WebGLRenderTarget( this.width, this.height, { type: HalfFloatType, depthBuffer: false } );
 
 
 		this.blurRenderTarget = this.ssaoRenderTarget.clone();
 		this.blurRenderTarget = this.ssaoRenderTarget.clone();
 
 

+ 4 - 2
examples/jsm/postprocessing/SSRPass.js

@@ -315,7 +315,8 @@ class SSRPass extends Pass {
 		//for bouncing
 		//for bouncing
 		this.prevRenderTarget = new WebGLRenderTarget( this.width, this.height, {
 		this.prevRenderTarget = new WebGLRenderTarget( this.width, this.height, {
 			minFilter: NearestFilter,
 			minFilter: NearestFilter,
-			magFilter: NearestFilter
+			magFilter: NearestFilter,
+			depthBuffer: false
 		} );
 		} );
 
 
 		// normal render target
 		// normal render target
@@ -340,7 +341,8 @@ class SSRPass extends Pass {
 
 
 		this.ssrRenderTarget = new WebGLRenderTarget( this.width, this.height, {
 		this.ssrRenderTarget = new WebGLRenderTarget( this.width, this.height, {
 			minFilter: NearestFilter,
 			minFilter: NearestFilter,
-			magFilter: NearestFilter
+			magFilter: NearestFilter,
+			depthBuffer: false
 		} );
 		} );
 
 
 		this.blurRenderTarget = this.ssrRenderTarget.clone();
 		this.blurRenderTarget = this.ssrRenderTarget.clone();

+ 1 - 1
examples/jsm/postprocessing/SavePass.js

@@ -61,7 +61,7 @@ class SavePass extends Pass {
 
 
 		if ( this.renderTarget === undefined ) {
 		if ( this.renderTarget === undefined ) {
 
 
-			this.renderTarget = new WebGLRenderTarget( 1, 1, { type: HalfFloatType } ); // will be resized later
+			this.renderTarget = new WebGLRenderTarget( 1, 1, { type: HalfFloatType, depthBuffer: false } ); // will be resized later
 			this.renderTarget.texture.name = 'SavePass.rt';
 			this.renderTarget.texture.name = 'SavePass.rt';
 
 
 		}
 		}

+ 1 - 1
examples/jsm/postprocessing/TAARenderPass.js

@@ -101,7 +101,7 @@ class TAARenderPass extends SSAARenderPass {
 
 
 		if ( this._holdRenderTarget === null ) {
 		if ( this._holdRenderTarget === null ) {
 
 
-			this._holdRenderTarget = new WebGLRenderTarget( readBuffer.width, readBuffer.height, { type: HalfFloatType } );
+			this._holdRenderTarget = new WebGLRenderTarget( readBuffer.width, readBuffer.height, { type: HalfFloatType, depthBuffer: false } );
 			this._holdRenderTarget.texture.name = 'TAARenderPass.hold';
 			this._holdRenderTarget.texture.name = 'TAARenderPass.hold';
 
 
 		}
 		}

粤ICP备19079148号