threex.badtv is a three.js extension which provide an badtv effect. It is a post processing cumulating various effects. It is from the excelent badtv demo of @felixturner. You can see more of the good stuff what he does on his blog.
threex.badtvpasses.js thru various
random steps, thus it appears as a broken tv set. Additionally it use a
electric sound
from
freesound and use threex.badtvsound.js to play it thru webaudio API.You can install it via script tag
<script src='threex.badtv.js'></script>
Or you can install with bower, as you wish.
bower install threex.badtv
Here is the split out of each javascript files
It build the passes for the badTV effect.
It exposes badtvpasses.passes for a THREE.EffectComposer instance.
Create an instance
var badTVPasses = new THREEx.BadTVPasses();
Everytime you render the scene, be sure to update it
badTVPasses.update(delta, now)
Then you add those passes to an THREE.EffectComposer like that
badTVPasses.addPassesTo(composer)
It provides a bad tv jamming effect with sound.
It depends on threex.badtvsound.js for the sound.
First create the object.
var context = new AudioContext()
var badTVJamming = new THREEx.BadTVJamming(badTVPasses, context)
When you want to trigger the effect, just do
badTVJamming.trigger()
It plays a electical sound thru Web Audio API. It is used to simulate the noise made by a broken cathod ray tube. First create the object.
var context = new AudioContext()
var badTVSound = new THREEx.BadTVSound(context, context.destination)
When you want to play it, do
badTVSound.play()
It provide an easy way to fine tune threex.badtvpasses parameters
thanks to
Dat.GUI.
It is interactive and simple!
The typical usage is just:
THREEx.addBadTVPasses2DatGui(badTVPasses)