PDA

View Full Version : TGA file format



Ruggero Visitnin
09-04-2014, 08:37 AM
hi all,
i'm going to write my own TGA file loader.
i made some google search but i could not find good specifications about the TGA 2.0 file format, i know that my question isn't strictly opengl related but i would not join another forum only for a such small question.

thanks advance.

Agent D
09-04-2014, 01:49 PM
What about that one? (http://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf)

Google query "TGA 2.0" got me there. Third result from the top.

Ruggero Visitnin
09-05-2014, 03:03 AM
What about that one? (http://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf)

Google query "TGA 2.0" got me there. Third result from the top.

yeah, i saw, but seems complicated to me, i had no problem understanding old TGA file format but this new is giving me more annoy
another thing i need to solve before start coding my own TGA file importer:
i'm using SOIL to load images but when i apply a texture to an OBJ that came with it's own texture coords this is what happen
1422

can you help me with this?
thank you

Agent D
09-05-2014, 04:11 AM
I just skimmed over the TGA 2.0 specification and as far as I can tell, there is not that much of a difference between the original and the TGA 2.0 format.
The only difference is an additional footer with extensions headers at the end, which makes it fully backwards compatible to the original format.
The entries are specified one by one, pretty straightforward to read.

There's not much usefull data there (apart for gamma and color correction), so if you don't need that, I don't really see a reason for supporting that
particular format in the first place.

Concerning your sphere, I assume the texture coordinates are messed up. If you suspect the image loader to do something wrong, try dumping the
image data to a very simple format (e.g. netpbm) and take a look at it.

Ruggero Visitnin
09-05-2014, 04:51 AM
i tried to import a plane that came with texture coordinates and it works well, i double checked my obj loader but it dosen't seem wrong to me