@tomorrowevening/three-pass

1.0.2 • Public • Published

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);
}

Readme

Keywords

Package Sidebar

Install

npm i @tomorrowevening/three-pass

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

15.5 kB

Total Files

7

Last publish

Collaborators

  • tomorrowevening