Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question I converted all my TGA textures to PNG, but there are UV issues

Discussion in 'Editor & General Support' started by skinwalker, Feb 25, 2021.

  1. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Hello,

    Like many, I'm buying environment models from the asset store and most of the times the creators use TGA at least for the Albedo maps, now this creates a problem, because the 4k textures take 65 mb disk space and I'm aware that in unity builds it's reduced to ~5mb, but still having one level pack that's 8 GB is a problem to push it to github or store it on my HDD.

    I came across this topic and followed the steps to convert all of my TGA textures to PNG and the size was reduced from 8GB to 1GB, which is great, but when I open the prefab there are obvious UV seams like the image below. I've read that "if done right" PNGs can produce the exact same result as TGA, so I don't know what's the problem here, but all the models using the PNGs textures look broken, maybe I have to change some import settings?

    Any help would be appreciated, I have tried this method on 3 asset packs and all of them had UV seams. Here you can see my prefab when using the PNGs, but those lines in the middle (mainly produced by the specular map, but if you look closer there are lines on the albedo as well) are not there when I use TGA. I have also noticed other weird UV issues, but it depends on the prefab I'm looking at.

     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,616
    UV's are stored in the model, not the image- so there's no way that your UVs could have changed. Either you've changed the way the image looks, or it's some different compression/import setting. Have you looked at the image maps before and after to make sure that they are essentially the same?
     
  3. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    I'm comparing them to other textures that I have working in the project and the import settings are the same. I tried to turn on / off a couple of settings, but it didnt make a difference.
     
  4. STEAKandGAMES

    STEAKandGAMES

    Joined:
    May 17, 2017
    Posts:
    41
    just to complete the circle, in case anyone else ever has a similar issue after converting TGA files to PNG. we found that when using ImageMagick to convert the TGA files to PNG, it was flipping the files vertically. Adding the command switch -flip corrects this during the conversion.

    Example:
    for f in *.tga; do magick ./"$f" -flip ./"${f%.tga}.png"; done;


    FYI: you will also need to then rename the meta files from *.tga.meta to *.png.meta
     
    skinwalker likes this.