(params, inputTexture, width, height, flipY = 1.0, renderScale = 1.0)
| 711 | } |
| 712 | |
| 713 | _renderPixelate(params, inputTexture, width, height, flipY = 1.0, renderScale = 1.0) { |
| 714 | const gl = this.gl; |
| 715 | const program = this.programs.pixelate; |
| 716 | |
| 717 | this._useProgram(program, flipY); |
| 718 | |
| 719 | gl.activeTexture(gl.TEXTURE0); |
| 720 | gl.bindTexture(gl.TEXTURE_2D, inputTexture); |
| 721 | |
| 722 | // Scale size proportionally to render resolution so export matches preview |
| 723 | const scaledSize = params.size * renderScale; |
| 724 | |
| 725 | gl.uniform1i(program.uniforms.u_image, 0); |
| 726 | gl.uniform1f(program.uniforms.u_size, scaledSize); |
| 727 | gl.uniform1i(program.uniforms.u_maintainAspect, params.maintainAspect ? 1 : 0); |
| 728 | gl.uniform2f(program.uniforms.u_resolution, width, height); |
| 729 | |
| 730 | gl.drawArrays(gl.TRIANGLES, 0, 6); |
| 731 | } |
| 732 | |
| 733 | _renderBlur(params, inputTexture, width, height, flipY = 1.0, renderScale = 1.0) { |
| 734 | const gl = this.gl; |
no test coverage detected