sphere texture

Started by matan45, October 05, 2017, 10:32:22

Previous topic - Next topic

matan45

why i have this bug when i texture ball?


https://imgur.com/boaIvDr

KaiHH

With standard filtering, OpenGL is interpolating beyond the edges of the texture at the coordinates around 0.0 and 1.0 and uses the texture's border color wraps around/repeats at the other side of the texture.
Use CLAMP_TO_EDGE wrap mode to fix this:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

matan45