three-effectcomposer
Browserify-friendly version of THREE.EffectComposer
, which offers a quick
GLSL post-processing implementation.
Full credit goes to @alteredq for writing this, the original source can be found here.
Installation
npm install three-effectcomposer
Running the Demo
Install the dependencies and build the script:
git clone git@github.com:hughsk/three-effectcomposer.gitcd three-effectcomposernpm install -dnpm run demo
Then just open up index.html
to see the results.
Usage
This module doesn't touch the THREE
object, instead you access the different
pass classes through EffectComposer
. For a working example, see
demo.js
.
var THREE =EffectComposer = THREEDotScreenShader =RGBShiftShader =var rendererscenecameracomposer{renderer =scene =camera = 70 windowinnerWidth/windowinnerHeight 1 1000;// ...// The rest of your setup code, as per usual// ...// Create your composer and first RenderPasscomposer = renderercomposer// Redraw with a shadervar effect = DotScreenShadercomposer// And another shader, drawing to the screen at this pointvar effect = RGBShiftShadereffectrenderToScreen = truecomposer};// Instead of calling renderer.render, use// composer.render instead:{composer};