Forum

Author Topic: [Help!] Textures coming out really bad! Why? :(  (Read 5098 times)

3D_Scan_Fan

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
[Help!] Textures coming out really bad! Why? :(
« on: March 11, 2020, 04:39:24 AM »
Hi,

As the subject states, my generated textures are coming out really bad i.e. stripy, glitchy, virtually usable.

This happens after I bring the mesh back into Photoscan/Metashape from 3ds max after applying new UVs (a very simple cylindrical layout covering the mesh) and "Keep UVs" within the software.

The result is not what I've experienced before years and years ago, thus I'm pulling my hair as to why this is happening.

I've attached an example, you can see the stripes for this one.

Does anyone know or have experienced such matters?? I would really appreciate it if anyone can help me on this! :(

3D_Scan_Fan

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: [Help!] Textures coming out really bad! Why? :(
« Reply #1 on: March 12, 2020, 02:24:04 PM »
Anyone at all may I ask?

I've tried it again on a different mesh but still getting the same result! 🙁

I just want to have good working textures and I can't progress if this is happening 😢

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13995
    • View Profile
Re: [Help!] Textures coming out really bad! Why? :(
« Reply #2 on: March 12, 2020, 03:52:39 PM »
Hello 3D_Scan_Fan,

Is it possible to share any sample project (with aligned cameras and imported mesh with UV layout) and some source images for texture blending, so that we could observe similar behavior on our side and investigate the problem? If so, please send the download link to support@agisoft.com.
Best regards,
Alexey Pasumansky,
Agisoft LLC

3D_Scan_Fan

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: [Help!] Textures coming out really bad! Why? :(
« Reply #3 on: March 13, 2020, 03:32:13 AM »
Hello 3D_Scan_Fan,

Is it possible to share any sample project (with aligned cameras and imported mesh with UV layout) and some source images for texture blending, so that we could observe similar behavior on our side and investigate the problem? If so, please send the download link to support@agisoft.com.

Hi Alexey,

I have just sent you a WeTransfer of this project, it should have everything you need.

Please confirm that you've received it.

wojtek

  • Sr. Member
  • ****
  • Posts: 277
    • View Profile
Re: [Help!] Textures coming out really bad! Why? :(
« Reply #4 on: March 13, 2020, 11:09:45 AM »
Anyone at all may I ask?

I've tried it again on a different mesh but still getting the same result! 🙁

I just want to have good working textures and I can't progress if this is happening 😢

Is the UV layout messed up (mesh -> view mesh UVs) or only the texture map?

3D_Scan_Fan

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: [Help!] Textures coming out really bad! Why? :(
« Reply #5 on: March 13, 2020, 01:12:13 PM »
Anyone at all may I ask?

I've tried it again on a different mesh but still getting the same result! 🙁

I just want to have good working textures and I can't progress if this is happening 😢

Is the UV layout messed up (mesh -> view mesh UVs) or only the texture map?

It's only the texture map.

This happens when applying a new UV layout in 3ds max, exporting that mesh and then importing it back into Photoscan  :(

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13995
    • View Profile
Re: [Help!] Textures coming out really bad! Why? :(
« Reply #6 on: March 13, 2020, 05:07:28 PM »
Hello 3D_Scan_Fan,

Thank you for sharing the project.

I've noticed that there are some UV coordinates which are negative and which are over 1.0 value. Was it intentional?
Best regards,
Alexey Pasumansky,
Agisoft LLC

3D_Scan_Fan

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: [Help!] Textures coming out really bad! Why? :(
« Reply #7 on: March 13, 2020, 05:21:32 PM »
No, I don't quite understand that actually.

The new UVs were done in 3ds max with a Cylindrical map applied, also made to "Fit" the mesh. Thus it should've covered it.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13995
    • View Profile
Re: [Help!] Textures coming out really bad! Why? :(
« Reply #8 on: March 13, 2020, 08:16:12 PM »
Hello 3D_Scan_Fan,

I have checked the OBJ file that you are importing (with UV coordinates), it contains 3D texture coordinates (UVW) - but such representation is not supported by Metashape model importer. 2D UV coordinates are expected.
Best regards,
Alexey Pasumansky,
Agisoft LLC

3D_Scan_Fan

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: [Help!] Textures coming out really bad! Why? :(
« Reply #9 on: March 13, 2020, 08:20:04 PM »
But I've done this years ago and I never had this problem before. I think it was version 1.1 of Photoscan.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13995
    • View Profile
Re: [Help!] Textures coming out really bad! Why? :(
« Reply #10 on: March 13, 2020, 10:27:07 PM »
Hello 3D_Scan_Fan,

PhotoScan never supported 3d texture coordinates, the third column has been omitted as it is in the current Metashape version.

Also you should do something with the wrong UV coordinates which are outside the 0 - 1 interval. I've made a simple script which fixes the outliers for u and v (new OBJ is created):

Code: [Select]
import Metashape

path = Metashape.app.getOpenFileName()
output = open(path + "-2.obj", "wt")
file = open(path, "rt")

eof = False
f = False
while not eof:

line = file.readline()
if line.startswith("vt"):
vt, u, v, w = line.split()
u = float(u)
v = float(v)
w = float(w)
if u < 0:
u = 0
elif u > 1:
u = 1
if v < 0:
v = 0
elif v > 1:
v = 1
line = "vt {:0.6f} {:0.6f} {:0.6f}\n".format(u, v, w)
output.write(line)

else:
output.write(line)

if line.startswith("f"):
f = True

if f:
if line.startswith("#"):
eof = True

output.close()
file.close()

print("done")
Then imported this model and blended the texture. The result of the texture atlas is attached.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13995
    • View Profile
Re: [Help!] Textures coming out really bad! Why? :(
« Reply #11 on: March 13, 2020, 10:27:48 PM »
Also I've made a quick test with the spherical parametrization available in Metashape:
Best regards,
Alexey Pasumansky,
Agisoft LLC

3D_Scan_Fan

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: [Help!] Textures coming out really bad! Why? :(
« Reply #12 on: March 13, 2020, 10:59:54 PM »
That looks good but in older version they won't have that feature hence why we go externally.

How would I be able to do that in 3ds max?

3D_Scan_Fan

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: [Help!] Textures coming out really bad! Why? :(
« Reply #13 on: March 14, 2020, 05:15:31 AM »
Okay Alexey, I've done a quick test myself.

I went ahead and hunt down the version I used many years ago, that being Photoscan 1.1.4.

I actually rebuilt everything from the source images with the masks. I have noticed that every step was notably faster than any of the new versions.

Created a texture from newly applied UVs done in 3ds max and voila! Exactly how I remembered it!

No stripes or artifacts.

Nothing was done different.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13995
    • View Profile
Re: [Help!] Textures coming out really bad! Why? :(
« Reply #14 on: March 14, 2020, 08:59:07 PM »
Hello 3D_Scan_Fan,

So it is a different mesh, which has different UV parametrization?

If you open the old project in Metashape and import the model with UV (that you also have from old version), do you get the same result without stripes?
Best regards,
Alexey Pasumansky,
Agisoft LLC