Canvas background is always black when using postprocessing

When set WebGLRenderer alpha=true

https://jsfiddle.net/f2Lommf5/16257/

    renderer = new THREE.WebGLRenderer( { antialias: true ,alpha: true} )

canvas context imagedata is transparent

but use postprocessing canvas context image always black
https://jsfiddle.net/f2Lommf5/16258/

Then I try.
https://jsfiddle.net/f2Lommf5/16259/

 var renderScene = new THREE.RenderPass( scene, camera ,null,new THREE.Color('red'),0);

canvas context imagedata still black

I hope when postprocessing canvas context imagedata is transparent,I can save canva as transparent image.
What should I do?

That might be an issue with UnrealBloomPass pass. There is already an issue that tackles this problem.

2 Likes

thanks ; I Look at it.:grin:

I’ve created a full example with the fix. Thanks to help from: Unreal Bloom and Renderer Transparency issue · Issue #14104 · mrdoob/three.js · GitHub

Disclaimer it’s in typescript:

1 Like