Texture Loading

27340afba8e6bbd010c1e520a843e50f
0
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.

6ad5f8c742f1e8ec61000e2b0900fc76
0
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:(

27340afba8e6bbd010c1e520a843e50f
0
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

C7787dfbc6b0c78ef4a2a8e7cfe1366c
0
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