Skip to content

Commit adc2ace

Browse files
committed
Set transparent if canvas uses alpha
1 parent de7df0a commit adc2ace

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/passes/EffectPass.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,19 @@ export class EffectPass extends Pass {
381381

382382
}
383383

384+
/**
385+
* Indicates whether the renderer uses alpha.
386+
*
387+
* @private
388+
* @type {Boolean}
389+
*/
390+
391+
get alpha() {
392+
393+
return this.renderer !== null && this.renderer.getContext().getContextAttributes().alpha;
394+
395+
}
396+
384397
/**
385398
* Sets the effects.
386399
*
@@ -571,6 +584,7 @@ export class EffectPass extends Pass {
571584
if(!this.skipRendering || this.renderToScreen) {
572585

573586
const material = this.fullscreenMaterial;
587+
material.transparent = this.renderToScreen && this.alpha;
574588
material.inputBuffer = inputBuffer.texture;
575589
material.time += deltaTime * this.timeScale;
576590

0 commit comments

Comments
 (0)