new material with Diffuse BSDF shader

In "Shading" tab, add new image, give it a name and resolution something like 512x1024. Make sure you click
on it so it is with a white frame, otherwise blender won't bake.

Now change the render settings like you see here

Now click on Bake and wait untils it's done.
After it is done, save the file as tga

Now open the image in a graphic program (I use gimp)

First of all let's invert the colors

after that, go to Colors > Curves and change it like in the picture

save it as a new texture file and give it a new name. something like ui_shadow_4x2_alpha.tga. after that create. A new image with full black resolution 512x1024 and save it as ui_shadow_4x2.tga. Now I use the programdxtbmp to edit the alpha channel. Now I open the ui_shadow_4x2.tga file and replace the alpha image by clicking on the open folder icon and select the file ui_shadow_4x2_alpha.tga.
Now save it as ui_shadow_4x2.tga and you're done.
