LWJGL Forum

Please login or register.

Login with username, password and session length

Author Topic: sphere texture  (Read 99 times)

matan45

  • Newbie
  • *
  • Offline Offline
  • Posts: 8
sphere texture
« on: October 05, 2017, 10:32:22 »

why i have this bug when i texture ball?


https://imgur.com/boaIvDr
Logged

KaiHH

  • Newbie
  • *
  • Offline Offline
  • Posts: 6
Re: sphere texture
« Reply #1 on: October 05, 2017, 17:54:55 »

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:
Code: [Select]
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
Logged

matan45

  • Newbie
  • *
  • Offline Offline
  • Posts: 8
Re: sphere texture
« Reply #2 on: October 06, 2017, 05:12:47 »

is not fixing it
Logged