I am trying to draw a textured rectangle, using two triangles. I want the black pixels in my texture to be transparent and everything else to be visible.
I have used some code I found on this forum, but the resultant texture still shows black
as solid.
basically I read the raw rgb data, look for
rgb triplets with value 0,0,0 and copy
the same rgb values into an rgba data block
replacing the alpha component with 0 for black and 1 for anything else.
I then call gluRGBuild2dmipmaps specifying rgba valued data.
If you really want only the black part to be blended just use
glBlendFunc(GL_SRC_COLOR,GL_ONE);
and everything that tents to black will be blended.
That’s not the best way of doing blending, but it works and you gain memory space trashing the alpha values.