Page 2 of 2

Posted: Mon Mar 08, 2004 6:02 pm
by soconne
Well what about having transparency on a 3d triangle? I'm having a problem trying to load a texturemap and have an alpha component at the same time. I tried what was stated above, loading a 32-bit tga file from photoshop, but the alpha channel wasn't loaded. I'm trying to blend a 3d triangle based on the alpha value in the texture map, but can't seem to get the alpha component to work. Is there a built in function in Irrlicht that lets you 'add' the alpha channel to an existing texture image once its been loaded??

Posted: Tue Mar 09, 2004 4:28 am
by rt
soconne wrote:Well what about having transparency on a 3d triangle? I'm having a problem trying to load a texturemap and have an alpha component at the same time. I tried what was stated above, loading a 32-bit tga file from photoshop, but the alpha channel wasn't loaded. I'm trying to blend a 3d triangle based on the alpha value in the texture map, but can't seem to get the alpha component to work. Is there a built in function in Irrlicht that lets you 'add' the alpha channel to an existing texture image once its been loaded??
once the texture is loaded you can get a pointer to the image data via

Code: Select all

DWORD* pPixel = (DWORD*)image->lock();   // Get the pointer to the surface 
the pixel is 32bits, 0xAARRGGBB so you can strip off the alpha like so

Code: Select all

BYTE alpha = ((*pPixel) >> 24);
check out the texture manipulation code in the avi reader thread http://irrlicht.sourceforge.net/phpBB2/ ... .php?t=927, but make sure you have enabled alpha correctly by applying the fixed found in this thread http://irrlicht.sourceforge.net/phpBB2/ ... .php?t=517

Posted: Tue Mar 09, 2004 12:15 pm
by Dark_Exodus
Thanks for the help guys, i finally got that working. :D