User Tools

Site Tools


ofp:file_formats:mlod

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
ofp:file_formats:mlod [2007/07/10 09:52] – external edit 127.0.0.1ofp:file_formats:mlod [2024/07/31 12:42] (current) – links added. snakeman
Line 1: Line 1:
-====== MLOD ======+====== OFP MLOD ======
  
-This information comes largely from the long defunct 'ofpinternals'+[[https://www.pmctactical.org/forum/viewforum.php?f=43|OFP Forum]], [[:ofp|OFP Home]], [[ofp:file_formats|OFP File Formats]], [[ofp:tools|OFP Tools]], [[ofp:missions|OFP Missions]], [[ofp:modeling|OFP 3D Modeling]], [[ofp:terrain|OFP Terrain]] 
 + 
 +**Operation Flashpoint (OFP)** aka ArmA: Cold War Assault (CWA) 
 + 
 +OFP MLOD file format. This information comes largely from the long defunct 'ofpinternals'.
  
 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:
 <code> <code>
 AB // clockwise AB // clockwise
-DC +DC
  
 AD // CounterClock AD // CounterClock
-BC +BC
 </code> </code>
  
Line 44: Line 48:
  
 <code> <code>
-struct P3D +struct P3D
  {  {
  char Signature[4]; //"MLOD"  char Signature[4]; //"MLOD"
Line 70: Line 74:
    ....    ....
  };  };
- Asciiz DefaultPath[32]; //Optional. Default Path to Textures - (see O2L 'Options'+ Asciiz DefaultPath[32]; //Optional. Default Path to Textures - (see O2L 'Options')
 }; };
 </code> </code>
Line 86: Line 90:
 ====== Vertex Flags ====== ====== Vertex Flags ======
  
-See also O2L 'Point Properties'+See also O2L 'Point Properties'.
  
 Surface: (0x0000000f mask) Surface: (0x0000000f mask)
  
 <code> <code>
-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)
 </code> </code>
  
 Decal (0x00000300 mask) Decal (0x00000300 mask)
 <code> <code>
-0x00000000 - normal  +0x00000000 - normal 
-0x00000100 - decal +0x00000100 - decal
 0x00000200 - radio12 0x00000200 - radio12
 </code> </code>
Line 107: Line 111:
 Fog (0x00003000 mask) Fog (0x00003000 mask)
 <code> <code>
-0x00000000 - normal  +0x00000000 - normal 
-0x00001000 - none +0x00001000 - none
 0x00002000 - sky 0x00002000 - sky
 </code> </code>
Line 114: Line 118:
 Lightning (0x000000f0 mask) Lightning (0x000000f0 mask)
 <code> <code>
-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
 </code> </code>
Line 149: Line 153:
 { {
   asciiz TextureName[32];   asciiz TextureName[32];
-  ulong VerticesCount;    // (valid values: 3 or 4) +  ulong VerticesCount;    // (valid values: 3 or 4)
   PolyVertex PVertex[4]; // vertex descriptors, 3, or 4   PolyVertex PVertex[4]; // vertex descriptors, 3, or 4
-   // 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;
 }; };
 </code> </code>
  
-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)
 <code> <code>
-0x00000000 - none  +0x00000000 - none 
-0x00000100 - low  +0x00000100 - low 
-0x00000200 - middle  +0x00000200 - middle 
-0x00000300 - high +0x00000300 - high
 </code> </code>
  
 Lightning (0x003000a0 mask) Lightning (0x003000a0 mask)
 <code> <code>
-0x00000020 - both sides  +0x00000020 - both sides 
-0x00000080 - position  +0x00000080 - position 
-0x00200000 - flat +0x00200000 - flat
 0x00100000 - reversed (transpared) 0x00100000 - reversed (transpared)
 </code> </code>
Line 206: Line 210:
    ulong Vertex_Index; // (zero based) into respective tables    ulong Vertex_Index; // (zero based) into respective tables
    ulong Normals_Index;    ulong Normals_Index;
-   float UV_values[2]; // for texture mapping +   float UV_values[2]; // for texture mapping
 }; };
 </code> </code>
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. 'Official' bis tags are surround by #.....# marks. +Tagnames are Asciiz and can be up to 63 bytes long. 'Official' bis tags are surround by #.....# marks.
  
-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 'proxy:' + ProxyName + '.' + ProxyNumber ('01' .. ) +Component names can contain space characters. Proxy names contain 'proxy:' + ProxyName + '.' + ProxyNumber ('01' .. )
  
 'Official' tagnames listed below are a mish mash of obsolete, and still used, commands. This because, the p3d was a still in development at time of CWC release. 'Official' tagnames listed below are a mish mash of obsolete, and still used, commands. This because, the p3d was a still in development at time of CWC release.
Line 242: Line 246:
 </code> </code>
  
-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.
  
 **#Property#** **#Property#**
Line 249: Line 253:
 struct PropertyPair struct PropertyPair
 { {
- Asciiz PropertyName1[64]; + Asciiz PropertyName1[64];
  Asciiz PropertyValue[64];  Asciiz PropertyValue[64];
 }; };
Line 260: Line 264:
 **#MaterialIndex#** (only in O2L) **#MaterialIndex#** (only in O2L)
  
-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:
 <code> <code>
-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
 </code> </code>
Line 272: Line 276:
 By default, O2L writes down these values: By default, O2L writes down these values:
 <code> <code>
-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
 </code> </code>
Line 283: Line 287:
 <code> <code>
 float KeyFrameTime; // Valid Values: 0.0 (start) - 1.0 (stop). float KeyFrameTime; // Valid Values: 0.0 (start) - 1.0 (stop).
-                    // Used to change duration of animation playing.  +                    // Used to change duration of animation playing. 
-ulong VerticesCount; // Must be the same as Vertices Count in the LOD header. +ulong VerticesCount; // Must be the same as Vertices Count in the LOD header.
 byte  VertexArray[VerticesCount];// This data replaces main LOD Vertex Table. byte  VertexArray[VerticesCount];// This data replaces main LOD Vertex Table.
 </code> </code>
Line 292: Line 296:
 Must be present only for Geometry LOD. Must be present only for Geometry LOD.
 <code> <code>
-ulong VerticesCount; // Must be the same as Vertices Count in the LOD header. +ulong VerticesCount; // Must be the same as Vertices Count in the LOD header.
 float VertexMassArray[VerticesCount]; float VertexMassArray[VerticesCount];
 </code> </code>
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.
 <code> <code>
-byte VertexSaved; // Non-zero value if vertex selected/hidden/locked.  +byte VertexSaved; // Non-zero value if vertex selected/hidden/locked. 
-byte PolygonsSaved;// Non-zero value if polygon selected/hidden/locked. +byte PolygonsSaved;// Non-zero value if polygon selected/hidden/locked.
 </code> </code>
  
Line 317: Line 321:
 Example: if VertexCount=5, PolygonsCount=3 then a #selected# tag would contain: Example: if VertexCount=5, PolygonsCount=3 then a #selected# tag would contain:
 <code> <code>
-2, 2, 0, 2, 0, 0, 1, 1 +2, 2, 0, 2, 0, 0, 1, 1
 </code> </code>
  
-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).
  
 **#EndOfFile#** **#EndOfFile#**
Line 334: Line 338:
 Valid Values for LOD Resolution are: Valid Values for LOD Resolution are:
 <code> <code>
-1.0e3 = 1'000.0 = View - Gunner  +1.0e3 = 1'000.0 = View - Gunner 
-1.1e3 = 1'100.0 = View - Pilot  +1.1e3 = 1'100.0 = View - Pilot 
-1.2e3 = 1'200.0 = View - Cargo  +1.2e3 = 1'200.0 = View - Cargo 
-1.0e13 = 10'000'000'000'000.0 = Geometry  +1.0e13 = 10'000'000'000'000.0 = Geometry 
-1.0e15 = 1'000'000'000'000'000.0 = Memory  +1.0e15 = 1'000'000'000'000'000.0 = Memory 
-2.0e15 = 2'000'000'000'000'000.0 = LandContact  +2.0e15 = 2'000'000'000'000'000.0 = LandContact 
-3.0e15 = 3'000'000'000'000'000.0 = Roadway  +3.0e15 = 3'000'000'000'000'000.0 = Roadway 
-4.0e15 = 4'000'000'000'000'000.0 = Paths  +4.0e15 = 4'000'000'000'000'000.0 = Paths 
-5.0e15 = 5'000'000'000'000'000.0 = Hitpoints  +5.0e15 = 5'000'000'000'000'000.0 = Hitpoints 
-6.0e15 = 6'000'000'000'000'000.0 = View Geometry  +6.0e15 = 6'000'000'000'000'000.0 = View Geometry 
-7.0e15 = 7'000'000'000'000'000.0 = Fire Geometry  +7.0e15 = 7'000'000'000'000'000.0 = Fire Geometry 
-8.0e15 = 8'000'000'000'000'000.0 = View - Cargo - Geometry  +8.0e15 = 8'000'000'000'000'000.0 = View - Cargo - Geometry 
-9.0e15 = 9'000'000'000'000'000.0 = View - Cargo - Fire Geometry  +9.0e15 = 9'000'000'000'000'000.0 = View - Cargo - Fire Geometry 
-1.0e16 = 10'000'000'000'000'000.0 = View - Commander  +1.0e16 = 10'000'000'000'000'000.0 = View - Commander 
-1.1e16 = 11'000'000'000'000'000.0 = View - Commander - Geometry  +1.1e16 = 11'000'000'000'000'000.0 = View - Commander - Geometry 
-1.2e16 = 12'000'000'000'000'000.0 = View - Commander - Fire Geometry  +1.2e16 = 12'000'000'000'000'000.0 = View - Commander - Fire Geometry 
-1.3e16 = 13'000'000'000'000'000.0 = View - Pilot - Geometry  +1.3e16 = 13'000'000'000'000'000.0 = View - Pilot - Geometry 
-1.4e16 = 14'000'000'000'000'000.0 = View - Pilot - Fire Geometry  +1.4e16 = 14'000'000'000'000'000.0 = View - Pilot - Fire Geometry 
-1.5e16 = 15'000'000'000'000'000.0 = View - Gunner - Geometry +1.5e16 = 15'000'000'000'000'000.0 = View - Gunner - Geometry
 1.6e16 = 16'000'000'000'000'000.0 = View - Gunner - Fire Geometry 1.6e16 = 16'000'000'000'000'000.0 = View - Gunner - Fire Geometry
 </code> </code>
  
-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

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

All PMC web site download services are temporarily suspended until web site yearly fees have been recovered, want to download addons/mods? Then Support PMC.

If you are grateful for all the work PMC has done in the past 25 years, use Support PMC page.