I'm attempting to get the alpha value of a texture with glReadPixel(). The problem I have is once the alpha value pixel is below 0.5f, it starts to combine the alpha value of the background object. I can never get an alpha value of 0.0f thru 0.49999f. Is there a way to ignore the alpha value of any background objects and get JUST the 1 pixel alpha value of the top texture or object?
std::vector< float > pixels( 1 * 1 * 4 );
glReadPixels(mouse.x,mouse.y,1,1,GL_RGBA,GL_FLOAT,&pixels[0]);
printf("alpha value = %f", pixels[3]);