Short question on Textures

Blitz3D Forums/Blitz3D Beginners Area/Short question on Textures

Sanctus(Posted 2007) [#1]
Ok... It probably isn't hard...
I want to have a mesh, a texture for the map, and a texture for the opacity map(the black and white one).
How do I combine them? To make.. lets say a tree(with a texture that has holes trough it)


b32(Posted 2007) [#2]
EntityTexture has a 4th parameter, that defines on what layer the texture should be applied. I believe the TextureBlend command determines how textures should be mixed.
texture001 = LoadTexture("opacity.bmp", 4) ;or use ,2 for alpha
texture002 = LoadTexture("color.bmp")
EntityTexture mesh, texture001, 0, 0 
EntityTexture mesh, texture002, 0, 1



GfK(Posted 2007) [#3]
Be careful how many textures you use in this way. Your game might die horribly on some graphics cards, or look butt-ugly on others.


jfk EO-11110(Posted 2007) [#4]
Usually for the tree you will use only one texture, that already has got the opacity map built in, in the alpha channel, that's the highest 8 Bit of a 32 Bit TGA for example.

You may also load any 24 Bit RGB texture with the alpha flag (2), this will automaticly create an opacity map during loading, making the dark pixels more transparent and the bright pixels more opaque. Usually this is not what you want, so I'd suggest to use a texture with an alpha channel. You may also use PNG, but you have to use transparency of "unpainted areas", not an additional channel as you would do it for TGA. This is done easily with Photoshop, and as a substitute you may use The Gimp that allows similar actions and is available for free.