Home Technical Talk

Which file formats should I use for what purpose?

Zot
Zot
polycounter lvl 4
Offline / Send Message
Zot polycounter lvl 4
Hello,

I always used 8 bit .png file format for all my assets. But I see some high quality assets use .tiff, .ddc or other file formats. I was wondering what file format should I use for what purpose, is there a guide?

Please help.

Replies

  • Eric Chadwick
    Options
    Offline / Send Message
    What is your purpose? We need more information from you.

    Some generic info here, but it really depends on your target.
    http://wiki.polycount.com/wiki/Texture_formats
  • Zot
    Options
    Offline / Send Message
    Zot polycounter lvl 4
    Mostly I do game assets, like houses and environment for games. And I always used 8bit png maps. But sometimes some professional share his work and I see tiff file format, and I though that I might be wrong to use png...
  • Eric Chadwick
    Options
    Offline / Send Message
    What engine? What hardware target?

    Is the art for portfolio, or for production in an actual game?
  • Zot
    Options
    Offline / Send Message
    Zot polycounter lvl 4
    I do .png for Unity at work. But I am doing art for portfolio in my free time.
  • Zot
    Options
    Offline / Send Message
    Zot polycounter lvl 4
    I just want to make best quality PBR texture set maps for my portfolio, I use baseColor, Roughness, normal and metal maps.
  • Eric Chadwick
    Options
    Offline / Send Message
    For portfolio use it doesn't matter. Regular full-color PNGs are fine.
  • Zot
    Options
    Offline / Send Message
    Zot polycounter lvl 4
    Is it critical to use 8 bit instead of 16 bit png's? I use Substance Designer from time to time and 8 bit depth creates layering curves.
  • Eric Chadwick
    Options
    Offline / Send Message
    Not critical. Use what works best.
  • RN
    Options
    Offline / Send Message
    RN sublime tool
    Here's a point in favor of using 16 bit: if you need that depth, you keep it, and if you don't need it you can just downgrade it later to 8 bit (easily done with a batch process tool). This is a lossy process, so you can't do the opposite.
  • EarthQuake
    Options
    Offline / Send Message
    There's a few important things to consider:

    1. The bit-depth that you bake your source content at. Generally speaking, it's a good idea to bake at 16 bit so you have a very high quality input for your texture.

    2. The bit-depth that you have for your working files in Photoshop, Painter, etc. Extra bit depth is helpful for certain types of maps where precision is important. It's a good idea to author height maps in 16 bits, perhaps normal maps as well, but maps like albedo, roughness or metalness don't often need it. Theoretically any kind of map can benefit from a larger bit-depth space, because blending and blurring and things like that happen with better precision, but again, for some map types it's not necessary and can be wasteful (slower/harder to work with) with complex documents.

    3. The bit depth that you send to your target. This could be a game engine or an offline renderer or whatever. If it's a game engine, you will often be using 8-bit file formats because 16-bit formats have less options for compression and take up a lot of video memory, though there are some fancier compression types for higher bit-depth normal and height maps these days. Generally speaking, while you may author your maps 16-bit, they'll probably get downsampled and dithered when exporting to 8 bit for in-game use.

    If you're doing portfolio work, it depends on the target. For something like Toolbag or an offline renderer, you can keep working with uncompressed 16-bit files if you want. If you're building a large scene in Unity or Unreal, you're probably going to want to follow normal gave dev conventions, so 8-bit maps would be sensible.

    The specific file format, like PNG, TIF or PSD, doesn't make much difference. If using something like Toolbag, you can load those formats directly. If using something like Unreal or Unity, the engine will convert to a compressed DDS format anyway. PNGs do lossless compression which means a smaller size on disk (but no less video memory use), and they're usually slower to save and load than other formats. If you're using PNGs and editing stuff in Photoshop it can be a little annoying, because PS doesn't handle PNG alpha very well.
  • Steamy_Steve
    Options
    Offline / Send Message
    Steamy_Steve triangle
    A little NOTE: if you decide to move on to Unreal, do not use 16bit PNGs. Instead, go for 16bit TGA.
    UE4 has issues in interpreting 16bit PNGs, making them look brighter.

    I banged my head on this for a couple of days.....
  • Zot
    Options
    Offline / Send Message
    Zot polycounter lvl 4
    Thanks to everyone for help. But...
    A little NOTE: if you decide to move on to Unreal, do not use 16bit PNGs. Instead, go for 16bit TGA.
    UE4 has issues in interpreting 16bit PNGs, making them look brighter.

    I banged my head on this for a couple of days.....
    What the main difference between TGA and TIF?
  • Eric Chadwick
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    Stick to png - tga is basically obsolete and tiffs are just a pain in the arse. 
     If you're doing HDR stuff use exr because it's what we'll all be using in the future. 

    16bit pngs are fine in unreal, you just have to deal with them correctly - it's documented. 
  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    A little NOTE: if you decide to move on to Unreal, do not use 16bit PNGs. Instead, go for 16bit TGA.
    UE4 has issues in interpreting 16bit PNGs, making them look brighter.

    I banged my head on this for a couple of days.....
    There is no such thing as a 16bit TGA, the format only supports 8 bits per channel.

    TGAs don't support compression or different bit depths per channel (24bit RGB, 32bit RGBA) and this obsolescence is precisely the reason it always works, no options to mess about with. In theory I would use PNG but I remember back in the day photoshop would save the alpha channel in PNG files wrong and it just wasn't worth the time to troubleshoot. Then there are the issues as mentioned with 16bit files be it TGA or TIF, but most textures used in games are output at 8bits per channel anyway so TGA is fine for most cases.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    m4dcow said:
    A little NOTE: if you decide to move on to Unreal, do not use 16bit PNGs. Instead, go for 16bit TGA.
    UE4 has issues in interpreting 16bit PNGs, making them look brighter.

    I banged my head on this for a couple of days.....
    There is no such thing as a 16bit TGA, the format only supports 8 bits per channel.

    TGAs don't support compression or different bit depths per channel (24bit RGB, 32bit RGBA) and this obsolescence is precisely the reason it always works, no options to mess about with. In theory I would use PNG but I remember back in the day photoshop would save the alpha channel in PNG files wrong and it just wasn't worth the time to troubleshoot. Then there are the issues as mentioned with 16bit files be it TGA or TIF, but most textures used in games are output at 8bits per channel anyway so TGA is fine for most cases.
    I still use TGA a lot for this reason. Alpha channels in PNG isn't read by photoshop correctly and it makes it a nuisance to edit if you ever need to do so. 
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    Most game textures are output at less than 8bit per channel but the compression algorithms (at least where I work) seem to respond  better to 16bit inputs than they do to 8.  

    The photoshop thing is a legitimate reason to not use png.  I forget people still use the horrible bloody thing for texture generation
  • Eric Chadwick
    Options
    Offline / Send Message
    It's not hard to extract PNG alpha in Photoshop. Layers menu, Layer Mask, From Transparency.

    The alpha will be extracted from the RGB, and the alpha is converted into a layer mask. 

    Still though, I find sometimes the RGB is destroyed, unrecoverable. 

  • Eric Chadwick
    Options
    Offline / Send Message
    Also TGA does have a compression option, lossless RLE. 
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    It's not hard to extract PNG alpha in Photoshop. Layers menu, Layer Mask, From Transparency.

    The alpha will be extracted from the RGB, and the alpha is converted into a layer mask. 

    Still though, I find sometimes the RGB is destroyed, unrecoverable. 

    Yes that's the problem - It's not getting the alpha. It's that the pixels under the alpha get destroyed. Often I'll want to just remove the alpha from a texture and with PNG I can't easily do that using just photoshop. 
  • Farfarer
    Options
    Offline / Send Message
    I highly recommend you get the SuperPNG plugin for Photoshop. I wouldn't use PNGs in PS without it.
  • eriksan
    Options
    Offline / Send Message
    eriksan polycounter lvl 6
    poopipe said:
    Stick to png - tga is basically obsolete and tiffs are just a pain in the arse. 
     If you're doing HDR stuff use exr because it's what we'll all be using in the future. 

    16bit pngs are fine in unreal, you just have to deal with them correctly - it's documented. 
    Where is it documented?
  • Eric Chadwick
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    the main issue is that it assumes any 16bit image has data encoded in linear space so if it's a color image it'll apply an sRGB transform in the sampler

    It's less crap in 5 than it was on 4.x 
Sign In or Register to comment.