| 1406 | } |
| 1407 | |
| 1408 | function blur (target, temp, iterations) { |
| 1409 | blurProgram.bind(); |
| 1410 | for (let i = 0; i < iterations; i++) { |
| 1411 | gl.uniform2f(blurProgram.uniforms.texelSize, target.texelSizeX, 0.0); |
| 1412 | gl.uniform1i(blurProgram.uniforms.uTexture, target.attach(0)); |
| 1413 | blit(temp); |
| 1414 | |
| 1415 | gl.uniform2f(blurProgram.uniforms.texelSize, 0.0, target.texelSizeY); |
| 1416 | gl.uniform1i(blurProgram.uniforms.uTexture, temp.attach(0)); |
| 1417 | blit(target); |
| 1418 | } |
| 1419 | } |
| 1420 | |
| 1421 | function splatPointer (pointer) { |
| 1422 | let dx = pointer.deltaX * config.SPLAT_FORCE; |