(params, inputTexture, width, height, seed, flipY = 1.0)
| 492 | } |
| 493 | |
| 494 | _renderNoise(params, inputTexture, width, height, seed, flipY = 1.0) { |
| 495 | const gl = this.gl; |
| 496 | const program = this.programs.noise; |
| 497 | |
| 498 | this._useProgram(program, flipY); |
| 499 | |
| 500 | gl.activeTexture(gl.TEXTURE0); |
| 501 | gl.bindTexture(gl.TEXTURE_2D, inputTexture); |
| 502 | |
| 503 | gl.uniform1i(program.uniforms.u_image, 0); |
| 504 | gl.uniform1f(program.uniforms.u_intensity, params.intensity); |
| 505 | gl.uniform1f(program.uniforms.u_scale, params.scale); |
| 506 | gl.uniform1f(program.uniforms.u_seed, seed); |
| 507 | gl.uniform1i(program.uniforms.u_monochrome, params.monochrome ? 1 : 0); |
| 508 | gl.uniform1i(program.uniforms.u_blendMode, this._blendModeToInt(params.blendMode)); |
| 509 | gl.uniform2f(program.uniforms.u_resolution, width, height); |
| 510 | |
| 511 | gl.drawArrays(gl.TRIANGLES, 0, 6); |
| 512 | } |
| 513 | |
| 514 | _renderDither(params, inputTexture, width, height, flipY = 1.0) { |
| 515 | const gl = this.gl; |
no test coverage detected