Skip to content

Instantly share code, notes, and snippets.

@luruke
Created October 25, 2019 08:29
Embed
What would you like to do?
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