PDA

View Full Version : Portable Texture Loading



Swiftless
04-01-2005, 05:56 AM
I have been looking around for some way to load textures that don't rely on windows, or is not set to a certain operating system. I don't suppose anyone has a way? I don't really care about the file type, although jpeg would be preferred.

Thankyou

ZbuffeR
04-01-2005, 06:33 AM
simple TGA loader :
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=33

jpeg is quite complex so will need a cross-platform lib such as libjpeg (google for it).

Obli
04-04-2005, 11:30 PM
I am against targa. It has some non-trivial things in it (like 1bit alpha). I raccomand using pnglib instead. PNGs have better compression than TGAs, although not as good as JPG. They are however, much easier to use and looks like there are no sort of patents around.
I'm sorry I cannot give you any link for pnglib.
PNG is lossless and supports 16bit color. I'm not sure if JPG can do this second thing.

04-06-2005, 03:54 AM
I am all for .tga when it comes to textures.
As long as you stick with 24 or 32 BPP its extremly simple to deal with and once you put them into an compressed file container you get the same compression levels as with single .png files.

IMHO jpeg is the worst file format one can use when it comes to textures, you want to know why?

http://sjbaker.org/steve/omniv/jpegs_are_evil_too.html

Omaha
04-06-2005, 05:53 PM
Hey, in JPEGs defense it was designed for photographs. Yelling at it for not being able to compress textures as well as it does photos is like yelling at Hummer when their car breaks down in an offroad situation, it's just doing something it wasn't designed to do. (ZING)

04-06-2005, 10:48 PM
You are barking up the wrong tree.

Nobody said that Jpeg are bad in general, just that jpegs are bad for textures.