(params, inputTexture, width, height, flipY = 1.0)
| 512 | } |
| 513 | |
| 514 | _renderDither(params, inputTexture, width, height, flipY = 1.0) { |
| 515 | const gl = this.gl; |
| 516 | const program = this.programs.dither; |
| 517 | |
| 518 | this._useProgram(program, flipY); |
| 519 | |
| 520 | gl.activeTexture(gl.TEXTURE0); |
| 521 | gl.bindTexture(gl.TEXTURE_2D, inputTexture); |
| 522 | |
| 523 | gl.uniform1i(program.uniforms.u_image, 0); |
| 524 | gl.uniform1i(program.uniforms.u_method, this._ditherMethodToInt(params.method)); |
| 525 | gl.uniform1i(program.uniforms.u_levels, params.levels); |
| 526 | gl.uniform1f(program.uniforms.u_threshold, params.threshold); |
| 527 | gl.uniform2f(program.uniforms.u_resolution, width, height); |
| 528 | gl.uniform1f(program.uniforms.u_scale, params.scale || 1.0); |
| 529 | |
| 530 | gl.drawArrays(gl.TRIANGLES, 0, 6); |
| 531 | } |
| 532 | |
| 533 | _renderHalftone(params, inputTexture, width, height, flipY = 1.0, renderScale = 1.0) { |
| 534 | const gl = this.gl; |
no test coverage detected