ofp:file_formats:mlod
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
ofp:file_formats:mlod [2007/07/10 09:52] – external edit 127.0.0.1 | ofp:file_formats:mlod [2024/07/31 12:42] (current) – links added. snakeman | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== MLOD ====== | + | ====== |
- | This information comes largely from the long defunct ' | + | [[https:// |
+ | |||
+ | **Operation Flashpoint (OFP)** aka ArmA: Cold War Assault (CWA) | ||
+ | |||
+ | OFP MLOD file format. | ||
Acknowledgement from OFPInternals. Thanks to FlipeR (filipus@hotmail.com) for helping in research. | Acknowledgement from OFPInternals. Thanks to FlipeR (filipus@hotmail.com) for helping in research. | ||
Line 31: | Line 35: | ||
< | < | ||
AB // clockwise | AB // clockwise | ||
- | DC | + | DC |
AD // CounterClock | AD // CounterClock | ||
- | BC | + | BC |
</ | </ | ||
Line 44: | Line 48: | ||
< | < | ||
- | struct P3D | + | struct P3D |
{ | { | ||
char Signature[4]; | char Signature[4]; | ||
Line 70: | Line 74: | ||
.... | .... | ||
}; | }; | ||
- | | + | |
}; | }; | ||
</ | </ | ||
Line 86: | Line 90: | ||
====== Vertex Flags ====== | ====== Vertex Flags ====== | ||
- | See also O2L 'Point Properties' | + | See also O2L 'Point Properties' |
Surface: (0x0000000f mask) | Surface: (0x0000000f mask) | ||
< | < | ||
- | 0x00000000 - normal | + | 0x00000000 - normal |
- | 0x00000001 - on surface | + | 0x00000001 - on surface |
- | 0x00000002 - above surface | + | 0x00000002 - above surface |
- | 0x00000004 - undersurface | + | 0x00000004 - undersurface |
- | 0x00000008 - keep height (fence) | + | 0x00000008 - keep height (fence) |
</ | </ | ||
Decal (0x00000300 mask) | Decal (0x00000300 mask) | ||
< | < | ||
- | 0x00000000 - normal | + | 0x00000000 - normal |
- | 0x00000100 - decal | + | 0x00000100 - decal |
0x00000200 - radio12 | 0x00000200 - radio12 | ||
</ | </ | ||
Line 107: | Line 111: | ||
Fog (0x00003000 mask) | Fog (0x00003000 mask) | ||
< | < | ||
- | 0x00000000 - normal | + | 0x00000000 - normal |
- | 0x00001000 - none | + | 0x00001000 - none |
0x00002000 - sky | 0x00002000 - sky | ||
</ | </ | ||
Line 114: | Line 118: | ||
Lightning (0x000000f0 mask) | Lightning (0x000000f0 mask) | ||
< | < | ||
- | 0x00000000 - normal | + | 0x00000000 - normal |
- | 0x00000010 - shining | + | 0x00000010 - shining |
- | 0x00000020 - always in shadow | + | 0x00000020 - always in shadow |
- | 0x00000040 - fully lighted | + | 0x00000040 - fully lighted |
0x00000080 - half lighted | 0x00000080 - half lighted | ||
</ | </ | ||
Line 149: | Line 153: | ||
{ | { | ||
asciiz TextureName[32]; | asciiz TextureName[32]; | ||
- | ulong VerticesCount; | + | ulong VerticesCount; |
PolyVertex PVertex[4]; // vertex descriptors, | PolyVertex PVertex[4]; // vertex descriptors, | ||
- | // 4th always present in file, even if polygon has only 3 vertex (0 filled) | + | // 4th always present in file, even if polygon has only 3 vertex (0 filled) |
ulong PolygonFlags; | ulong PolygonFlags; | ||
}; | }; | ||
</ | </ | ||
- | Important Notes: Order of vertices | + | Important Notes: Order of vertices |
- | Vertices must be reordered for clockwise vertex order (default for DirextX), and not changed for counterclockwise order: | + | Vertices must be reordered for clockwise vertex order (default for DirextX), and not changed for counterclockwise order: |
- | for 3-vertices polygon: 1. 1st vertice descriptor 2. 3rd vertice descriptor 3. 2nd vertice descriptor 4. (not used, zero filled) | + | for 3-vertices polygon: 1. 1st vertice descriptor 2. 3rd vertice descriptor 3. 2nd vertice descriptor 4. (not used, zero filled) |
for 4-vertices polygon: 1. 1st vertice descriptor 2. 4th vertice descriptor 3. 3rd vertice descriptor 4. 2nd (not used, zero filled) | for 4-vertices polygon: 1. 1st vertice descriptor 2. 4th vertice descriptor 3. 3rd vertice descriptor 4. 2nd (not used, zero filled) | ||
Line 166: | Line 170: | ||
**PolygonFlags** | **PolygonFlags** | ||
- | See also O2L 'face properties' | + | See also O2L 'face properties' |
Enable shadow | Enable shadow | ||
Line 180: | Line 184: | ||
ZBias (0x00000300 mask) | ZBias (0x00000300 mask) | ||
< | < | ||
- | 0x00000000 - none | + | 0x00000000 - none |
- | 0x00000100 - low | + | 0x00000100 - low |
- | 0x00000200 - middle | + | 0x00000200 - middle |
- | 0x00000300 - high | + | 0x00000300 - high |
</ | </ | ||
Lightning (0x003000a0 mask) | Lightning (0x003000a0 mask) | ||
< | < | ||
- | 0x00000020 - both sides | + | 0x00000020 - both sides |
- | 0x00000080 - position | + | 0x00000080 - position |
- | 0x00200000 - flat | + | 0x00200000 - flat |
0x00100000 - reversed (transpared) | 0x00100000 - reversed (transpared) | ||
</ | </ | ||
Line 206: | Line 210: | ||
ulong Vertex_Index; | ulong Vertex_Index; | ||
ulong Normals_Index; | ulong Normals_Index; | ||
- | float UV_values[2]; | + | float UV_values[2]; |
}; | }; | ||
</ | </ | ||
Line 223: | Line 227: | ||
**TagNames** | **TagNames** | ||
- | Every LodSet contains one or more Tagname entries. The #EndOfFile# tag is a mandatory entry in every LodSet if only to indicate no more tags! | + | Every LodSet contains one or more Tagname entries. The #EndOfFile# tag is a mandatory entry in every LodSet if only to indicate no more tags! |
- | The #Mass# tag is mandatory for Geometry LODs. | + | The #Mass# tag is mandatory for Geometry LODs. |
- | Tagnames are Asciiz and can be up to 63 bytes long. ' | + | Tagnames are Asciiz and can be up to 63 bytes long. ' |
- | Tagnames not listed here (one's with no ## marks) are component names (named selections). | + | Tagnames not listed here (one's with no ## marks) are component names (named selections). |
- | Component names can contain space characters. Proxy names contain ' | + | Component names can contain space characters. Proxy names contain ' |
' | ' | ||
Line 242: | Line 246: | ||
</ | </ | ||
- | Sharp edge means that these vertices normals are not calculated as average (normalized) between polygons. | + | Sharp edge means that these vertices normals are not calculated as average (normalized) between polygons. |
**# | **# | ||
Line 249: | Line 253: | ||
struct PropertyPair | struct PropertyPair | ||
{ | { | ||
- | | + | |
| | ||
}; | }; | ||
Line 260: | Line 264: | ||
**# | **# | ||
- | Unknown tag. Used only in O2L. This tag contains a 16-byte structure: | + | Unknown tag. Used only in O2L. This tag contains a 16-byte structure: |
Seems, this tag contains material properties: | Seems, this tag contains material properties: | ||
< | < | ||
- | 4 (RGBA or BGRA) diffuse | + | 4 (RGBA or BGRA) diffuse |
- | 4 (RGBA or BGRA) ambient | + | 4 (RGBA or BGRA) ambient |
- | 4 (RGBA or BGRA) specular | + | 4 (RGBA or BGRA) specular |
4 (RGBA or BGRA) emissive | 4 (RGBA or BGRA) emissive | ||
</ | </ | ||
Line 272: | Line 276: | ||
By default, O2L writes down these values: | By default, O2L writes down these values: | ||
< | < | ||
- | 51, 75, 55, 0 | + | 51, 75, 55, 0 |
- | 0, 0, 0, 0 | + | 0, 0, 0, 0 |
- | 255, 255, 255, 255 | + | 255, 255, 255, 255 |
255, 255, 255, 255 | 255, 255, 255, 255 | ||
</ | </ | ||
Line 283: | Line 287: | ||
< | < | ||
float KeyFrameTime; | float KeyFrameTime; | ||
- | // Used to change duration of animation playing. | + | // Used to change duration of animation playing. |
- | ulong VerticesCount; | + | ulong VerticesCount; |
byte VertexArray[VerticesCount];// | byte VertexArray[VerticesCount];// | ||
</ | </ | ||
Line 292: | Line 296: | ||
Must be present only for Geometry LOD. | Must be present only for Geometry LOD. | ||
< | < | ||
- | ulong VerticesCount; | + | ulong VerticesCount; |
float VertexMassArray[VerticesCount]; | float VertexMassArray[VerticesCount]; | ||
</ | </ | ||
Line 302: | Line 306: | ||
**#Lock#** (only in O2L) | **#Lock#** (only in O2L) | ||
- | These tags all have the same structure and are used only while editing in O2L. | + | These tags all have the same structure and are used only while editing in O2L. |
They are used so that O2L can save your last selections in the edited file. | They are used so that O2L can save your last selections in the edited file. | ||
< | < | ||
- | byte VertexSaved; | + | byte VertexSaved; |
- | byte PolygonsSaved;// | + | byte PolygonsSaved;// |
</ | </ | ||
Line 317: | Line 321: | ||
Example: if VertexCount=5, | Example: if VertexCount=5, | ||
< | < | ||
- | 2, 2, 0, 2, 0, 0, 1, 1 | + | 2, 2, 0, 2, 0, 0, 1, 1 |
</ | </ | ||
- | then Vertex 0, 1, 3 is selected (indices of Vertex Table entries) and | + | then Vertex 0, 1, 3 is selected (indices of Vertex Table entries) and |
- | Polygon 1, 2 selected (indices of Polygon Table entries). | + | Polygon 1, 2 selected (indices of Polygon Table entries). |
- | Common values for vertices and polygons are the 2 and 1 respectively. But I recommend to compare it only with zero value (for example I saw early this value was 6 instead of 2 or 1). | + | Common values for vertices and polygons are the 2 and 1 respectively. But I recommend to compare it only with zero value (for example I saw early this value was 6 instead of 2 or 1). |
**# | **# | ||
Line 334: | Line 338: | ||
Valid Values for LOD Resolution are: | Valid Values for LOD Resolution are: | ||
< | < | ||
- | 1.0e3 = 1' | + | 1.0e3 = 1' |
- | 1.1e3 = 1' | + | 1.1e3 = 1' |
- | 1.2e3 = 1' | + | 1.2e3 = 1' |
- | 1.0e13 = 10' | + | 1.0e13 = 10' |
- | 1.0e15 = 1' | + | 1.0e15 = 1' |
- | 2.0e15 = 2' | + | 2.0e15 = 2' |
- | 3.0e15 = 3' | + | 3.0e15 = 3' |
- | 4.0e15 = 4' | + | 4.0e15 = 4' |
- | 5.0e15 = 5' | + | 5.0e15 = 5' |
- | 6.0e15 = 6' | + | 6.0e15 = 6' |
- | 7.0e15 = 7' | + | 7.0e15 = 7' |
- | 8.0e15 = 8' | + | 8.0e15 = 8' |
- | 9.0e15 = 9' | + | 9.0e15 = 9' |
- | 1.0e16 = 10' | + | 1.0e16 = 10' |
- | 1.1e16 = 11' | + | 1.1e16 = 11' |
- | 1.2e16 = 12' | + | 1.2e16 = 12' |
- | 1.3e16 = 13' | + | 1.3e16 = 13' |
- | 1.4e16 = 14' | + | 1.4e16 = 14' |
- | 1.5e16 = 15' | + | 1.5e16 = 15' |
1.6e16 = 16' | 1.6e16 = 16' | ||
</ | </ | ||
- | Other values (< 1000.0) are extact LOD's resolution. | + | Other values (< 1000.0) are extact LOD's resolution. |
- | LOD selected for displaying if | + | LOD selected for displaying if |
- | DistanceToObject * LODCoef * M <= LODResolution | + | DistanceToObject * LODCoef * M <= LODResolution |
Where: - LODCoef is value from OFP preferences (I have LODCoef = 0.019). - M is some value that changed by OFP developers (I use M=1 in WRPEdit and M=2 in P3DEdit). | Where: - LODCoef is value from OFP preferences (I have LODCoef = 0.019). - M is some value that changed by OFP developers (I use M=1 in WRPEdit and M=2 in P3DEdit). | ||
+ |
ofp/file_formats/mlod.1184061152.txt.gz · Last modified: 2007/07/10 09:52 by 127.0.0.1