PDA

View Full Version : 2d?



Nial
03-25-2002, 11:49 AM
Im writing a 2d openGL engine.. I need some tutorials on loading bmps.. loading bmps so that the black pixels are transparent, plotting sprites loaded from bmps

All that kinda stuff!

Jeeeez
03-25-2002, 12:06 PM
Check out http://nehe.gamedev.net

nexusone
03-25-2002, 12:37 PM
One thing is you will want to use another graphic file format, under Opengl the Alpha channel is used to map the transparent area on a bitmap. BMP does not support this, but TGA's do. On the nehe site you will find examples of this in his later lessons.

To map a transparent area by color limits you, best to use a transparency map. This way you can use any colors you want on your sprite and only the colors maped to come through will. One example would be a sprite that cast a shadow down on the ground, you can adjust the transparency to have the shadow only dim the area of the shadow being cast.


Originally posted by Nial:
Im writing a 2d openGL engine.. I need some tutorials on loading bmps.. loading bmps so that the black pixels are transparent, plotting sprites loaded from bmps

All that kinda stuff!



[This message has been edited by nexusone (edited 03-25-2002).]