After successfully applying an image texture to a cube through UV mapping for a photo-sphere viewer, I noticed that thin straight lines are visible where the faces of the cube join.
Interestingly, this issue does not occur when splitting texture tiles via Canvas and using MultiMaterial on the cube.
The comparison image below demonstrates the results obtained from these two different methods of texturing (click for larger view):
https://i.sstatic.net/xxqqw.png
You can view a live example at CodePen.io
The original image used as the texture can be accessed here
Shown here is the code snippet responsible for the UV mapping process:
function mapCubeUV(geometry, cubeH) {
// function logic
}
// More code snippets follow...
Upon inspecting the values generated by the UV mapping function, it appears that everything is in order. The produced UV values correctly correspond with the dimensions of the image. Here's a sample dump:
Face VerticeA VerticeB VerticeC
0: ( 0,1), ( 0,0), (0.125,1)
1: ( 0,0), (0.125,0), (0.125,1)
2: (0.125,1), (0.125,0), ( 0.25,1)
3: (0.125,0), ( 0.25,0), ( 0.25,1)
4: ( 0.25,1), ( 0.25,0), (0.375,1)
5: ( 0.25,0), (0.375,0), (0.375,1)
6: (0.375,1), (0.375,0), ( 0.5,1)
7: (0.375,0), ( 0.5,0), ( 0.5,1)
8: ( 0.5,1), ( 0.5,0), (0.625,1)
9: ( 0.5,0), (0.625,0), (0.625,1)
10: (0.625,1), (0.625,0), ( 0.75,1)
11: (0.625,0), ( 0.75,0), ( 0.75,1)
Is there an error in my implementation or is there a known issue with Three.js causing this problem?
P.S. This test was based on an example from the Three.js website
P.P.S
A similar question addressing seams on cube edges when using a texture atlas can be found HERE (albeit not related to manual UV map calculations)