Download

Which are the best texture file formats to import to UE4?

I have seen in the guide that there are many importable file formats for texture to ue4, but I wonder if there is a favourite format for ue4.
I mean is it the same if I import psd, bmp or tga files or one of those is better than an other.
I’d go with jpeg files but I wonder if psd or tga files have best features

I prefer psd, because then I can directly edit it in photoshop :slight_smile: But my team and I mainly use tga and png

thanks for the super fast reply; but… can you edit any other format directly in photoshop or in gimp? Or is it just an option for psd?

You can edit every texture in gimp or photoshop, but you wont be able to keep all the layers/effects/… e.g with psd I can have different layers in my file → then I can save and import it into the UE4 → after some time, when I have to edit something in the texture, I can just open the psd file and then I can still edit stuff in the file (e.g delete a layer,…)

great, thanks! So i guess I can also use psd files temorary while modiying a scene and at the end replace them with jpeg files to reduce size;
I take it for granted that jpeg are smaller than psd; am also in ue4 am I correct?

I dont know if it is possible to import a jpeg into the UE4. Never did it before :slight_smile: -> use png or tga in the end

Typically, I keep everything from one asset as layers in a .psd while working on them. However, I save them out to .tga as diffuse, normal, etc. For UE4, I stick roughness, metallic, specular, and opacity if applicable into the RGBA of a .tga.

A .jpg might not always be the best choice every time, but you can bring them in just fine. I have a few in a current level.

Yeah I would stay away from Jpegs if you can since the compression quality isn’t nearly as good as .tga and .png. Plus Jpegs cant hold an alpha channel if memory serves.

Today I have made my digital designers team to convert Tga files yo jpg and the textures made our project to increase from 900 mb to nearly 4 gb. I was looking for the best extension to use with UE4 and bumped over the thread.

You should never you Jpegs in an art pipeline, unless you are outputting it to the web, and then only as the output. (I would argue that PNG is better since it is a lossless compression, which means the image looks exactly like it was output from the engine, but jpeg can compress smaller, and on mobile that bandwidth difference can still matter.)\

Keep in mind that Unreal compresses your texture to be efficient on the GPUs that you are targeting. So if you are outputting an OpenGL ES Android/iOs game, it will compress your textures using OpenGL ES compatible textures, versus the DX 11 compatible texutres if your target is DX11/12. Or OpenGL as found on the Mac vs Linux, which support different versions of the standard and thus different texture formats.

And compression works in a lot of different ways, but what almost all of those formats have in common is they are designed to lose information about your texture. Jpeg does this by converting your 16 million colors down to 65536 colors (16bits per pixel with no alpha vs the 24bits per pixel plus 8 bits per alpha of a normal photoshop image.) That information that is simply lost, you don’t get it back. Then it takes four pixels and encodes it to be smaller, further reducing the quality, and producing blocky artifacts for smaller sizes, which you use all the time, even if you don’t realize it.

Now , Unreal has to take that jpg file, uncompress it, and then re compress it in one of those compatible schemes. I won’t go through all of them, but a common practice in all of them is to simply throw away pixels to save space. It then interpolates between on the GPU to get that information back. It also drops the information down further, to maybe 12 bits or even 8 bits per pixel, and some of them throw away the alpha, and some of them throw away every other red color set of bits or blue color set of bits.

So all of this goes on top of your already horribly mangled jpeg picture, and this stuff shows up as lower quality game art. If you are wondering why AAA studios games always look better than an amatuer, this is about 33% of it, they never use a lossless input to the engine.

Now, PNGs are lossless and can handle Alpha, but PSDs and PSBs are better thanks to the layer information they can contain, which fits better in the Art pipeline so that you can more easily modify images. ( A PSB file is a PSD file that can be larger than 4GB and 300,000 x 300,000 pixels, versus the PSDs 30,000 x 30,000 pixels.)

I want to be clear that in the above, I talk about bits per pixel, not bits per channel. When you are using Photoshop, and I believe The Gimp, when you see the menu item to change from 8bit ot 16bit to 32bit, they are talking bits per color. The translation is simple. Each pixel is made up of the colors red blue and green, and in Art programs receive an equal number or bits per color. Alpha is usually also the same number of bits as one of the colors, so you can count it as a color, thus 4 colors of 8bits per color is 32 bits and is equivalent to a 16 million color image plus Alpha.

Bits per color Bits per pixel (plus Alpha)
32 8
64 16
128 32

Keep in mind that the compression formats for the GPUs do not always follow these rules. Some of them give Alpha only 1 or 2 bits, some of them give green more bits than red and blue, and many other schemes that match the use case of the actual asset. So it is harder to know what the final compression size you will get out of them in the final game you compile.

Also, Unreal Engine 4 has the ability to use 16 bit per color images to increase the image quality of the game. your monitor cannot display 16 bit per color images. No ones can. But Photoshop can deal with them, as can Substance Painter and Designer, and you will achieve another 33% of the quality of the AAA studios. The bad new s here is it takes a few days or weeks to get used to working with these, and if your monitor is not calibrated, you can easily destroy any benefit you might gain, or simply make it worse. your monitor might be close enough to work, however.

A calibrated monitor will bring another 5% of the quality of AAA games. A 12bit Calibrated monitor can bring 15% more of the AAA quality.

the other 50% of the quality comes from taste, and that needs more than I can give you in a post.

Hopefully this is helpful.

Useful post, BillDStrong, thanks. It confirms that I’ve been right all along in using PNG.

Now I just need to get the hang of deciding the dimensions I need for each texture based on their usage and minimise the amount of trial and error.

I always save my PSD’s out to Targa format.
I was told this is how it is done in AAA production.

I am scared of PSD’s because my PSD’s can get tremendous.
But What happens when a PSD is cooked?
Does it take up additional resources with extra information, or does it get optimized just as good as TGA format?
Have I been doing an unnecessary step all along?

I’d suggest avoiding PNG files when working with transparency or alpha channels, it’s way more quirky than it should be, and half the issue is how Photoshop handles it. I use TGA mostly, but PNG is nice because it’s friendlier with Windows and web.

I also use only TGA. It handles the alpha channel very well.
And from a coding perspective, the data is easily accessible (like in a bitmap) and comes with just a simple 17 byte header :slight_smile:

What issue have you encountered?
I use PNG extensivly with and without PS without issue.

Photoshop doesn’t give you a dedicated alpha channel with PNG like it does with every other format. It’s issues is why SuperPNG exists.

Ahh, I think i get it :slight_smile:

But just in case…
You are saying that PS does not let you work on a Alpha channel like any other colour channel and have it encoded into the output, IE: resulting in 4 gray scale channels to work with?

Yeah, it’s been a while since I tried, basically it completely ignores any alpha channel, which is annoying if you are using the alpha channel for anything fancy. I think there’s also some issue if you completely erase parts on the image, it’ll lose all RGB color information as well, which is destructive and not ideal.

I also use TGA and PSD. I used to use PNG- call me a bit of a PNG fanboy if you will, mainly from my legs in the web and graphic design field. However, there has been buzz lately that PNG is going the way of the dodo, with the trend being moving over to vector formats (mainly SVG) on the web. I’ve always been a raster sort of guy, so this hurts my soul a little… it is what it is. But that’s the web and such…

I prefer TGA for ease-of-use across the board; as KVogler pointed out, from a raw code point, it’s pretty painless to work with. TGA is also very widely supported. PNG is great because it is a lossless format (and thus generally free from compression artifacts, like JPEG), but its original intended use was as a replacement for the GIF format. Portable Network Graphics vs Graphics Interchange Format. While PNG can be used for rendering (both offline and realtime), that wasn’t the intended use, keep that in mind. TGA however, has a slightly different history. Per Wikipedia:

… The format can store image data with 8, 15, 16, 24, or 32 bits of precision per pixel – the maximum 24 bits of RGB and an extra 8-bit alpha channel. Color data can be color-mapped, or in direct color or truecolor format. Image data may be stored raw, or optionally, a lossless RLE compression similar to PackBits can be employed. This type of compression performs poorly for typical photographic images, but works acceptably well for simpler images, such as icons, cartoons and line drawings.

For rendering “stuffs”, I personally jump on the TGA wagon, since it strikes a chord as far as being more intended for that sort of stuff. In the end though, it comes down to what works best for a given person/project. Your toolchain, art style, target package size, etc all come into play here. Someone mentioned that UE handles compression internally as it pleased; don’t be mistaken: there are size differences between the formats, even after UE waves its magic wand over them. So be sure to do your own tests and find what works best for you, quality/size/performance wise.