MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / _renderNoise

Method _renderNoise

src/tools/texture-lab/renderer.js:494–512  ·  view source on GitHub ↗
(params, inputTexture, width, height, seed, flipY = 1.0)

Source from the content-addressed store, hash-verified

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;

Callers 1

_renderEffectMethod · 0.95

Calls 2

_useProgramMethod · 0.95
_blendModeToIntMethod · 0.95

Tested by

no test coverage detected