Textures - BMP or TGA?

Whats is the best format to use in big textured areas? landscapes etc

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. 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 . 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/

In my opinion the best graphic format to use in landscapes mode is TGA…
Because you can add the Alpha Chanell for example…

… and TGA also supports may different formats (8/16/24/32 bits per pixel). Where BMP only supports 24 bits/pixel.

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.

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.

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.

It’s a lot like C vs. C++.

Neither is better, but one offers some more fun.


PNG is a good format I use. There’s free libpng available. It’s very easy to use.