TGA files are not uploading in the 3D importer

As mentioned here 5 months ago, Roblox Studio has been having issues uploading TGA files through the 3D importer window. They just simply refuse to upload, with the error code -1:
image

However, PNG files do work fine, which means the issue is specific to the way the Editor handles TGA files, and not related to the model itself:
image

It is easy to reproduce the bug. Simply export a FBX with a TGA texture applied to it, and try to upload it.

Expected behavior

The textures should upload fine with the TGA textures applied. They used to apply properly but after certain updates to Roblox Studio, they stopped uploading entirely. Given that TGA is an industry standard, and the advantages it has given how it works with alpha channels instead of transparency, it’s a no brainer that it is a format that should not be discarded from Roblox

A private message is associated with this bug report

3 Likes

Does Roblox not have its own format? I do notice differences in alpha/transparency when I upload a transparent texture in either format, mostly like they turn into white pixels the more transparent something is. I’ve seen a case where people in the forums were reporting behavior of PNG transparencies not being able to replicate their TGA uploads, and this behavior doesn’t happen exclusively in Roblox.

I’ve always used TGA for anything game-engine related, as it has been an industry standard format people use for their textures for a long time. I’ve tried using PNG many years ago in different engines and I had similar problems as the ones portrayed in this thread.

1 Like

Maybe the TGA converter on their side is doing some color dilation, intentionally or not, to fix it, but exporting PNGs directly from whatever software you use might not be.

I always use dilation for both TGA and PNG. As far as I know, PNG makes fully transparent pixels as fully white in the RGB channels. It could be something from the exporter, like you mentioned, as I’ve seen this happen in different engines too, however it has happened in both Photoshop and Substance Painter for me.

Also… I didn’t mean to post that as I was having trouble getting a good confirmation. I was messing around with trying to find an image I uploaded as a JPEG in the client’s cache, but it didn’t seem to come up anywhere I checked. I checked for JPEGs, PNGs and WEBPs, as it’s very easy to do so, but I only found PNGs, and very few of them, so I think there’s some place I’m not looking.

That’s very interesting. I didn’t know the textures downloaded uncompressed like that. I thought it was all packed or something. Granted, I haven’t really checked in the files the Roblox client downloads.

Also also, I think I know why this issue is occurring. Out of all the supported types, PNG , JPG , BMP and TGA , TGA is the only format to not have a “magic number” inside of the file itself that can be used to identify it. For example, for PNG , the characters PNG are at the very start, and JPG has JFIF , and BMP has BM , but TGA has nothing, so it’s more difficult to check the file type. The more you know.

Also very interesting finding! I hope a member of the staff reads this post, it may help narrowing down the issue (Although I figure they’d already know this given they had to work with the format themselves)

1 Like

With .TGA images or anything using transparency because of mipmapping (basically reducing the resolution of an image as you get further away from it) , you need to fill the transparent spaces with what ever color you want the engine to use the further you get from it. (usually called a dilation setting)

Using a .TGA with an alpha map is just to specify what parts of the image are transparent and what aren’t. The colored/blurred pixels like in this image are so that when you back away from the image it knows what color to pull from the edge of the cutout. If you don’t have specified things to pull from like in a transparent .PNG it just defaults to white. Like in the 2nd image

seugdhih2_Preview

To speak to the issue of the .TGA files not being able to be uploaded through the 3d Importer I usually use the asset manager to import .TGA files. Seems to be the most consistent. If that does not solve it for you id be curious to see your export settings on the image to potentially fix it there.

With .TGA images or anything using transparency because of mipmapping (basically reducing the resolution of an image as you get further away from it) , you need to fill the transparent spaces with what ever color you want the engine to use the further you get from it. (usually called a dilation setting)

Using a .TGA with an alpha map is just to specify what parts of the image are transparent and what aren’t. The colored/blurred pixels like in this image are so that when you back away from the image it knows what color to pull from the edge of the cutout. If you don’t have specified things to pull from like in a transparent .PNG it just defaults to white. Like in the 2nd image

I’m already familiar with edge bleeding, and it is besides the point. I do appreciate trying to clarify that point, however, since I know some people aren’t familiar with this.
As I’ve already stated in the former post, I always dilate my textures when exporting from 3dsmax or Substance Painter. I may have forgotten to mention, that when using Photoshop, I use the “Solidify” plugin in its stead to generate said dilation, which looks very similar to your image.
(A little edit, to mention this for anyone scrolling through, Solidify is a very old plugin by Flaming Pear. I don’t know if it still works with newer versions of Photoshop)

To speak to the issue of the .TGA files not being able to be uploaded through the 3d Importer I usually use the asset manager to import .TGA files. Seems to be the most consistent. If that does not solve it for you id be curious to see your export settings on the image to potentially fix it there.

I haven’t uploaded textures in a while, so I’m not sure of the current state of the bug, besides getting that error in the 3D importer still. Back then I was able to upload them through the asset manager, which was a little tedious given that the 3D importer automatically creates the Surface Appearance for each part. This should not be the intended workflow as it is very inefficient.

It is very useful and time saving for when you are trying to upload multiple MeshParts. I’m not the only person who seems to have issues with PNG transparencies either, as you can see in this thread (Which was already linked in a former post)

In my original thread, and here you can see I am not the only person having this issue. As for my upload settings, I simply save in Photoshop as either 24 or 32 bit. I tried with both RLE and without RLE compression too, same result.

[EDIT] I just realized you are the person who created that thread, haha. Apologies for linking to your own post.