Texture Loading

moomin 101 Jul 01, 2003 at 08:10

In teh vastness that is the internet there are several libraries out there for loading textures (i.e. DevIL), although custom loaders can be made. For instance BMP loading is fairly trivial (and SDL has this facility built in, along with a SDL texture library). The question is, is PNG the optimum format for textures, considering its lossless compression coupled with a alpha channel, secondly how hard is it to load PNG files as textures.

3 Replies

Please log in or register to post a reply.

davepermen 101 Jul 01, 2003 at 11:26

png has a lot of internal formats, lossy and lossless ones..

the “perfect” format is dds, direct draw surface. why? because it is optinonally lossless or lossy, with mipmaps or not, and can get directly load into system, as it uses the same compression algo as gpu’s have to decode.

i for myself just use bmp or so.. dunno..

the “best” thing i’ve seen is from maven.de (hope link is right), wavelet compression much like in jpg2000…

but for textures? dunno.. i haven’t mastered his sourcecode yet to load my own files:(

moomin 101 Jul 01, 2003 at 12:39

Hmmmmm, I suppose this isn’t really an opengl issue, and is really a personal decision. BMP’s are fine(ish) just their lack of alpha (although you can “fix” this, and the comperatively large filesize). For testing/learning BMPs are fine

keless 101 Jul 05, 2003 at 06:13

First of all, you should concider what resource types some of your models will require. If you’re supporting .3ds or Md3 you’re almost bound to .BMP or .TGA