I cannot seem to understand how texture coordinates work. I try to render a texture into two triangles and this is what I get
Where the expected output is a normal continuous image as you can imagine.
Triangles coordinates (where w = 1080
, h = 1920
):
0, 0, w, 0, 0, h,
w, 0, 0, h, w, h
Texture coordinates
0, 1, 1, 1, 0, 0,
1, 1, 1, 0, 0, 0
Texture parameters
gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_REPLACE);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);
REPEAT
instead ofCLAMP_TO_EDGE
but this hasn't changed the output. \$\endgroup\$