Skip to content

Commit a65fbf7

Browse files
authored
WebGLRenderer: Remove redundant clear in transmission pass. (#28447)
* WebGLRenderer: Remove redundant clear in transmission pass. * WebGLRenderer: Retain transmission clear in XR.
1 parent c985826 commit a65fbf7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/renderers/WebGLRenderer.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,9 +1462,15 @@ class WebGLRenderer {
14621462
_currentClearAlpha = _this.getClearAlpha();
14631463
if ( _currentClearAlpha < 1 ) _this.setClearColor( 0xffffff, 0.5 );
14641464

1465-
_this.clear();
1465+
if ( _renderBackground ) {
1466+
1467+
background.render( scene );
1468+
1469+
} else {
1470+
1471+
_this.clear();
14661472

1467-
if ( _renderBackground ) background.render( scene );
1473+
}
14681474

14691475
// Turn off the features which can affect the frag color for opaque objects pass.
14701476
// Otherwise they are applied twice in opaque objects pass and transmission objects pass.

0 commit comments

Comments
 (0)