PDA

View Full Version : I need to make a specific pixel colour transparent



dusty
03-17-2011, 01:52 PM
Hello, I am new here.
I am currently working on a simple 2-d fighting game engine, and I essentially need to make only a single colour transparent, this colour is predefined (neon green).
Due to the way that the engine works, and seening as it does not need to make very complicated polygons (2-D and currently all rects) I would like to avoid making it more complicated by using anysort of depth buffering or alpha blending, as the game only has perfectly transparent and perfectly opaque pixels and does not care in which order the polygons are drawn on top of each other.
Thank you for your time.
~Dusty

ZbuffeR
03-18-2011, 05:02 AM
When loading images from file, create alpha channel with transparent values if color = magic color, and opaque otherwise.
Then enable alpha testing, will be perfect with GL_MIN texture filter set to GL_NEAREST.