I\'m trying to display the camera stream in a GLSurfaceView via a SurfaceTexture trasmitted to OpenGL ES 2.0 shaders.
I took inspiration from this post.
The imag
I have used the SurfaceTexture succesfully to draw camera frames on a custom opengl texture without using the transformation matrix provided by android.
Just try defining your indices vertices and textures the way you would do it for a normal texture draw. Like this for example.
const GLfloat Vertices[] = {0.5, -0.5, 0,
0.5, 0.5, 0,
-0.5, 0.5, 0,
-0.5, -0.5, 0};
const GLubyte Indices[] = { 0, 1, 2,
2, 3, 0 };
const GLfloat Textures[] = { 1.,0.,
0.,0.,
0.,1.,
1.,1. };
You should be able to use the surfacetexture the way you use a normal texture.
In case you want to perform some sort of 3D projection, this is a good post on how to generate a proper MVP matrix. Which you could use to multiply with the position in the vertex shader.