I want to tell my EffectComposer to edit a renderTarget, and then I render that renderTarget to the canvas to see if everything is working properly, but it is blank!
But when I tell EffectComposer to directly render to the screen, I can see my effect… (I need to render my effects to a renderTarget because I will do some further processing on the renderTarget)
So how can I ensure that my EffectComposer is saving its final result to my renderTarget? I already define my render target on EffectComposer’s second parameter, so I don’t know whats wrong!
code
const renderTargetForGlowingObjects = new THREE.WebGLRenderTarget(innerWidth, innerHeight, {
minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter
});
const bloomComposer = new THREE.EffectComposer(renderer, renderTargetForGlowingObjects);
bloomComposer.setSize(innerWidth, innerHeight);
bloomComposer.renderToScreen = false;
bloomComposer.addPass(renderScene);
bloomComposer.addPass(bloomPass);
And I call bloomComposer.render()
on the animation loop.