BRabbit wrote:It is possible to use separate alpha maps for the materials? If so, what is the keyboard used in that case? If not, which is the right way to make textures with alpha colors (like magenta, blue, or black). I looked at the Material System documentation but it didn't work. It is also possible to use transparent PNGs instead of alpha maps?
The alpha channel is normally provided by the diffuse-map, which not only stores the RGB channels, but also alpha (only possible with .png or .tga bitmap formats).
For examples where the diffuse-map also stores alpha, see
http://trac.cafu.de/browser/cafu/trunk/ ... lants.cmat
Note that you see nothing special, it's all in a single line, e.g.
Code: Select all
diffusemap Plants/Ahorn/AhornLeaves.png
For examples for the blue2alpha() function, the "older" technique, see
http://trac.cafu.de/browser/cafu/trunk/ ... s/Kai.cmat
blue2alpha() inserts the alpha values into the specified bitmap as an afterthought.
Note that you can also set an alpha value for the
entire texture; for examples see
http://trac.cafu.de/browser/cafu/trunk/ ... quids.cmat
The second important step how the alpha channel is used / activated:
- You can either use alphaTest, examples for which are in the above mentioned Kai.cmat file.
- Or use blendFunc src_alpha one_minus_src_alpha, this blends the texture according to alpha channel and is probably what you want.
Oh, and also how can I change the red cross cursor in the main menu? (I would like to have the default pointer system cursor)
Well, yes, the pointer is not particularly fancy, its rendering code is in
GuiImplT::Render().
Note however that the GUI cursors do not only work in the main menu, but they are used for 3D world GUIs as well. Thus you cannot simply remove the mouse cursor rendering code in the function above and "un-hide" the true system pointer.
What you
can do though is replace the above code with rendering a rectangle that shows a nice mouse pointer image (ideally with alpha channel
).
(To make it perfect, it's size might e.g. depend on GuiImplT::EntityName=="", so that the pointer is larger for 3D world GUIs.)