JSPM

postprocessing

4.5.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 154623
  • Score
    100M100P100Q156138F
  • License Zlib

A post processing library that provides the means to implement image filter effects for three.js.

Package Exports

  • postprocessing

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (postprocessing) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Post Processing

Build status npm version Peer dependencies

A post processing library that provides the means to implement image filter effects for three.js.

Extensive DemoAPI ReferenceWiki

Installation

npm install postprocessing

Usage

Please refer to the usage example of three.js for information about how to setup the renderer, scene and camera.

Basics

import { Clock, PerspectiveCamera, Scene, WebGLRenderer } from "three";
import { EffectComposer, GlitchPass, RenderPass } from "postprocessing";

const composer = new EffectComposer(new WebGLRenderer());
composer.addPass(new RenderPass(new Scene(), new PerspectiveCamera()));

const pass = new GlitchPass();
pass.renderToScreen = true;
composer.addPass(pass);

const clock = new Clock();

(function render() {

    requestAnimationFrame(render);
    composer.render(clock.getDelta());

}());

Custom Passes

import { Pass } from "postprocessing";
import { MyMaterial } from "./MyMaterial.js";

export class MyPass extends Pass {

    constructor() {

        super("MyPass");

        this.material = new MyMaterial();

    }

    render(renderer, inputBuffer, outputBuffer, delta, stencilTest) {

        this.material.uniforms.tDiffuse.value = inputBuffer.texture;
        renderer.render(this.scene, this.camera, this.renderToScreen ? null : outputBuffer);

    }

}

See the Wiki for more information.

Included Filters

Contributing

Please refer to the contribution guidelines for details.

License

This library is licensed under the Zlib license.

The original code that this library is based on, was written by alteredq, miibond, zz85, felixturner, spidersharma and huwb and is licensed under the MIT license.

The film effect incorporates code written by Georg Steinrohder and Pat Shearon which was released under the Creative Commons Attribution 3.0 License.