PDA

View Full Version : texture mapping



edwong
11-29-2003, 11:16 AM
hi,

i have a texture (which is a cat) with transparent background. but since .bmp ignores the transparency, when i texture map it to the model, the background color becomes white.

but i just want the cat itself to be textured without any background color

any idea will help

thx

edmund

maximian
11-29-2003, 12:14 PM
I am not sure you can do what your asking for.

If you simply wish to deal with the background white, you can load the bitmap, and then loop through all the pixels, and replace the transparent color with another color. There is no support in opengl for texture maps that are regions, ie no regular rectangular shape. The best thing you could do, is break down the cat map into smaller maps, and apply those on the model.

Deiussum
11-30-2003, 07:36 AM
Use 32-bit TGAs instead of BMPs, and for the transparent areas set the alpha channel to 0. Then use alpha testing, or alpha blending in your OpenGL app.