Created
October 25, 2019 09:09
-
-
Save luruke/4f44aa56c4f2451a048e90175a5ec0c9 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
// 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