Search Unity

Your texture file-format choice and workflow?

Discussion in 'Formats & External Tools' started by KristofferH, Oct 27, 2012.

  1. KristofferH

    KristofferH

    Joined:
    Oct 27, 2012
    Posts:
    52
    Hi everybody, I just joind the network today :)

    It's pretty cool that Unity can take PSD files and convert them to textures, however I'm not too keen on the workflow of automatic importing working files, especially not when you have large textures with lots of layers so the PSDs are between 200-500MB.

    So I'm looking for a good texture format to save out my images in. I've been trying PNG and it works nice. However, when I render out textures from 3ds Max I get them as individual files and Unity likes a lot maps to be in the alpha channel of other maps. Like Diffuse (RBG) and Gloss (A) or Height (A). But when I add a alpha channel in Photoshop to paste in another map Photoshop does not save that channel into a PNG file. Photoshop aparently ony uses layer alpas to determen the alpha of PNGs.

    What about Nvidias DDS format? There are a lot of special formats for that and it is specially developed for game/realtime graphics. But I've been reading on the forums that Unity doesn't changes the meta-data of inported DDS-files and that makes some problem. Or is this an old issue that has been solved?

    How about TGA, is that a good option? I remember it was very popular for game graphics back inte the days before PNG entered the scene, but for some reason it feels like TGA is an outdated format and DDS or PNG is the way to go?

    So what do you all think? What's your favorite formats and workflow for assigning maps into different channels? Please share, thanks! :)
     
  2. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    664
    The format of my choice is TIFF (*.tif). You can export alpha channels easily and it has a looseless compresion (LZW). If needed, you can save layers, too.

    PNG does store alpha, but it is meant to be a transparency channel and not ideal for game textures; it is a web format and should stay as one. TGA is uncompressed and doesn't show a template image in the standart explorer for instance.
    If Unity imports any texture it does convert it into the DDS format in most cases because this is an optimized format for DirectX and realtime applications in general. You can directly import dds files, but it requires some knowlede and the right tools. I only do this in special cases for instance. And it is not NVidia's format, it's Microsoft's ;)

    Btw, how do you get 500MB Photoshop files? I reach that for very complex and collections of textures. Try to minimize filesize if this is common to you. But anyway, I belive any kind of root formats like psd or max, c4d and such should not be include in a Unity folder. It increases the filesize and the import time and when working in a team this is just an overhead. When creating an AssetStore package one should include them of course.

    I hope this helps you.
     
    Last edited: Oct 27, 2012
  3. KristofferH

    KristofferH

    Joined:
    Oct 27, 2012
    Posts:
    52
    But doesn't the ability to save layers make the TIFFs larger in file size?

    I think there is a TGA thumbnail viewer you can install for Windows that shows the thumbnails in Explorer.

    The DDS format seams kind of nice, I like having controll and chosing compression type. Here is a pretty good quide to all the different formats of DDS http://www.poopinmymouth.com/tutorial/dds_types.html
    How well is the DDS holding up for games on iOS or Android? Is it the DDS file that Unity converts all the textures to, or is it their own internal format?

    Does anyone uses JPG for textures? Without support for an alpha-channel and with lossy compression it doesn't sound very usefull for games. The small filesize doesn't really matter since all textures are uncompressed in memory any way. Maybe to reduce download size of the texture would it be usefull, or what do you say?
     
  4. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    664
    You are able to save layers but you musn't, thats the good thing on TIFF.

    Do not use JPEG at all. The DDS format is compressed and compressing a compressed image again is just awful.
    If you want to enhance your (texture) workflow quickly have a look at my consulting offer.

    * I forgott that TGA has a compression method, but compared to TIFF's it is less efficient. It's the reason because of I dropped TGA out of consideration.
     
    Last edited: Oct 28, 2012
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    That would be a bad idea since they are lossy-compressed, and the original file size is completely irrelevant since the original file is not used in a build. I just use PSD for everything; that provides the simplest workflow. The only reason I wouldn't use it is if I'm distributing the Unity project itself, in which case (in order to reduce file size) I'd generally use PNG or TIFF.

    --Eric
     
  6. w00dn

    w00dn

    Joined:
    Apr 28, 2010
    Posts:
    275
    Same here. I use .TIFF mainly because of the smaller file size compared to .PSD. And .TIFF lets us keep all the non-destructive edits ( like adjustment layers, masks and that stuff) and still stays relatively small in size. But our game isn't very texture intensive, so I can't tell you if unity will have a problem with handling large amounts of data.
     
  7. KristofferH

    KristofferH

    Joined:
    Oct 27, 2012
    Posts:
    52
    Interesting that so many uses TIFF, I never really looked at that format as a texture format, I've been using it for print and press mostly. But I'll give it a go. By the way, when saving TIFF with Photoshop there is an option called Pixel Order, with two alternatives; Interleaved (RGBRGB) or Per Channel (RRGGBB). What does this mean, and does it matter for Unity, which one do you use?

    The problem I have with PSD-files was when we were working as a team with a Unity project we had all the Assets on a shared network drive, so while I was working in the Unity Editor, with the levels and scripting, someone was updating a 500MB PSD-file (large texture and lots of layers) and saved it, so all of a sudden my Unity Editor noticed the change in the texture file and started to reimport it, halting my work so I had to wait for it to finnished untill I could contine, that was a bit annoying :p And when I needed to take the project home to work with the final scripting the project folder was huge and took a long time to copy, just because of all the large files. So my point is that I prefer to have more controll over my files and projects :)

    I ask again, in case you missed the question: Does Unity convert to DDS-files internally? When viewing a texture in the Inspector it says "RGBA Compressed DXT5" or "DXTnm", etc. I know that these are the compression formats of DDS but can it also be used by other formats? And does Unity in that case use it's own format? And if it is DDS, does that mean that if I save to DDS myself, Unity then converts my DDS to DDS again, or is it smart enought to skip that step in such a case? And does resaving a DDS mean any loss in quality (like with JPG)?

    Perhaps I should ask these technical in the Answers section, rather then the forums...
     
  8. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    664
    You really mind the pixel order? Just leave it :)

    In case you missed my answere, yes it does.
    No, it directly imports the dds then and it is only neccessary for special cases if you want to alter the MipMaps for example.
     
    Last edited: Oct 30, 2012
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Depends on the platform.

    Not sure what you're asking.

    No.

    --Eric