I am using cube mapping in an openGL demo and when I render just a solid sphere which reflects perfectly the cube map, I see some artifacts showing the cube borders:
The cube map is loaded from a vertical cross picture. I coded a special function that extract each side of the cube to give it to openGL. In my opinion this function works well, I don’t see anything bad in it (I won’t post the code here for now because it is a little complicated, but I can do it if someone wants).
Just seeing the attached screenshot, does someone know the problem?
There’s a difference between the texture border color and an actual texture border. If no texture border is present, GL will use the texture border color which is set to black by default. Here’s some more info on texture borders. GL_CLAMP_TO_EDGE makes sure you don’t sample border pixels (if present) nor the texture border color.