Просмотр исходного кода

BloomPass: Save and restore renderer.autoClear.

Otherwise the final additive-combine fsQuad render can clear the
readBuffer when called from a pipeline that leaves autoClear at the
default (true). Matches the pattern used by UnrealBloomPass, SAOPass,
TAARenderPass, and others.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mr.doob 3 месяцев назад
Родитель
Сommit
595f9f3a09
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      examples/jsm/postprocessing/BloomPass.js

+ 5 - 0
examples/jsm/postprocessing/BloomPass.js

@@ -128,6 +128,9 @@ class BloomPass extends Pass {
 
 
 		if ( maskActive ) renderer.state.buffers.stencil.setTest( false );
 		if ( maskActive ) renderer.state.buffers.stencil.setTest( false );
 
 
+		const oldAutoClear = renderer.autoClear;
+		renderer.autoClear = false;
+
 		// Render quad with blurred scene into texture (convolution pass 1)
 		// Render quad with blurred scene into texture (convolution pass 1)
 
 
 		this._fsQuad.material = this.materialConvolution;
 		this._fsQuad.material = this.materialConvolution;
@@ -161,6 +164,8 @@ class BloomPass extends Pass {
 		if ( this.clear ) renderer.clear();
 		if ( this.clear ) renderer.clear();
 		this._fsQuad.render( renderer );
 		this._fsQuad.render( renderer );
 
 
+		renderer.autoClear = oldAutoClear;
+
 	}
 	}
 
 
 	/**
 	/**

粤ICP备19079148号