Created
October 25, 2019 08:29
-
-
Save luruke/077b4187fcf0e5e062f2b015b4d89a9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
NearestFilter, | |
RepeatWrapping, | |
} from 'three'; | |
import FBO from '../utils/fbo'; | |
import textures from 'gl/utils/textures'; | |
import trail from '../utils/trail'; | |
import bidello from 'bidello'; | |
const SHARED_FBO = new FBO({ | |
width: 1024, | |
height: 1024, | |
name: 'Glitch FBO', | |
shader: require('./fbo.frag').default, | |
// debug: true, | |
uniforms: { | |
uWind: { | |
value: textures.fromAsset('uvwind', { | |
magFilter: NearestFilter, | |
minFilter: NearestFilter, | |
wrapS: RepeatWrapping, | |
wrapT: RepeatWrapping, | |
}), | |
}, | |
uTime: { value: 0.0 }, | |
uTrail: { value: trail.fbo.target }, | |
} | |
}); | |
bidello.on('raf', ({ delta }) => { | |
SHARED_FBO.uniforms.uTrail.value = trail.fbo.target; | |
SHARED_FBO.uniforms.uTime.value += delta; | |
SHARED_FBO.update(); | |
}); | |
export default SHARED_FBO; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment