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

Method _renderOverlay

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

Source from the content-addressed store, hash-verified

625 }
626
627 _renderOverlay(params, inputTexture, width, height, flipY = 1.0) {
628 const gl = this.gl;
629 const program = this.programs.overlay;
630
631 this._useProgram(program, flipY);
632
633 gl.activeTexture(gl.TEXTURE0);
634 gl.bindTexture(gl.TEXTURE_2D, inputTexture);
635
636 gl.activeTexture(gl.TEXTURE1);
637 gl.bindTexture(gl.TEXTURE_2D, this.textures.overlay || inputTexture);
638
639 gl.uniform1i(program.uniforms.u_image, 0);
640 gl.uniform1i(program.uniforms.u_overlay, 1);
641 gl.uniform1f(program.uniforms.u_intensity, params.intensity);
642 gl.uniform1f(program.uniforms.u_scale, params.scale);
643 gl.uniform1f(program.uniforms.u_rotation, params.rotation);
644 gl.uniform1i(program.uniforms.u_blendMode, this._blendModeToInt(params.blendMode));
645 gl.uniform2f(program.uniforms.u_resolution, width, height);
646 gl.uniform1i(program.uniforms.u_hasOverlay, this.textures.overlay ? 1 : 0);
647
648 gl.drawArrays(gl.TRIANGLES, 0, 6);
649 }
650
651 _renderChromatic(params, inputTexture, width, height, flipY = 1.0) {
652 const gl = this.gl;

Callers 1

_renderEffectMethod · 0.95

Calls 2

_useProgramMethod · 0.95
_blendModeToIntMethod · 0.95

Tested by

no test coverage detected