mrdoob/three.js — Issue #881: Composer
Author: renegademaster88
Created: 2011-12-09 19:40:27+00:00
State: open

Whilst going through the enormous pain in the arse process of upgrading the releases (thanx for all those little changes!), i am having some fun with the composer.

I have an environment map for my background. A Glow Pass for laser bolts , and a Main Scene for other geometry. I want to put a BloomPass between the Glow Pass and the Main Scene, but when i do Main Scene dissapears. It also seems to break it i don't use the Film Effects pass at the end, which i dont understand either. Any help with this little documented gem?

var background = new THREE.RenderPass( sceneCube, cameraCube);
background.clear = true;

var glow = new THREE.RenderPass( glow_scene, f3d.camera );
glow.clear= false;

var main_scene = new THREE.RenderPass( scene, f3d.camera );
main_scene.clear= false;

var effectFilm =new THREE.FilmPass( 0.35, 0.75, 2048, false );
effectFilm.renderToScreen = true;

var effectBloom = new THREE.BloomPass( );
effectBloom.clear = false;
effectBloom.renderToScreen = true;

composer = new THREE.EffectComposer( renderer );

composer.addPass(background );

composer.addPass( glow );

composer.addPass( effectBloom );

composer.addPass( main_scene );

composer.addPass( effectFilm );