I get intermittent seams in textures that I apply to spheres in SceneKit. It is always on the "back" of the sphere where two edges of the texture meet. It seems that the texture does not quite connect with itself, and you can see the background through a thin line. The problem seems to exist on all devices and in all recent versions of iOS. My experiments showed that texture resolution seems to be a factor, but I didn't nail exactly what it is.
I attached a screenshot to illustrate on a white background for clarity, but the seam is not inherently white, it just allows the background to display:

Does anyone know why SceneKit will handle textures this way? I have a fairly simple implementation, just creating a sphere and material and applying a diffuse and normal map to it. Here is my code:
// create planet SCNNode *baseNode = [SCNNode node]; [baseNode setName:name]; // Planet SCNSphere *planet = [SCNSphere sphereWithRadius:5]; SCNNode *planetNode = [SCNNode nodeWithGeometry:planet]; [planetNode setName:@"planetNode"]; [baseNode addChildNode:planetNode]; SCNMaterial *material = [SCNMaterial material]; material.shininess = 1; material.normal.intensity = 0.5; material.normal.contents = normalMap; material.diffuse.contents = diffuseMap; planetNode.geometry.materials = @[material];
Does anyone have experience in what can cause this “seam” to appear, and how can I get rid of it? My textures are usually either 1000x500 or 2048x1024, depending on the situation, and the seam appeared in both resolutions. Is there an ideal resolution for SceneKit textures or something known that can cause this behavior?
ios textures scenekit texture-mapping
Nerrolken
source share