I am trying to clip or cut the left side out of a loaded sampler2D texture in a shader before I return the texture2D.
Currently I am making the texture edits before passing to the shader but this is happening multiple times a frames which is killing performance. Can the texture edit be done in the shader instead?
I'm passing the texture first:
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas);
And then using it as a uniform in the shader.. Would I clip it in the fragment shader or the vertex shader?