Skip to main content
3 of 5
added description of what I have tried to solve the problem
martin pilch
  • 551
  • 2
  • 6
  • 17

Skybox texture artifact on edge

I have strange problem with drawing skybox texture on Mac. On iPhone everything is going fine. I have tried to change near and far planes value with no success.

It is skybox of six textures and for every texture I set this:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 

What could be a problem?

Screenshot: screen

EDIT:

I have tried to set background color to red, to ensure if it is bleeding through the texture

I have also tried to change coords of the texture to this:

float err_corr = 0.5 / TEXTURE_SIZE; GLfloat vertices[24] = { -1.0f - err_corr, -1.0f - err_corr, 1.0f + err_corr, 1.0f + err_corr, -1.0f - err_corr, 1.0f + err_corr, -1.0f - err_corr, 1.0f + err_corr, 1.0f + err_corr, 1.0f + err_corr, 1.0f + err_corr, 1.0f + err_corr, -1.0f - err_corr, -1.0f - err_corr, -1.0f - err_corr, 1.0f + err_corr, -1.0f - err_corr, -1.0f - err_corr, -1.0f - err_corr, 1.0f + err_corr, -1.0f - err_corr, 1.0f + err_corr, 1.0f + err_corr, -1.0f - err_corr, }; 

And the box is drawn in this order: GLubyte indices[14] = {0, 1, 2, 3, 7, 1, 5, 4, 7, 6, 2, 4, 0, 1};

martin pilch
  • 551
  • 2
  • 6
  • 17