Set Mask Color for Loaded 3D Model Textures

Blitz3D Forums/Blitz3D Beginners Area/Set Mask Color for Loaded 3D Model Textures

RustyKristi(Posted 2016) [#1]
So do I just use MaskImage command and this applies to 3D textures? I understand the default is black


Bobysait(Posted 2016) [#2]
MaskImage is only for 2D Images created with LoadImage/CreateImage.

For textures, you need to enable the mask flag (4) on LoadTexture/CreateTexture
For a LoadTexture it will apply the mask only for Alpha pngs (it will split alpha : =>0.5 : Solid, <0.5 : not visible) or without alpha it will use the black (0,0,0) as mask.

Then, you can set the alpha of the pixel by hands using WritePixel/WritePixelFast on the TextureBuffer.
You can also create your own function to maniputale the pixels and apply your own color mask




RustyKristi(Posted 2016) [#3]
Ok so this should be done per image, I thought there was a setting somewhere in b3d file. Anyway, this should get me started. thanks BobySait.