1.0.2 • Published 6 years ago

@tomorrowevening/three-pass v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

ThreePass

A layer that can be used for post-processing, GPGPU, etc.

Install

npm i three_pass

Build

npm run build

Here's some examples of use, using FBO and DoubleFBO, but not required.

Basic Display Pass
draw(config, textures) {
  this.material.uniforms.time.value = config.time;
  this.material.uniforms.resolution.value = config.resolution;
  this.material.uniforms.texture.value = textures.buffer.texture;
  renderer.render(this.scene, this.camera);
}
Interaction Pass
draw(config, textures) {
  this.material.uniforms.time.value = config.time;
  this.material.uniforms.resolution.value = config.resolution;
  this.material.uniforms.mouse.value = config.mouse;
  this.material.uniforms.velocity.value = config.velocity;
  this.material.uniforms.texture.value = textures.buffer.texture;
  textures.buffer.swap();
  renderer.render(this.scene, this.camera, textures.buffer.target, false);
}