threex.toxicpproc is a three.js extension which provide an intoxicated effect :)
It provides various levels of intoxication sober, drunk
, high and wasted.
You can easily provide that to your effect composer.
You can install it via script tag
<script src='threex.toxicpproc.js'></script>
Or you can install with bower, as you wish.
bower install threex.toxicpproc
It build the passes for a toxic effect. It has mutiples presets which are by
order of intoxication: sober, drunk, high and wasted.
Create an instance
var badTVPasses = new THREEx.ToxicPproc.Passes();
Everytime you render the scene, be sure to update it
toxicPasses.update(delta, now)
Then you add those passes to an THREE.EffectComposer like that
toxicPasses.addPassesTo(composer)
It is possible to set a preset with the following
toxicPasses.setPreset('drunk')
To get the list of all presets
var presetNames = Object.keys(THREEx.ToxicPproc.passesPreset)
console.log(presetNames)
It provide an easy way to fine tune threex.toxicpproc parameters
thanks to Dat.GUI.
It is interactive and simple! The typical usage is just:
THREEx.addToxicPasses2DatGui(badTVPasses)