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

Method _renderLightLeak

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

Source from the content-addressed store, hash-verified

1012 }
1013
1014 _renderLightLeak(params, inputTexture, width, height, flipY = 1.0) {
1015 const gl = this.gl;
1016 const program = this.programs.lightLeak;
1017
1018 this._useProgram(program, flipY);
1019
1020 gl.activeTexture(gl.TEXTURE0);
1021 gl.bindTexture(gl.TEXTURE_2D, inputTexture);
1022
1023 const color1 = this._hexToRgb(params.color1);
1024 const color2 = this._hexToRgb(params.color2);
1025
1026 gl.uniform1i(program.uniforms.u_image, 0);
1027 gl.uniform3f(program.uniforms.u_color1, color1[0], color1[1], color1[2]);
1028 gl.uniform3f(program.uniforms.u_color2, color2[0], color2[1], color2[2]);
1029 gl.uniform1f(program.uniforms.u_position, params.position);
1030 gl.uniform1f(program.uniforms.u_angle, params.angle);
1031 gl.uniform1f(program.uniforms.u_size, params.size);
1032 gl.uniform1f(program.uniforms.u_intensity, params.intensity);
1033 gl.uniform1f(program.uniforms.u_softness, params.softness);
1034 gl.uniform1i(program.uniforms.u_blendMode, this._blendModeToInt(params.blendMode));
1035 gl.uniform2f(program.uniforms.u_resolution, width, height);
1036
1037 gl.drawArrays(gl.TRIANGLES, 0, 6);
1038 }
1039
1040 _renderBloom(params, inputTexture, width, height, flipY = 1.0, renderScale = 1.0) {
1041 const gl = this.gl;

Callers 1

_renderEffectMethod · 0.95

Calls 3

_useProgramMethod · 0.95
_hexToRgbMethod · 0.95
_blendModeToIntMethod · 0.95

Tested by

no test coverage detected