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

Method _renderPosterize

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

Source from the content-addressed store, hash-verified

775 }
776
777 _renderPosterize(params, inputTexture, width, height, flipY = 1.0) {
778 const gl = this.gl;
779 const program = this.programs.posterize;
780
781 this._useProgram(program, flipY);
782
783 gl.activeTexture(gl.TEXTURE0);
784 gl.bindTexture(gl.TEXTURE_2D, inputTexture);
785
786 gl.uniform1i(program.uniforms.u_image, 0);
787 gl.uniform1i(program.uniforms.u_levels, params.levels);
788 gl.uniform1i(program.uniforms.u_preserveHue, params.preserveHue ? 1 : 0);
789
790 gl.drawArrays(gl.TRIANGLES, 0, 6);
791 }
792
793 _renderEdge(params, inputTexture, width, height, flipY = 1.0) {
794 const gl = this.gl;

Callers 1

_renderEffectMethod · 0.95

Calls 1

_useProgramMethod · 0.95

Tested by

no test coverage detected