Home Technical Talk

Texturing and file formats

polycounter lvl 8
Offline / Send Message
Noodle! polycounter lvl 8
Hey guys, I've recently started learning 3D at University and I have some questions when it comes to file formats that my teacher couldn't really answer for me.

I notice that when I save a file, with no need for transparency, as a TGA it's vastly larger in size than if I save the same file as PNG. If I flip back and forth between these two I notice no difference in quality.

Is PNG advisable at all to use or does 3D Software have problems with it (or other problems?). At the moment we're using Maya 2009.

While I'm at it most of our books seem to use and recommend using TIFF as opposed to what seems to be the more commonly used TGA, my teacher couldn't really give me an answer here either as to which is preferable.

Replies

  • McGreed
    Options
    Offline / Send Message
    McGreed polycounter lvl 15
    It all depends on which game engine you are going to use it for, 3D modelling tools shouldn't have any problems with TGA or PNG. Both PNG and TGA is lossless formats and can save images with Alpha, I usually use TGA myself but PNG is good as well.
  • rebb
    Options
    Offline / Send Message
    rebb polycounter lvl 17
    PNG has built-in lossless compression, while the only compression TGA can have is Run Length Encoding, which usually isn't very efficient - thats why PNG is smaller than TGA.

    But as already mentioned, it depends what you use the images for.
  • McGreed
    Options
    Offline / Send Message
    McGreed polycounter lvl 15
    I actually think there was something about using one of those instead of the other, because of the compression, the one without was better for real time stuff, as it didn't need to get decompressed. Can't remember it fully though, but it was one of the reasons for not using formats like jpgs (apart from the crap quality)
  • Noodle!
    Options
    Offline / Send Message
    Noodle! polycounter lvl 8
    Thanks for the quick answers, people.

    So if I have a scene which will not be used in a game engine but rather as a short movie the difference between PNG and TGA wouldn't be anything other than a difference in size?

    And for in-game usage the usage depends on the engine itself, for what it's optimized for?
  • Bad Spleen
    Options
    Offline / Send Message
    We use .tga files and .png files, however they both get converted to another format (which I can't mention any specific details about) for use in the game engine. I believe this to be the case for most game engines.

    -Adam
  • Mark Dygert
    Options
    Offline / Send Message
    TGA is uncompressed:
    It's like a flattened PSD, you can count on every pixel bieng where you placed it when you open it up. If you're going to be importing and compressing the textures later for use in an engine considering they normally have their own compression method. You probably do not want to compress already compressed textures. which is why TGA is preferable most of the time. You can also count on the alpha channel always being a seperate channel instead of being written in one of three other crazy ways that allow for compression.

    The box may say PNG but the contents could be different:
    There are many ways to write and read PNG's there isn't a set format, especially when it comes to alpha/opacity information. For example you can save a transparent PNG from max a few different ways but photoshop will translate it when it opens it and save it in a slightly different format even if you only open/save.

    Now here's another kicker, older versions of photoshop open and save PNG's and TGA's differently than newer versions which was different than the way other programs would be saving them. Maya, Max, After Effects, Shake, Toxic, Gimp, XnView, ACDSee ect... Can often read a few different kinds of PNG's but they may export them slightly differently also.

    Conclusion
    :
    PNG might be smaller (because its compressed) but you need to be consistent in the way they are created, not all PNG's are created the same way. Which could lead to a few hours of head scratching as to why one PNG imports fine but others don't.

    You want to feed you're engine the highest quality you can with the highest amount of consistency possible.
    Feed it a bunch of random stuff, pieced together from all over the place and its going to puke.
  • Tumerboy
    Options
    Offline / Send Message
    Tumerboy polycounter lvl 17
    As stated above, most engines will take whatever source file you give it, and compress it into it's own file on disk. That means that your source file sizes don't ACTUALLY matter to the end user, so you might as well feed your game the highest quality source you can. If you as an artist are concerned about running out of space because of the file format you use, get a bigger hard drive.
  • motives
    Options
    Offline / Send Message
    motives polycounter lvl 18
    i would argue that the most common end format is .DDs

    http://developer.nvidia.com/object/photoshop_dds_plugins.html <-- dds plugin for PS

    its pretty cool since you can take control over your mip maps, editing, sharpening them etc
  • EarthQuake
    Options
    Offline / Send Message
    For a game engine, PNG would only be smaller on disk than TGA, they would both be loaded as either raw image data(and be the same amount of memory) or as a compressed format like .DDS that your video card supports.

    So if you wanna save some HD space, use PNG! Otherwise its not relevant.
  • Noodle!
    Options
    Offline / Send Message
    Noodle! polycounter lvl 8
    Priceless information. I guess I'll stick with TGA for now as I don't want to run in to any weird problems down the line and HD space is not an issue (ram is though).

    I've never heard of .DDs before to be honest, I'll see if it comes up when we get past basic projects and into actual game related things.

    Thanks again guys.
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 18
    Regarding Maya and TIF I usually avoid it since MentalRay has some TIF-issues at times. Never really bothered to find out what the problem is since there are other formats which do the job. Like TGA.
Sign In or Register to comment.