P3D File Format - ODOLV40 Obsolete – Talk
I'm seeing a lot of varying structures dependant on model type.
//Legend
//byte = 1 char = 8 bits
//ulong = unsigned long, 4 bytes
//ushort = unsigned short 2 bytes
//asciiz = variable length zero terminated string.
//float = 4 bytes (single precision)
struct ODOLv40
}
char Signature[4]; //"ODOL"
ulong Version; //28hex, 40dec
ulong LodCount;
float Resolutions[LodCount];
byte Unknown[VariableLength]; //Length varies between models, end of Resolutions array to begining of Skeleton.
struct Skeleton //Note: A Skeleton may not exist
{
asciiz SkeletonType; //eg. Weapon, OFP2_ManSkeleton
byte Unknown;
ulong BoneCount;
struct BoneGroup
{
bool isBoneGroup; //Note: The 1st. bone is implied to be a 'group' but has no leading byte
asciiz BoneName;
};
};
byte Unknown;
ulong Something01; //Always? xh16000000, 22 - Exists in 3 odolv40's i've checked
byte Unknown[VariableLength]; //Length from 'Something01' to begining of anims.
ulong AnimationCount;
ulong Unknown; //Seems to always be 09000000=9
asciiz Animation;
};
in the M16a4.p3d after animation 'magazine_hide\0' and 'reloadMagazine\0' there is...
Also, I think the first LOD in the file structure is always the 'Memory LOD' - Well at least it looks like it in m16a4.p3d, G36.p3d and us_soldier_sniper.p3d.
--Sy 17:15, 16 June 2007 (CEST)
interesting LOD's seen so far...
1100
10000 = Shadow LOD
10010 = ?
11000 = ? Hybrid LOD
11010 = ?
9.999999828e+012 = ?
9.99999987e+014 = ?
1.999999974e+015 = LandContact
5.000000136e+015 = HitPoints
6.999999976e+015 = ViewGeometry
--Sy 12:06, 17 June 2007 (CEST)
struct Textures
{
ulong TextureCount;
asciiz Texture[TextureCount]; //Note: a texture entry can be zero-length.
ulong MaterialCount;
struct Materials[MaterialCount];
{
asciiz Material;
ulong Unknown; //Note: always seems to be '0900 0000' = 9.
float Emissive[4];
float Ambient[4];
float Diffuse[4];
float forcedDiffuse[4];
float specular[4];
float Unknown[4];
float specularPower;
ulong PixelShaderID; //Note: see enum below...
ulong VertexShaderID; //Note: see enum below...
byte Unknown[38];
struct MaterialTextures
{
asciiz MaterialTexture;
ulong Stage;
};
byte Unknown[52];
struct Stages[StageCount]; //Note: total the number of stages from above.
{
ulong uvSource;
float aside[3];
float up[3];
float dir[3];
float pos[3];
};
};
};
byte Unknown[8];
ulong FaceCount;
enum PixelShaderID
{
AlphaShadow 12;
NormalMapMacroASSpecularMap 20;
NormalMapSpecularDIMap 22;
NormalMapMacroASSpecularDIMap 24;
//... probably lots more...
};
enum VertexShaderID
{
Basic 0;
NormalMap 1;
NormalMapAS 15;
//... probably lots more...
};
--Sy 16:32, 17 June 2007 (CEST) --Sy 02:26, 18 June 2007 (CEST)