Alpha map usage

Blitz3D Forums/Blitz3D Programming/Alpha map usage

Moraldi(Posted 2006) [#1]
Hi all,
I am a Blitz3D user and i want to use textures with alpha map mask. How can i create an alpha map?. Do i have to draw my texture and then the alpha map? how can i design the areas of the texture where i want to be fully transparent or semitransparent and so on...

Thanks in advance...


GfK(Posted 2006) [#2]
Assuming you have Photoshop or Paintshop:

1. Create a new image.
2. Create a new layer.
3. Draw stuff onto said layer.
4. Turn off the background layer.
5. Export to PNG format.


jhocking(Posted 2006) [#3]
That is the simple approach. Life is slightly more complicated if you want to get fancy (manipulating color channels and layer masks,) and for pro work you'd need to know about that stuff, but for now just do things the easy way.


Moraldi(Posted 2006) [#4]
GfK and jhocking thanks for your gidelines.
(anyway start is the half of all...)


jfk EO-11110(Posted 2006) [#5]
In Photoshop and I guess also in The Gimp you have 3 Color channels by default (assuming you're working with the 24 Bit RGB model). Now simply add a channel (not layer). It will be named Alpha per default. You are now able to paint etc. to the alpha channel. White is opaque and black is transparent, like in Blitz. You may also Copy Paste to the Alpha Channel. EG: let's say you have some grass and you want to mask it with smooth contours. First use the selection tool to select the grass on the RGB channel, then switch to the alpha channel and use the Fill function with the color white. Then modify the selction to select a border, then blur the border.

You may export it as TGA (32 Bit), or as PNG, tho depending on the version of Photoshop you may have to motivate photoshop somehow to make sure it's not saving only the RGB channels.

The Gimp is open source and for free, where Photoshop may be costy.


Moraldi(Posted 2006) [#6]
jfk EO-11110, this was EXACTLY i wanted to know. BUT (there is always a BUT...) to be more specific: a gray color will it be semitransparent in Blitz? (i am using GIMP)


jhocking(Posted 2006) [#7]
Yes, greys are semi-transparent.

You may export it as TGA (32 Bit), or as PNG, tho depending on the version of Photoshop you may have to motivate photoshop somehow to make sure it's not saving only the RGB channels.

This is why I referred to layer masks. To save a PNG with alpha transparency from Photoshop you need to turn the alpha channel into a layer mask. While slightly more complicated, this approach has a number of advantages over simply erasing the background parts, including that you can paint the transparency with brushes like normal, paste the transparency from one image to another, and "bleed" the edges so that you don't get an ugly white fringe.


jfk EO-11110(Posted 2006) [#8]
Thanks for that Info. I always used TGA, knowing that the zip compression of the release would do about the same as PNG (well loading in Blitz is slower when uncompressed). But now I see there are several reasons for the way you described.