Jump to content

Texture formats


Recommended Posts

I think this was once asked on the old filefront forums but i couldn't find anything on google or here.

 

So basically i just want some infomation on the pros and cons on the different texture formats supported by the game (.jpg, .png, .tga).

 

Stuff like, whats best to use on transparent texture (png or tga) and a normal texture (jpg or tga).

I seem to remember something about png being smaller file size on disk but taking longer to load compared to tga and jpg,

but is there other infomation worth mentioning?

Link to comment

The .JPG format is widely used for anything that doesn't use transparency because it's a smaller file size and uncompressed. The differences with .PNG and .TGA is that .PNG is a compressed format which leads to smaller file size but possibly increasing the load times as the game takes more time to read if I remember right. These formats support an alpha channel which is needed to achieve certain effects with certain shader types.

 

@@eezstreet would know more.

 

I think I remember him going over the pros and cons of using PNG versus TGA, I always thought that PNG was nice because it could do all the same things as TGA but had a much smaller file size but in the days of TB hard drives it probably doesn't matter much.

eezstreet likes this
Link to comment

TGA and PNG are the same filesize when inside a PK3; they're both being compressed via zlib in some form or another. The difference is that PNG loads slower than TGA because PNG needs to be decompressed twice - once when pulling it out of the PK3 and once when reading the actual file. The flipside is that PNGs are easier to work with in Photoshop. You should always use TGA over PNG.

Archangel35757 and Delta_135 like this
Link to comment

I thought that's what you said but I think the file size thing depends, on 1024x1024 maps with alpha channels and such PNG does come out to a much smaller file size but it probably is due to compression or possibly a setting I was using.

 

Best to use what loads fastest and since we're not counting Mb anymore with how large HDD's are the size is a non issue.

 

@@eezstreet what about the progressive option question above? I don't ever remember using it or seeing what difference it made. I just used standard jpg for anything that didn't use transparency.

Link to comment

TGA transparency is harder to deal with because it uses the black/white alpha channel method. I avoid TGA and go with PNG whenever possible. Load time won't be that much different on modern machines anyway.

 

And JPG is compressed. Someone said it was uncompressed above, but that's the opposite. JPGs can look like garbage if compressed too much.

Link to comment

Sorry to interlude in the tread but since you are already talking about differences between TGAs and PNGs, I have a problem with TGAs. Whenever I save a TGA, even without doing any changes (just open the file and  save it back without doing anything to it), JKA crashes, so I have to save it as PNG (or JPG). I normally use Photofiltre free edition, but I tired in a friend's computer with different apps he (even photoshop, I think) has and still have the same problem. Any ideas why? 

Link to comment

Sorry to interlude in the tread but since you are already talking about differences between TGAs and PNGs, I have a problem with TGAs. Whenever I save a TGA, even without doing any changes (just open the file and  save it back without doing anything to it), JKA crashes, so I have to save it as PNG (or JPG). I normally use Photofiltre free edition, but I tired in a friend's computer with different apps he (even photoshop, I think) has and still have the same problem. Any ideas why? 

 

What do you use to save the tga's with?

And does jka show an error?

Link to comment

- "I normally use Photofiltre free edition, but I tired in a friend's computer with different apps he (even photoshop, I think)"

- JKA (openJK) just crashes. If it shows a message, it happens too fast to see.

 

:(

 

Hmmm i use gimp myself and that has an option to RLE compress a tga image that i always disable, try do the same thing in photofiltre or play around with some other save settings.

Link to comment

This is hugely off topic but you should probably switch softwares and you might wanna see if the size of the file changes because the software may be doing something when saving. You should open the source file, choose save as and save it under a different name. Open the files and compare their properties, you'll probably find something has changed.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...