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

Method _renderChromatic

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

Source from the content-addressed store, hash-verified

649 }
650
651 _renderChromatic(params, inputTexture, width, height, flipY = 1.0) {
652 const gl = this.gl;
653 const program = this.programs.chromatic;
654
655 this._useProgram(program, flipY);
656
657 gl.activeTexture(gl.TEXTURE0);
658 gl.bindTexture(gl.TEXTURE_2D, inputTexture);
659
660 gl.uniform1i(program.uniforms.u_image, 0);
661 gl.uniform1f(program.uniforms.u_intensity, params.intensity);
662 gl.uniform1f(program.uniforms.u_angle, params.angle);
663 gl.uniform1i(program.uniforms.u_radial, params.radial ? 1 : 0);
664 gl.uniform2f(program.uniforms.u_resolution, width, height);
665
666 gl.drawArrays(gl.TRIANGLES, 0, 6);
667 }
668
669 _renderVignette(params, inputTexture, width, height, flipY = 1.0) {
670 const gl = this.gl;

Callers 1

_renderEffectMethod · 0.95

Calls 1

_useProgramMethod · 0.95

Tested by

no test coverage detected