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

Method _renderColorGrade

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

Source from the content-addressed store, hash-verified

833 }
834
835 _renderColorGrade(params, inputTexture, width, height, flipY = 1.0) {
836 const gl = this.gl;
837 const program = this.programs.colorGrade;
838
839 this._useProgram(program, flipY);
840
841 gl.activeTexture(gl.TEXTURE0);
842 gl.bindTexture(gl.TEXTURE_2D, inputTexture);
843
844 const shadows = this._hexToRgb(params.shadows);
845 const highlights = this._hexToRgb(params.highlights);
846
847 gl.uniform1i(program.uniforms.u_image, 0);
848 gl.uniform1f(program.uniforms.u_brightness, params.brightness);
849 gl.uniform1f(program.uniforms.u_contrast, params.contrast);
850 gl.uniform1f(program.uniforms.u_saturation, params.saturation);
851 gl.uniform1f(program.uniforms.u_temperature, params.temperature);
852 gl.uniform1f(program.uniforms.u_tint, params.tint);
853 gl.uniform3f(program.uniforms.u_shadows, shadows[0], shadows[1], shadows[2]);
854 gl.uniform3f(program.uniforms.u_highlights, highlights[0], highlights[1], highlights[2]);
855 gl.uniform1f(program.uniforms.u_shadowInfluence, params.shadowInfluence);
856 gl.uniform1f(program.uniforms.u_highlightInfluence, params.highlightInfluence);
857
858 gl.drawArrays(gl.TRIANGLES, 0, 6);
859 }
860
861 _renderGlitch(params, inputTexture, width, height, seed, flipY = 1.0) {
862 const gl = this.gl;

Callers 1

_renderEffectMethod · 0.95

Calls 2

_useProgramMethod · 0.95
_hexToRgbMethod · 0.95

Tested by

no test coverage detected