I would like to mix camera preview SurfaceTexture
with some overlay texture. I am using these shaders for processing:
private final String vss =
The method on the above save lots of my time. Thank you guru:
GLES20.glUniform1i(sTextureHandle, 1);
GLES20.glActiveTexture(GLES20.GL_TEXTURE1);
GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
sTextureId);
For your 2D texture:
GLES20.glUniform1i(filterTextureHandle, 0);
GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, filterTextureID);
Change the texture index is a good way to solve this.