4

I am rendering a model imported from a .ctm file into threejs v71. I'm then adding a texture using a MeshBasicMaterial with map.

The original model was made in Agisoft Photoscan, exported as .obj, and then converted to OpenCTM format using the official OpenCTM viewer program. The .ctm model itself is here.

It looks correct, except that strange "seams" appear on the texture when I load the .ctm . The .obj loads fine in three.js with no seams. What are these, and how do I get rid of them?

Here's a screenshot:

enter image description here

These "seams" are not present in the texture file:

enter image description here

UPDATE: I noticed that the seams are also visible when viewing the .ctm in the ctm viewer, so this is probably an OpenCtm conversion problem rather than a threejs loading issue.

foobarbecue
  • 6,114
  • 3
  • 25
  • 50

3 Answers3

2

To my chagrin it seems this is a longstanding bug in OpenCTM.

The other answers must not be reproducing the situation described in the question.

Edit: I now fully understand this problem and have a workaround for it. The issue is that most programs (Photoscan, Blender) have "per-loop" vertices instead of actual "per-vertex" textures. This just means that when a vertex is shared by two polygons, there can be multiple UV coordinates for that vertex. CTM can only have one UV coordinate per vertex and that's what causes the problem at texture seams.

My workaround in blender is:

  • Seams from Islands
  • Select an edge on seam, select similar --> seam. Now all seams should be selected
  • Mesh --> Edges --> Edge Split
  • Export to .obj, use ctmviewer.exe to import and export to .ctm.

The seams are still visible if you look closely but no longer obvious multicolored bands.

foobarbecue
  • 6,114
  • 3
  • 25
  • 50
  • The visible seams are likely do to a hard edge then. If it is an actual edge split you will also get two independent normals at that point, hence causing a seam when shading. – pailhead Mar 23 '17 at 04:31
0

I had the same issue with my Agisoft Photoscan model/texture, so I opened the texture in Photoshop and noticed it had transparency between all the patches of texture. I filled all the gaps using content aware fill and saved the texture out as a .tif without layers. This solved the issue for me.

  • There is no transparency in my texture file. You seem to be describing a different problem (are you using CTM?). – foobarbecue Mar 16 '16 at 05:00
0

Or you can just remove the alpha-channel from the texture image file (or use JPG format during export).

dead_PyKto
  • 13
  • 1
  • 7