Graphics Reference
In-Depth Information
You might not recognize this, but what you're seeing is a large number of cubes that
are rotating.
How to do it…
We create this effect by using a custom fragment shader. The following steps explain
how to set this up:
1. We first need to create THREE.EffectComposer and configure the steps:
var composer = new
THREE.EffectComposer( renderer );
var renderPass = new THREE.RenderPass(
scene, camera );
composer.addPass( renderPass );
So far, we have only added the render step ( THREE.RenderPass ), which
renders the scene and allows us to add additional postprocessing effects.
2. To use custom shaders, we'll need to use the THREE.ShaderPass object:
var customShader = {
uniforms: {
"tDiffuse": { type: "t", value:
null},
"scale": { type: "f", value: 1.0
},
Search WWH ::




Custom Search