Table of Contents
If you are interested in generating alpha maps for texture splatting, you may find it beneficial to read the discussion on the algorithms page, which amongst other things explains what the alpha maps are, why you might want to combine alpha layers, and also some of the alpha map file output options available in L3DT.
To generate alpha maps, select the 'Operations→Alpha maps→Generate alpha maps' menu option. This will open the Combine alpha layers wizard, shown below:
On the left of this wizard you can see the list the textures that L3DT would use to generate the 'conventional' texture map. These textures are those that are associated with each land type in the attributes map, and are specified in the appropriate land type definitions. You can view the alpha map coverage for each texture in the panel to the left (as shown above), or the texture image itself (shown below).
To combine textures into the same alpha layer, click on the 'Alpha ID' entry to open the 'in-place' drop-down list (shown below). If you want two textures in the same alpha layer, give them the same AlphaID value.
As an example of this I have combined all grass textures into the same alpha layer (shown below). The coverage of this alpha layer is displayed in red in this case.
Note that the coverage of the currently selected texture is shown brighter than the coverage of the other textures in the same alpha layer. Thus, below, the coverage of the 'grass1d' texture is highlighted, whereas in the above image the coverage of 'grass1a' is highlighted.
Once you are happy with the set of alpha layers, click on the Next » button to go to the alpha map options wizard.
The alpha map file output wizard (below) is where you set the output filename and image file format used to save the alpha maps.
The controls are as follows:
When you click 'OK' in this wizard, L3DT will go away and generate the alpha images. If you have enabled the export alpha maps now option, L3DT will also save the alpha map images and an XML file that describes the contents of the alpha image(s).
In the unregistered L3DT 'Standard Edition', you are restricted to 8-bit bitmap alpha maps only, and mosaics are disabled. To access RGB or RGBA images, or mosaic alpha maps, you will need the Professional Edition.
A typical alpha map output is shown below. These two mosaic images were taken from the example shown above, in which 10 textures were combined into 6 alpha layers, and saved as two RGB bitmap mosaic images.
If you would like to load a mosaic image such as those above, you may find the information on the mosaic algorithms page useful.
If you save the alpha images as 4-layer PNG images (i.e. 32-bit RGBA), you may be surprised to find that the images appear to be black and white:
Fear not, the RGB channels are not wonky! If you load the same image in MS Paint you will see that the RGB channels are OK:
In the alpha maps, pixels will be either pure red, pure green, pure blue or pure alpha. Hence every pixel with a non-black RGB colour has an alpha of zero. In computer graphics, the alpha channel is defined such that an alpha of zero means full transparency, which most image viewing programs will render either as transparent or as a white background. Conversely, any pixel with a non-zero alpha has an RGB colour of black, and so is rendered black. Thus the 4-layer PNG images will appear, in most programs, to be either black-and-transparent or black-and-white. MS Paint is an exception, as it discards the alpha layer and renders just the RGB colour.
So, in summary, the images are just fine, but you can't view them in most image viewing programs.
Along with the alpha images (shown above), L3DT saves a text file in the extensible markup language (XML) that describes the contents of the alpha maps. A typical file is shown below:
<?xml version="1.0" encoding="utf-8"?> <AlphaData> <nImages>2</nImages> <nLayers>6</nLayers> <LayersPerImage>3</LayersPerImage> <ImageFileExt>jpg</ImageFileExt> <MosaicImages>true</MosaicImages> <MosaicTileSize>512</MosaicTileSize> <ImageList> <Image> <FileName>"Splat_Alpha1\Alpha1.mmf"</FileName> <LayerList> <Layer> <LayerColour>red</LayerColour> <TexList> <TextureFile>"grass\grass1h.jpg"</TextureFile> <TextureFile>"grass\grass1d.jpg"</TextureFile> <TextureFile>"grass\grass1c.jpg"</TextureFile> <TextureFile>"grass\grass1a.jpg"</TextureFile> </TexList> </Layer> <Layer> <LayerColour>green</LayerColour> <TexList> <TextureFile>"rock\rock1.jpg"</TextureFile> <TextureFile>"rock\rock1b.jpg"</TextureFile> </TexList> </Layer> <Layer> <LayerColour>blue</LayerColour> <TexList> <TextureFile>"ground\dirt1.jpg"</TextureFile> </TexList> </Layer> </LayerList> </Image> <Image> <FileName>"Splat_Alpha2\Alpha2.mmf"</FileName> <LayerList> <Layer> <LayerColour>red</LayerColour> <TexList> <TextureFile>"snow\snow.jpg"</TextureFile> </TexList> </Layer> <Layer> <LayerColour>green</LayerColour> <TexList> <TextureFile>"ground\rocks1d.jpg"</TextureFile> </TexList> </Layer> <Layer> <LayerColour>blue</LayerColour> <TexList> <TextureFile>"sand\yellowsand1.jpg"</TextureFile> </TexList> </Layer> </LayerList> </Image> </ImageList> </AlphaData>
XML is human-readable, so I hope that users will not have difficulty in understanding names and meanings of entities contained in this file. If you would like me to write a proper discussion of the file contents, please e-mail me at email@example.com. Similarly, if you think there should be some additional data added to this file, you know where to contact me.
L3DT includes a second method to generate alpha maps, which is available in the menu at 'Operations→Alpha maps→Alpha export express'. Rather than combining the alpha layers manually, as done above, this option uses a set of pre-defined (and user-editable) rules to calculate the alpha maps from the attributes map.
For more information on using Alpha export express, please consult the user-guide for the atFilterAM plugin, which implements this feature.
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported