====== Mosaic master file ======
The L3DT //mosaic master file// (*.mmf) is an ASCII file that describes the size and number of map files within a [[l3dt:algorithms:mosaics|mosaic map]].
A typical MMF might look like this:
L3DT Mosaic master file
#MosaicName: Alpha1
#MosaicType: RGB
#FileExt: bmp
#nPxlsX: 4096
#nPxlsY: 2048
#nMapsX: 8
#nMapsY: 4
#SubMapSize: 512
#HorizScale: 1.00
#TileState: 0 OK
#TileState: 1 OK
#TileState: 2 OK
#TileState: 3 OK
#TileState: 4 OK
#TileState: 5 OK
#TileState: 6 OK
#TileState: 7 OK
#TileState: 8 OK
#TileState: 9 OK
#TileState: 10 OK
#TileState: 11 OK
#TileState: 12 OK
#TileState: 13 OK
#TileState: 14 OK
#TileState: 15 OK
#TileState: 16 OK
#TileState: 17 OK
#TileState: 18 OK
#TileState: 19 OK
#TileState: 20 OK
#TileState: 21 OK
#TileState: 22 OK
#TileState: 23 OK
#TileState: 24 OK
#TileState: 25 OK
#TileState: 26 OK
#TileState: 27 OK
#TileState: 28 OK
#TileState: 29 OK
#TileState: 30 OK
#TileState: 31 OK
#EOF
===== #MosaicName =====
For L3DT to load a mosaic map, it must know where to put it. Thus the MMF includes a member called //MosaicName//, which is a string that identifies the map into which the mosaic will be loaded. Below are listed the //MosaicNames// recognised by the L3DT mosaic-loader:
^ Name ^ What is it? ^
| "DM" | The design map |
| "HF" | The heightfield |
| "WM" | The water map |
| "WS" | The salinity map |
| "AM" | The attributes map |
| "TN" | The terrain normals map |
| "LM" | The light map |
| "SH" | The shadow map |
| "TX" | The texture map |
| "Alpha_1/2/etc" | The alpha maps |
If the map is not intended to be used by L3DT's calculations, then the //MosaicName// can be anything you like.
===== #MosaicType =====
The //MosaicType// member specifies how the data should be interpreted when loading. Valid types are listed below:
^ Type ^ What is it? ^
| "HF" | A heightfield|
| "WM" | A water map|
| "AM" | An attributes map|
| "TN" | A terrain normals map|
| "BYTE" | An 8-bit map|
| "WORD" | A 16-bit map|
| "RGB" | A 24-bit image map |
| "RGBA" | A 32-bit alpha-masked image map |
| "DWORD" | A generic 32-bit map |
| "LM" | A light map (legacy; now use "RGB") |
| "TX" | A texture map (legacy; now use "RGB") |
| "24bit" | A texture map (legacy; now use "RGB") |
Please not that while the //MosaicType// string is often the same value as the //MosaicName// string, this is not the case in general. For example, the heightfield has a name of "HF" and a type of "HF", while the salinity map has a name of "WS" and a type of "HF" (the salinity map is actually stored as a heightfield within L3DT).
===== #FileExt =====
The following mosaic tile file extensions are supported:
^ FileExt ^ What is it? ^
| hff | An L3DT [[l3dt:formats:specs:hff|heightfield file]] |
| hf2 / hfz / hf2.gz | An L3DT [[l3dt:formats:specs:hf2|compressed heightfield file]] |
| ter | A Terragen terrain file |
| wmf | An L3DT [[l3dt:formats:specs:wmf|water map file]] |
| amf / amf.gz | An L3DT [[l3dt:formats:specs:amf|attributes map file]] |
| bmp | A bitmap image |
| jpg | A JPEG image |
| png | A PNG image |
| tga | A TGA image |
| dds | A DDS image |
| raw | A [[l3dt:formats:specs:raw|raw binary file]] |
| x | A DirectX mesh file (export only). |
| obj | A Wavefront OBJ mesh file (export only). |
Many more formats are supported by [[bundywiki>plugins]].
===== #nPxlsX and #nPxlsY =====
The width of the map is given by //nPxlsX//, and the height by //nPxlsY//. Both are measured in pixels.
===== #nMapsX and #nMapsY =====
//nMapsX// and //nMapsY// state the number of mosaic tiles in the //x// and //y// axes, respectively. In the above example, the mosaic is an 8×4 grid of tiles, for a total of 32 tiles.
===== #SubMapSize =====
The //SubMapSize// value describes the side-length of the tiles in the mosaic, and is measured in pixels. A mosaic tile is always square.
===== #HorizScale =====
The //HorizScale// member specifies the 'real-world' pixel-spacing of the map, and is measured in metres/pixel.
===== #TileState =====
It is possible that some tiles in a mosaic will be missing. For example, the water map will not save tiles in which no water has been flooded. A list of //TileStates// are included in the MFF to specify whether tiles are present or absent. The syntax is:
#TileState:[TileIndex][TileState]
Where //TileIndex// is the linear index of a tile, given by y × nMapsX + x, and //TileState// is a string that is either "OK" (the tile is present) or "FREE" (the tile is absent). Pixels in absent tiles are assumed to have a value of 0.
The ordering of tiles in a mosaic map is explained on the [[l3dt:algorithms:mosaics#File names and tile ordering|mosaic algorithms]] page.