浏览代码

WebGLRenderer: Remove redundant clear in transmission pass. (#28447)

* WebGLRenderer: Remove redundant clear in transmission pass.

* WebGLRenderer: Retain transmission clear in XR.
Michael Herzog 1 年之前
父节点
当前提交
a65fbf7fbd
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. 8 2
      src/renderers/WebGLRenderer.js

+ 8 - 2
src/renderers/WebGLRenderer.js

@@ -1462,9 +1462,15 @@ class WebGLRenderer {
 			_currentClearAlpha = _this.getClearAlpha();
 			_currentClearAlpha = _this.getClearAlpha();
 			if ( _currentClearAlpha < 1 ) _this.setClearColor( 0xffffff, 0.5 );
 			if ( _currentClearAlpha < 1 ) _this.setClearColor( 0xffffff, 0.5 );
 
 
-			_this.clear();
+			if ( _renderBackground ) {
+
+				background.render( scene );
+
+			} else {
+
+				_this.clear();
 
 
-			if ( _renderBackground ) background.render( scene );
+			}
 
 
 			// Turn off the features which can affect the frag color for opaque objects pass.
 			// Turn off the features which can affect the frag color for opaque objects pass.
 			// Otherwise they are applied twice in opaque objects pass and transmission objects pass.
 			// Otherwise they are applied twice in opaque objects pass and transmission objects pass.