Oblivion Mod:Mod File Format/LAND
LAND records contain the landscape height, normal, colour and texture details. For large worldspaces, this data is nearly always compressed with ZLIB. In 'Oblivion.esm', child worldspaces are often not compressed.
The VNML, VHGT and VCLR formats are identical to TES3, except that TES4 land records contain 33x33 height, normal and vertex colour data points. TES3 contained 65x65 data points: Each TES4 LAND record contains 1/4 of the data of a TES3 LAND record.
The following subrecords may be contained in the LAND record:
-
- DATA (Required): Specifies which subrecords exist in this LAND record (4 bytes + 6 byte header).
- VNML (Optional): Vertex Normal Data (3267 bytes + 6 byte header).
- VHGT (Optional): Vertex Height Gradient Data (1096 bytes + 6 byte header).
- VCLR (Optional): Vertex Colour data (3267 bytes + 6 byte header).
- BTXT (Optional): Base Texture (applies a single texture to a cell's sub-quadrant). (8 bytes + 6 byte header).
- ATXT (Optional): Added Texture lead-in: Specifies the texture FormID, sub-quadrant that the subsequent VTXT records apply to and the layer. (8 bytes + 6 byte header).
- VTXT (Optional): Vertex Texture points: A sequence of up to 289 textures per cell sub-quadrant (1156 textures per cell). Each point includes the opacity of the texture. (Variable length, but always multiples of 8 bytes + 6 byte header).
- VTEX (Optional): Texture FormIDs: A sequence of LTEX FormIDs. Many may be NULL values. (Variable length, but always multiples of 4 bytes).
Contents
- 1 DATA subrecord (4 bytes)
- 2 VNML subrecord (3267 bytes)
- 3 VHGT subrecord (1096 bytes)
- 4 VCLR subrecord (3267 bytes)
- 5 BTXT subrecord (8 bytes)
- 6 ATXT subrecord (8 bytes)
- 7 VTXT Subrecord (Variable length, but always groups of 8 bytes)
- 8 VTEX Subrecord (Variable length, but always groups of 4 bytes)
DATA subrecord (4 bytes)[edit]
Contains summary information about this LAND record (such as which types of subrecords might be present).
Subrecord | Type | Info |
---|---|---|
DATA | 4 bytes | First byte is a bit-mask stating which subrecords might be present (such as VCLR, or texture records). Other bytes unknown. |
VNML subrecord (3267 bytes)[edit]
Contains the Vertex Normals for this cell's height map. 33x33 data points. 3 bytes per grid-point specify the X, Y and Z normals.
Subrecord | Type | Info |
---|---|---|
VNML | struct | 3267 bytes: 33x33 grid of Vertex normals (3 bytes per grid-point for the X, Y, Z normals). |
VHGT subrecord (1096 bytes)[edit]
The "Height map" Vertex Gradient Data. Contains the starting height of the southwest corner of this cell and the relative offsets of each subsequent data point.
Name | Type | Info |
---|---|---|
Offset | 32-bit float | The height offset for this entire cell; specifies the height of the most southwestern point. Each value of 1 equates to a height of 8 game units. |
Gradient data | 1089 bytes | 33x33 grid of height data (1089 bytes). Each data-point is a signed byte. Data starts from the bottom left cell position and is filled one row at a time. Each value of 1 equates to a height of 8 game units so each data point has an incremental game unit range of -1024 to +1016. The bottom row values should join with the cell to its south. The leftmost column likewise. The bottom row is a copy of the cell to the south's uppermost row. Likewise the leftmost column is a copy of the cell to the west's rightmost data column. Each value of the leftmost column offsets the height of all vertex data at that row and to the north. All grid-points of the remaining 32x32 grid offset the height of all landscape at that point and all points to the east just on that row. |
Unknown | 3 bytes | Unknown. Haven't noticed any ill-effects just filling this with arbitrary values in TES3 or TES4. This is probably just a 3-byte filler so that the entire subrecord's data can be aligned on a 4 byte word boundary. |
VCLR subrecord (3267 bytes)[edit]
Vertex Colour data. A 24-bit RGB 33x33 bitmap to be blended with any textures on this landscape.
Name | Type | Info |
---|---|---|
VCLR | struct | 3267 bytes: A 33x33 24-bit RGB bitmap filled in rows starting from the bottom left of the cell. The bottom row and leftmost columns are copies from the edges of the VCLR record from the preceding cells to the south and west. |
BTXT subrecord (8 bytes)[edit]
"Base" Texture subrecord. Fills a specified quarter of the cell with a single texture. Up to 4 of these can exist per LAND record.
Name | Type | Info |
---|---|---|
FormID | 4 bytes | The FormID of the texture to be applied, in the usual big-endian TES4 format. |
Quadrant | 1 byte | Specifies the quadrant this BTXT record applies to. 0 = bottom left. 1 = bottom right. 2 = upper-left. 3 = upper-right. |
Uncertain | 3 bytes | First byte may be part of Quadrant double-byte (i.e. Quadrant may be a short int), but is normally 0. Last 2 bytes meaning uncertain, but FF FF seems usual. |
ATXT subrecord (8 bytes)[edit]
Additional texture subrecord: A lead-in 'header' specifying the texture, layer and quadrant that the subsequent VTXT records will apply to:
Name | Type | Info |
---|---|---|
FormID | 4 bytes | The FormID of the texture to be applied, in the usual big-endian TES4 format. |
Quadrant | 1 byte | Specifies the quadrant this ATXT record applies to. 0 = bottom left. 1 = bottom right. 2 = upper-left. 3 = upper-right. |
Unknown | 1 byte | Unknown. |
Layer | unsigned short int | The texture layer, between 0 and 7 (i.e. 8 layers). The CS only allows up to 9 layers; the BTXT takes up the bottom layer. Uncertain of the Game engine's limit. |
VTXT Subrecord (Variable length, but always groups of 8 bytes)[edit]
Specifies up to 289 texture points and the opacity for the quadrant, layer and texture specified in the preceding ATXT record. Each quadrant contains a 17x17 grid of textures. Position 0 is the bottom-left point and data is filled one row at a time: i.e. Position 17 is the beginning of the second row.
Name | Type | Info |
---|---|---|
Position | unsigned short int | The position in this quadrant to apply the texture to. A number from 0 to 288. |
Unknown | 1 byte | Unknown. |
Unknown | 1 byte | Unknown. Frequently (but not always) the same value as the previous byte. They look to be independent scalars in any case. |
Opacity | 32-bit float | The opacity for the texture applied at this position. Varies from 0.0 to 1.0 which (AFAIK) corresponds from 0 to 255 in the CS. |
VTEX Subrecord (Variable length, but always groups of 4 bytes)[edit]
Specifies the FormIDs of LTEX records to be used.
Name | Type | Info |
---|---|---|
FormID | 4 bytes | The FormID of the LTEX to be applied, in the usual big-endian TES4 format. |