importing grayscale targa images error


I’m having problem importing grayscale .tga textures in UE. It says “Failed to import”… I opened the texture in photoshop and changed the mode from GRAYSCALE to RGB COLOR and it loaded just fine in UE.
It wouldn’t be much of a problem but the textures (like roughness and metallic) that are exported from substance designer, don’t contain color information and are exported as grayscale.
So I have to go the extra mile and change their mode to RGB so that UE can read them.

Is there any chance that UE will support grayscale textures in the future releases?

I also have this problem. Changing the color mode in PS is kind of a pain.

What are the settings you are using when exporting from Substance? I use Substance Designer all the time and I have never had to go through this step with my Roughness and Metallic maps that are exported right from Substance as .TGA or .PNG.

Well there aren’t much options to choose from, except for the file type (.tga in this case), which outputs and the naming convention.
Here is a screenshot.

Check the bitdepth of the image in an image editor, as I recall, SD may write the file out at an incompatible bit depth. You can re-save it in photoshop to get around that.

The bit depth is fine - 8bit (targa file type can’t be saved as 16bit or 32bit, well at least in photoshop)

I’ve found a workaround - you just add a gradient map between the last node that goes into the roughness or metallic output node, so that way the targa texture will be exported as color and not grayscale.

i know its a while ago, but thanks for posting your solution. i came into the same problem yesterday. Interessting way of workaround :). i imported my maps quick to PS and changed the ColorMode. But yeah, yours is way faster and better. Thanks
for this! :slight_smile:

It’s no problem :), but I’m still baffled why no one has noticed this problem before and why is this still an issue with Unreal Engine.

The problem is UE4 does not support single channel TGA so it’s not even a bug. Console output shows this

if you try to import.
I guess there were some roadblocks in implementation and it’s easier just to convert greyscale to RGB or just import other greyscale format like PNG

The problem is that the .tga RGB textures are much heavier, than the grayscale - so if I only have grayscale info in the texture, it seems a waste to use the other channels when they are not needed.
Yes, maybe PNG is another alternative.

Actually not. After import double click on texture and change compression settings from default to grayscale - UE4 will treat this texture like a true greyscale in the engine, without using other 3 channels. But IMHO just using PNG for greyscale is easier and seems like intended use.

I just tried that and it shows some weird stats on the resource size setting:

with default compression the image was:

with Grayscale compression:
And the “Has Alpha Channel” sets it’s self to True, even if I check “compress without alpha”

Maybe the alpha channel adds more weight to it?

Good catch! Here is my test with 2k picture(Also I turned off mipmaps to round numbers):

  • Compression settings: Default(DXT1); sRGB: On/Off(Does not matter); Size: 2048kb
  • Compression settings: Grayscale(G8); sRGB: Off; Size: 4096kb
  • Compression settings: Grayscale(G8->R8G8B8A8); sRGB: On(This switched Compressions setting from G8 to R8G8B8A8); Size: 16’384kb
  • Compression settings: Alpha(BC4); sRGB: Off;Size: 2048kb
  • **Grayscale 8-bit TGA that can’t be imported into UE4 is 4096kb

My guess is that Grayscale “Compression” is lossless G8 format so you will keep every detail in your texture. Alpha is a compressed Grayscale - you will lose details. Default is heavy compressed format that has 4 channels(It works fine for single colored texture, but if you have 4 unique masks in channels you will get glitches and artifacts on their intersections). Turning on sRGB on G8 will turn it into extremely heavy uncompressed format with 4 channels, dunno why o.o

And yes, G8 size is equal 8-bit TGA with single channel

Great! Thank you for making extensive research on this!

ah thanks for this information. The workaround with using png for the greyscale maps is a bit unhandy for substance designer and “fast” workflow. As far as i could see it, its just possible to export 1 type of file format for all the 4 textures you getting out.
PNG create wrong colors on the BaseColor Map. So just for doing no research, i starting to use tga. also worked well with sketchfab. so i have just 1 texture package for both. So converting it into RGB or Your soultion (i did not tried yet), seems fine for me. :slight_smile: