P3D Lod Sections: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (faceoffsets)
Line 4: Line 4:
  LodSection
  LodSection
  {
  {
   ulong FaceIndexBounds[2];    // lower vs upper (NoOfFaces in this section = (FaceUpperIndex - FaceLowerIndex) / 8
   ulong FaceIndexOffsets[2];    // from / to region of LodFaces used
   ulong MaterialIndexBounds[2]; // ODOLV4x only
   ulong MaterialIndexOffsets[2]; // ODOLV4x only
   ulong CommonPointsUserValue;  // see [[P3D Point and Face Flags]]
   ulong CommonPointsUserValue;  // see [[P3D Point and Face Flags]]
                                 // 0xC9 -> LodPoints 0x0C90003F
                                 // 0xC9 -> LodPoints 0x0C90003F
Line 27: Line 27:
*In odol7 TextureIndexes and FaceFlags existed for every LodFace in the LodFace Structure, and repeated (as a block) here.
*In odol7 TextureIndexes and FaceFlags existed for every LodFace in the LodFace Structure, and repeated (as a block) here.
*In Arma they are removed from the LodFaces.
*In Arma they are removed from the LodFaces.
==FaceIndexOffsets==
LodFaces are organised sequentially,  in blocks.
The 1st block of faces use the 1st section and so on.
There must be, at least one section in a lod. If it's the only one, it will span the entire lodface structure.
FaceIndexOffsets contain relative memory offsets of the faces used in this section.
Each subsequent section (if any) uses the next, sequential block.
Because Faces contain either triangles, or, quads. The amount of data in each block is variable.
A face quad uses 10 bytes, a face triangle uses 8.
Example:
*this section uses the first two faces of the face structure;
*Face 0 = triangle (8 bytes)
*Face 1 = box (10 bytes)
*Face 2 (if any) next section (if any)
Lower Offset = 0    // ie start of the face structure since this is the 1st section
Upper Offser = 8+10 // bytes start of next section (if any) or end of faces
The next section (if any) will contain:
Lower Offset = 8+10 // beginning of this block
Upper Offset = 8*nTriangles.ThisBlock+ 10* nQuads.ThisBlock
etc


=Related Page(s)=
=Related Page(s)=

Revision as of 03:19, 25 May 2010

Template:unsupported-doc

LodSection

LodSection
{
 ulong FaceIndexOffsets[2];     // from / to region of LodFaces used
 ulong MaterialIndexOffsets[2]; // ODOLV4x only
 ulong CommonPointsUserValue;  // see P3D Point and Face Flags
                               // 0xC9 -> LodPoints 0x0C90003F
                               // LodPointFlags are in a separate table for arma, and in the VertexTable for ofp (odol7)
 short CommonTextureIndex;     //
 ulong CommonFaceFlags;        // see P3D Point and Face Flags
 ///////// // ODOLV4x only//////
 long  MaterialIndex;
 if MaterialIndex ==-1
 {
   byte ExtraByte;
 }
 ulong UnknowLong;             // generally 2
 float UnknownResolution;
 float UnknownResolution2;     // generally 1000.0
 ////////////////////////////////
}
  • a Material or Texture index with default value (-1) has no face/material associated with it and consequently the bounds are zero
  • In odol7 TextureIndexes and FaceFlags existed for every LodFace in the LodFace Structure, and repeated (as a block) here.
  • In Arma they are removed from the LodFaces.


FaceIndexOffsets

LodFaces are organised sequentially, in blocks.

The 1st block of faces use the 1st section and so on.

There must be, at least one section in a lod. If it's the only one, it will span the entire lodface structure.


FaceIndexOffsets contain relative memory offsets of the faces used in this section.

Each subsequent section (if any) uses the next, sequential block.

Because Faces contain either triangles, or, quads. The amount of data in each block is variable.

A face quad uses 10 bytes, a face triangle uses 8.

Example:

  • this section uses the first two faces of the face structure;
  • Face 0 = triangle (8 bytes)
  • Face 1 = box (10 bytes)
  • Face 2 (if any) next section (if any)
Lower Offset = 0    // ie start of the face structure since this is the 1st section
Upper Offser = 8+10 // bytes start of next section (if any) or end of faces

The next section (if any) will contain:

Lower Offset = 8+10 // beginning of this block
Upper Offset = 8*nTriangles.ThisBlock+ 10* nQuads.ThisBlock

etc

Related Page(s)

Model File Formats