Omicron Posted September 5, 2014 Share Posted September 5, 2014 What's the advantages/disadvantages of using png/tga for textures with have alpha? I personally use png, but I see that a lot of people round here use tga, so I was wondering if they have some advantage over png's Link to comment
Xycaleth Posted September 5, 2014 Share Posted September 5, 2014 Potentially, TGA loads faster: PNG is a compressed image format, so when it gets extracted from the PK3, a second decompression has to take place to get at the image data. TGA contains the raw image data so it just has to be extracted from the PK3 and it's useable. Whether this is true in practice, I don't know. Omicron likes this Link to comment
minilogoguy18 Posted September 5, 2014 Share Posted September 5, 2014 The polycount thread that comes up in the google search should be a good read on the subject but basically both formats are great as far as detail and alpha channel support but since PNG is a compressed version of TGA loading times increase when using PNG in exchange for a file size that is close to a JPEG but with better quality than a JPEG. TGA is going to be the best format to use in the game, although the file size is larger that only really affects the person downloading the mod or pk3, game loading is unaffected where as if you were loading a map that used nothing but PNG textures loading times would increase because of it being a compressed format. In 3d software it's more noticeable between the load times of PNG and TGA when rendering. Omicron likes this Link to comment
eezstreet Posted September 5, 2014 Share Posted September 5, 2014 TGA is bigger when outside the PK3, but is the same size as a PNG when inside the PK3. Omicron and minilogoguy18 like this Link to comment
minilogoguy18 Posted September 6, 2014 Share Posted September 6, 2014 Ah, I never noticed this. z3filus likes this Link to comment
z3filus Posted September 6, 2014 Share Posted September 6, 2014 interesting.... TGA it is then Link to comment
Omicron Posted September 6, 2014 Author Share Posted September 6, 2014 Alright, thanks! Link to comment
MaceMadunusus Posted September 7, 2014 Share Posted September 7, 2014 Potentially, TGA loads faster: PNG is a compressed image format, so when it gets extracted from the PK3, a second decompression has to take place to get at the image data. TGA contains the raw image data so it just has to be extracted from the PK3 and it's useable. Whether this is true in practice, I don't know. It is absolutely true, and it was proved in the V1 release of MB2. I spent tons of time converting hundreds of .PNG image files to .TGA. The load time for CommTower was reduced by 20-25 seconds out of ~43 overall second load time (I cant seem to find the exact values) on my computer due to that reduction. That is also just a level, and not every asset is loaded immediately when you load into a level either. Just about everyone I talked to (provided they had the same settings) also experienced much quicker load times. Eez is also correct in the fact that when compression happens, TGA does in fact roughly mimic the PNG in size (Sometimes the same, sometimes slightly higher, sometimes slightly lower but it usually ends up being very close in the end). Link to comment
Raz0r Posted September 7, 2014 Share Posted September 7, 2014 You could also extract all your assets to increase load speed =] Link to comment
eezstreet Posted September 7, 2014 Share Posted September 7, 2014 I spent tons of time converting hundreds of .PNG image files to .TGA.gogo Bash/Batch script Link to comment
MaceMadunusus Posted September 7, 2014 Share Posted September 7, 2014 gogo Bash/Batch script Mostly what I did. It wasn't just about converting them straight through though. Everything had to be tested. On the initial run through for example, the RGB model's PNGs didn't convert properly using a simple batch conversion and required a bit of a different process that took slightly longer; then going through the RGB models to make sure everything converted properly without aliasing around the edges. I also had to do the conversion a couple times for some assets because map minimaps were updated in beta, or style changed, or went through a design change. An example of that being originally I just had to convert the mini-maps, but then I went through and removed the BaseJKA backgrounds in the obj screen which required those being converted at a different time. therfiles likes this Link to comment
minilogoguy18 Posted September 7, 2014 Share Posted September 7, 2014 You could also extract all your assets to increase load speed =] For as long as I've been modding this game I've never tried it, I'd imagine I'd just need to extract everything to a folder structure within the games base folder but how would the game know to load all that? Link to comment
Raz0r Posted September 7, 2014 Share Posted September 7, 2014 JA has always loaded files from outside of PK3s unless you're running with sv_pure 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now