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

Method _renderVignette

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

Source from the content-addressed store, hash-verified

667 }
668
669 _renderVignette(params, inputTexture, width, height, flipY = 1.0) {
670 const gl = this.gl;
671 const program = this.programs.vignette;
672
673 this._useProgram(program, flipY);
674
675 gl.activeTexture(gl.TEXTURE0);
676 gl.bindTexture(gl.TEXTURE_2D, inputTexture);
677
678 const color = this._hexToRgb(params.color);
679
680 gl.uniform1i(program.uniforms.u_image, 0);
681 gl.uniform1f(program.uniforms.u_intensity, params.intensity);
682 gl.uniform1f(program.uniforms.u_size, params.size);
683 gl.uniform1f(program.uniforms.u_softness, params.softness);
684 gl.uniform3f(program.uniforms.u_color, color[0], color[1], color[2]);
685 gl.uniform2f(program.uniforms.u_resolution, width, height);
686
687 gl.drawArrays(gl.TRIANGLES, 0, 6);
688 }
689
690 _renderScanlines(params, inputTexture, width, height, flipY = 1.0, renderScale = 1.0) {
691 const gl = this.gl;

Callers 1

_renderEffectMethod · 0.95

Calls 2

_useProgramMethod · 0.95
_hexToRgbMethod · 0.95

Tested by

no test coverage detected