What's the meaning of Composer.renderToScreen

I’m learning post processing in threejs. But don’t understand officil’s demo from:

I can’t understand the render’ logic in case of ‘Scene with Glow’:

firstly, it set bloomComposer.renderToScreen = false;
then, call renderBloom, to render the selected meshs, but what the meaning of renderToScreen = false? ( I tried to switch renderToScreen=true, had differenct effect, but don’t know the reason, neither)
finally, call the finalComposer, I don’t understand this effect too. Why use shader here?

It’s something like photoshop’s making layer?

		function render() {
			switch ( params.scene ) {
				case 'Scene only':
					renderer.render( scene, camera );
				case 'Glow only':
					renderBloom( false );
				     My question is here
				case 'Scene with Glow': 
					// render scene with bloom
					renderBloom( true );
					// render the entire scene, then render bloom scene on top

		function renderBloom( mask ) {
			if ( mask === true ) {
				scene.traverse( darkenNonBloomed );
				scene.traverse( restoreMaterial );
			} else {
				camera.layers.set( BLOOM_SCENE );
				camera.layers.set( ENTIRE_SCENE );

		function darkenNonBloomed( obj ) {
			if ( obj.isMesh && bloomLayer.test( obj.layers ) === false ) {
				materials[ obj.uuid ] = obj.material;
				obj.material = darkMaterial;

		function restoreMaterial( obj ) {
			if ( materials[ obj.uuid ] ) {
				obj.material = materials[ obj.uuid ];
				delete materials[ obj.uuid ];

Like mentioned in the documentation, renderToScreen controls whether the final pass in the composer’s pass chain is rendered to the screen (default framebuffer) or not.

It’s the original effect

It’s the effect, which’s switch to ture.

I think if the only difference is use the buffer, the effect should be same, right? I don’t know the reason.

And I don’t understand what the shader’s usage here.