Texture Masking!
Blitz3D Forums/Blitz3D Programming/Texture Masking!
| ||
Im trying to get arrows to show in full with a masked image now it works ok with loadtexture("....",2) the arrows show up like i need them but in low res when i create a texture with a mask the arrows dont show up at all! In fact the entire sprite doesn't show up. what am i doing wrong? mainArrowsTexture = CreateTexture(256,4096,2) ;mainArrowsTexture = LoadTexture("graphics/allow.png",4+VIDMEM) texwidth=TextureWidth(mainArrowsTexture) texheight=TextureHeight(mainArrowsTexture) SetBuffer(TextureBuffer(mainArrowsTexture)) DrawImage tmp,0,0 SetBuffer(BackBuffer()) |
| ||
By using drawimage in the texturebuffer you're effectively zeroising the alpha bit of the pixel which then makes the texture invisible. I think Ross C has some code in the archives re masking / alpha textures etc which will be of use here. |
| ||
its still not working!! this is frustrating!!!!!!! |
| ||
OK i figured it.mainArrowsTexture = CreateTexture(256,4096,1+512+256+4) ;mainArrowsTexture = LoadTexture("graphics/allow.png",4+VIDMEM) texwidth=TextureWidth(mainArrowsTexture) texheight=TextureHeight(mainArrowsTexture) SetBuffer(TextureBuffer(mainArrowsTexture)) DrawImage tmp,0,0 SetBuffer(BackBuffer()) i had to use 512 (full colour texture) 256 Store in VID MEM and 4 (mask) 1 (full colours) for anyone who is having the same problem! GForce MX 440 (and home GFX5600) |