Renderer effects and postprocessing
Sometimes, effects that change the entire display can give a game or area a lot of personality. Three.js supports two major kinds of effects: renderer and postprocessing.
Renderer effects can be found in examples/js/effects
. They change what the renderer outputs, usually by rendering the scene multiple times with different settings. For example, the Anaglyph effect produces the familiar red-and-blue shadows that work with 3D glasses to make the scene pop out of the screen, and it does this by rendering the scene once for the left eye, once for the right eye, and once combined. Setting this up is easy:
effect = new THREE.AnaglyphEffect(renderer); effect.setSize(renderer.domElement.width, renderer.domElement.height);
Then just call effect.render(scene, camera)
instead of renderer.render(scene, camera)
. All of the other renderer effects work the same way except the ASCII effect, which requires adding a separate canvas so it can render the scene to text characters...