Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Buffer
this.buffer = new FBO({
geometry: this.geometry,
width: SIZE_BUFFER,
height: SIZE_BUFFER,
name: 'buffer particles',
shader: `
precision highp float;
uniform sampler2D texture;
uniform sampler2D uImage;
void main() {
vec2 uv = gl_FragCoord.xy / RESOLUTION.xy;
vec4 current = texture2D(texture, uv);
vec4 data = texture2D(uImage, uv);
current += data;
current.a *= 0.86;
gl_FragColor = current;
}
`,
uniforms: {
uImage: { value: this.rt.texture },
},
rtOptions: {
minFilter: LinearFilter,
magFilter: LinearFilter,
type: UnsignedByteType,
depthBuffer: true,
depthWrite: true,
depthTest: true,
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment