Skip to content

Commit

Permalink
Use active flag instead of time
Browse files Browse the repository at this point in the history
  • Loading branch information
vanruesc committed Oct 3, 2022
1 parent 3a45746 commit 8160499
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/effects/OutlineEffect.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,15 @@ export class OutlineEffect extends Effect {

this.time = 0;

/**
* Indicates whether the outline effect is active.
*
* @type {Boolean}
* @private
*/

this.active = false;

/**
* A selection of objects that will be outlined.
*
Expand Down Expand Up @@ -726,6 +735,7 @@ export class OutlineEffect extends Effect {

}

this.active = true;
this.time += deltaTime;

// Render a custom depth texture and ignore selected objects.
Expand All @@ -750,10 +760,10 @@ export class OutlineEffect extends Effect {

}

} else if(this.time > 0) {
} else if(this.active) {

this.clearPass.render(renderer, this.renderTargetOutline);
this.time = 0;
this.active = false;

}

Expand Down

0 comments on commit 8160499

Please sign in to comment.