Skip to content

Commit

Permalink
Add ignoreBackground
Browse files Browse the repository at this point in the history
  • Loading branch information
vanruesc committed Jul 28, 2024
1 parent f9c8ece commit 93b3b94
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/passes/ClearPass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ export class ClearPass extends Pass {

readonly clearValues: ClearValues;

/**
* Indicates whether the background of the main scene should be ignored.
*
* @defaultValue false
*/

ignoreBackground: boolean;

/**
* G-Buffer texture indices.
*/
Expand Down Expand Up @@ -60,6 +68,7 @@ export class ClearPass extends Pass {

this.clearFlags = new ClearFlags(color, depth, stencil);
this.clearValues = new ClearValues();
this.ignoreBackground = false;
this.gBufferIndices = null;

this.background = new Background();
Expand Down Expand Up @@ -208,7 +217,9 @@ export class ClearPass extends Pass {

}

if(this.scene !== null && this.camera !== null && this.scene.background !== null) {
const background = this.scene?.background ?? null;

if(!this.ignoreBackground && this.camera !== null && background !== null) {

this.clearWithBackground();

Expand Down

0 comments on commit 93b3b94

Please sign in to comment.