Selaa lähdekoodia

WebGPURenderer: apply color space/tonemapping if required in clear() (#28521)

* run color/tone mapping pass

* added description

---------

Co-authored-by: aardgoose <[email protected]>
aardgoose 1 vuosi sitten
vanhempi
commit
f52b71b607
1 muutettua tiedostoa jossa 10 lisäystä ja 0 poistoa
  1. 10 0
      examples/jsm/renderers/common/Renderer.js

+ 10 - 0
examples/jsm/renderers/common/Renderer.js

@@ -944,6 +944,16 @@ class Renderer {
 
 		this.backend.clear( color, depth, stencil, renderTargetData );
 
+		if ( renderTarget !== null && this._renderTarget === null ) {
+
+			// If a color space transform or tone mapping is required,
+			// the clear operation clears the intermediate renderTarget texture, but does not update the screen canvas.
+
+			_quad.material.fragmentNode = this._nodes.getOutputNode( renderTarget.texture );
+			this._renderScene( _quad, _quad.camera, false );
+
+		}
+
 	}
 
 	clearColor() {