Texture repeats even with GL_CLAMP_TO_EDGE set [FIXED]
- by Lliane
Hi, i'm trying to put a translucing texture on a face which uses points 1 to 4 (don't mind the numbers) on the following screenshot
Sadly as you can see the texture repeats herself in both dimensions, I tried to switch the TEXTURE_WRAP_S from REPEAT to CLAMP_to_EDGE but it doesn't change anything. Texture loading code is here :
gl.glBindTexture(gl.GL_TEXTURE_2D, mTexture.get(4));
gl.glActiveTexture(4);
gl.glTexParameterf(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER,
gl.GL_LINEAR);
gl.glTexParameterf(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MAG_FILTER,
gl.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);
gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, gl.GL_RGBA,
shadowbmp.width, shadowbmp.height, 0,
gl.GL_RGBA, gl.GL_UNSIGNED_SHORT_4_4_4_4,
shadowbmp.buffer);
Texture coordinates are the following :
float shadow_bot_text[] = {
0.0f, 0.0f,
0.0f, 1.0f,
1.0f, 0.0f,
1.0f, 1.0f
};
Thanks