Skip to content

Commit 0550204

Browse files
committed
Let the ClearPass clear the input buffer.
The output buffer doesn't really need to be cleared as in most cases a fullscreen effect will render to it anyway.
1 parent ff4cb73 commit 0550204

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/passes/ClearPass.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Pass } from "./Pass.js";
1111
const color = new Color();
1212

1313
/**
14-
* A pass that clears the output buffer or the screen.
14+
* A pass that clears the input buffer or the screen.
1515
*
1616
* You can prevent specific bits from being cleared by setting either the
1717
* autoClearColor, autoClearStencil or autoClearDepth properties of the renderer
@@ -32,6 +32,8 @@ export class ClearPass extends Pass {
3232

3333
super("ClearPass", null, null, null);
3434

35+
this.needsSwap = false;
36+
3537
/**
3638
* The clear color.
3739
*
@@ -51,7 +53,7 @@ export class ClearPass extends Pass {
5153
}
5254

5355
/**
54-
* Clears the output buffer or the screen.
56+
* Clears the input buffer or the screen.
5557
*
5658
* @param {WebGLRenderer} renderer - The renderer.
5759
* @param {WebGLRenderTarget} inputBuffer - A frame buffer that contains the result of the previous pass.
@@ -74,7 +76,7 @@ export class ClearPass extends Pass {
7476

7577
}
7678

77-
renderer.setRenderTarget(this.renderToScreen ? null : outputBuffer);
79+
renderer.setRenderTarget(this.renderToScreen ? null : inputBuffer);
7880
renderer.clear();
7981

8082
if(clearColor !== null) {

0 commit comments

Comments
 (0)