As a hacky solution, I've changed the geometry of the cube to be slightly not cubic and more like
So that the edges disappear (assuming the camera is inside). The texture is cropped a bit as a result, but this is much less noticeable.
I used to define the position of the 3 x 8 vertices as:
let _positions = [
SCNVector3(x:-halfSide, y:-halfSide, z: halfSide),
SCNVector3(x: halfSide, y:-halfSide, z: halfSide),
SCNVector3(x:-halfSide, y:-halfSide, z: -halfSide),
SCNVector3(x: halfSide, y:-halfSide, z: -halfSide),
SCNVector3(x:-halfSide, y: halfSide, z: halfSide),
SCNVector3(x: halfSide, y: halfSide, z: halfSide),
SCNVector3(x:-halfSide, y: halfSide, z: -halfSide),
SCNVector3(x: halfSide, y: halfSide, z: -halfSide),
]
let positions = _positions + _positions + _positions
and now I'm replacing the last line by:
let X = 0
let Y = 8
let Z = 16
func killEdgeStitching(positions: [SCNVector3], axis: Int) -> [SCNVector3] {
var res = [SCNVector3]()
let delta = Float(0.99)
for pos in positions {
var newPosition = SCNVector3(x: pos.x, y: pos.y, z: pos.z)
switch axis {
case X:
newPosition.x *= delta
case Y:
newPosition.y *= delta
default:
newPosition.z *= delta
}
res.append(newPosition)
}
return res
}
let positions = killEdgeStitching(positions: _positions, axis: X) +
killEdgeStitching(positions: _positions, axis: Y) +
killEdgeStitching(positions: _positions, axis: Z)
I'll leave that out there, but hopefully someone will have a real answer!