Graphics Reference
In-Depth Information
We've also provided an example that shows you the final result of this recipe.
You can view this by opening
06.07-setup-basic-post-processing-
pipeline.html
in your browser. You will see something similar to the following
screenshot:
In this screenshot, you can see that we've rendered a scene with a large number of
cubes and applied an effect to render it as a series of dots.
How to do it...
Setting up a postprocessing pipeline only takes a couple of small steps:
1. To set up a postprocessing pipeline, we need something called a composer.
We'll use this composer in the
render
loop to create the final output. The
first thing we need for that is a new global variable:
var composer;
2. Next, we need to instantiate a composer as a new instance of
THREE.EffectComposer
:
composer = new THREE.EffectComposer(
renderer );
We pass in
THREE.WebGLRenderer
, which we would normally use to
render the scene.