I am very new to opengl and I am trying to draw a peacock. I have an raw image of a feather that has white as the background and am trying to convert the white pixels to transparent pixels but am not sure how.
struct RGBA
{ // The data on one RGB pixel
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char alpha;
};
RGBA image1[texHeight][texWidth]; // The image
if ( in )
{
for ( int r = texHeight-1; r >= 0; r-- )
{
for ( int c = 0; c < texWidth; c++ )
{
if (
in.read( reinterpret_cast<char*>(&image[r][c]), sizeof(RGB)) );
}
how would you assign this image an alpha value while reading it in?
also, I have drawn a nurbs surface and was wondering how to texture map it?