Sfoglia il codice sorgente

RenderPipeline: Fix sync with `renderer.outputColorSpace` and `renderer.toneMapping` (#33187)

sunag 1 mese fa
parent
commit
2bc2bd8991
1 ha cambiato i file con 33 aggiunte e 4 eliminazioni
  1. 33 4
      src/renderers/common/RenderPipeline.js

+ 33 - 4
src/renderers/common/RenderPipeline.js

@@ -94,6 +94,23 @@ class RenderPipeline {
 		 */
 		this._context = null;
 
+		/**
+		 * The current tone mapping.
+		 *
+		 * @private
+		 * @type {ToneMapping}
+		 */
+		this._toneMapping = renderer.toneMapping;
+
+		/**
+		 * The current output color space.
+		 *
+		 * @private
+		 * @type {ColorSpace}
+		 */
+		this._outputColorSpace = renderer.outputColorSpace;
+
+
 	}
 
 	/**
@@ -161,12 +178,24 @@ class RenderPipeline {
 	 */
 	_update() {
 
-		if ( this.needsUpdate === true ) {
+		if ( this._toneMapping !== this.renderer.toneMapping ) {
+
+			this._toneMapping = this.renderer.toneMapping;
+			this.needsUpdate = true;
+
+		}
 
-			const renderer = this.renderer;
+		if ( this._outputColorSpace !== this.renderer.outputColorSpace ) {
+
+			this._outputColorSpace = this.renderer.outputColorSpace;
+			this.needsUpdate = true;
+
+		}
+
+		if ( this.needsUpdate === true ) {
 
-			const toneMapping = renderer.toneMapping;
-			const outputColorSpace = renderer.outputColorSpace;
+			const toneMapping = this._toneMapping;
+			const outputColorSpace = this._outputColorSpace;
 
 			const context = {
 				renderPipeline: this,

粤ICP备19079148号