View Full Version : render only non-black pixels

05-19-2012, 08:25 AM
how can i render only non-black pixels in a texture (bmp)???
Alpha testing//?

And I know you can mask, but isnt there another less expensive way??

05-19-2012, 10:04 AM
You can give the texture an additional alpha channel, or test the color in your fragment shader and discard those fragments. To give a good advice, you have to tell us what OpenGL version you're targeting, and what you want to do exactly. Are shaders an option? Will the texture get filtered (will there be semi-transparent parts)? Do you have a lot of those textures so sorting (for alpha blending) could become a problem or is it just one texture for a GUI with fixed size? Is there a special reason to use one color as the alpha (e.g. image size, if so, why not compressed textures?) etc. etc.