threex.toxicpproc

three.js extension for a postprocessing of intoxicated player

入门
GitHub在线演示
Stars:10
License:MIT License
更新:2024/12/5

README

threex.toxicpproc

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.

Show Don't Tell

How To Install It

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

How To Use It

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)

threex.toxicpprocdatgui.js

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)