Control of texture mask

Blitz3D Forums/Blitz3D Programming/Control of texture mask

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

It should work fine with 16 bit (see the $fcfcfc masking I do), or to be exact 15 bit textures as 1 bit gets allocated as the mask bit.

ReadPixel converts the mask bit in textures so it will always be present in the top bit of the rgba value returned hence the ability of the second pass to check for zero as all solid black pixels will have at least the top bit set in the returned rgba value.

off the top of my head

Function CalcRGBA(r,g,b,a)
return b or (g shl 8) or (r shl 16) or (a shl 24)
End Function

and

Function GetAlpha(rgba)
return rgba shr 24
End Function