View Full Version : Textures - BMP or TGA?

01-22-2002, 05:26 PM
Whats is the best format to use in big textured areas? landscapes etc

01-22-2002, 05:45 PM
It really does not matter unless you intend to use alpha blending. TGA supports an alpha channel -- BMP does not. In either case you will need to write your own S/W that extracts data from the file and arranges the pixel information in a manner that OpenGL understands. OpenGL does not import any common image format that I am aware of.

You can obtain file format descriptions of TGA and BMP files from www.wotsit.org. (http://www.wotsit.org.) The pixel format for opengl texture images is defined in the Red Book and, if you are using VC++ or BCB, the online help (look for glTexImage2D).

There are several 3rd party libraries that you can obtain on the Internet that will read data from image files and convert them to OpenGL textures. Many can be found at www.sourceforge.net (http://www.sourceforge.net) . If you are developing apps on Win32 and using VC++ or BCB, then you can try my BMGLib library that can be downloaded from my web site.

Scott http://members.home.net/scottheiman/

01-22-2002, 09:16 PM
In my opinion the best graphic format to use in landscapes mode is TGA...
Because you can add the Alpha Chanell for example....

01-23-2002, 07:31 AM
... and TGA also supports may different formats (8/16/24/32 bits per pixel). Where BMP only supports 24 bits/pixel.

01-23-2002, 11:25 PM
BMP support all the formats TGA does, excluding the alpha channel. BMP can store images in four channel 32 bit mode, where the fourth channel is not used though.

01-24-2002, 04:29 AM
Bob:are you sure?

Is it just depending on the client you use (e.g. photoshop ) how you can save the file. And of course your loader. I havent been succesful in saving other than 24 bit BMP's in PS at least. Maybe its just me.

01-24-2002, 04:37 AM
Pain shop pro (dunno version, at least 6 i believe) can export 24 bit RGB, both raw and compressed, 8, 4 and 2 bit indexed (not yet tried 1 but, but should work), raw and compressed, 8 bit greyscale, raw and compressed. My bitmap loader can load 32 and 24 bit compressed and raw, 8 bit greyscale and index, raw only. And that works fine. The other formats have not yet been implemented, but after some debugging, the header and data seems to be OK.

01-24-2002, 05:23 AM
It's a lot like C vs. C++.

Neither is better, but one offers some more fun.


01-24-2002, 06:38 AM
PNG is a good format I use. There's free libpng available. It's very easy to use.