Planetary Annihilation Papa Spec

From Planetary Annihilation Titans & Classic PA Wiki
Jump to: navigation, search

Titans-icon.png Planetary Annihilation Papa Spec

Papa Header

uint32_t papa_magic (Papa);
uint32_t version (3);

uint16_t num_strings;
uint16_t num_textures;
uint16_t num_vertex_buffers;
uint16_t num_index_buffers;

uint16_t num_materials;
uint16_t num_meshes;
uint16_t num_skeletons;
uint16_t num_models;

uint16_t num_animations;
uint16_t padding[3];

uint64_t string_table_offset;
uint64_t texture_table_offset;
uint64_t vertex_buffer_table_offset;
uint64_t index_buffer_table_offset;
uint64_t material_table_offset;
uint64_t mesh_table_offset;
uint64_t skeleton_table_offset;
uint64_t model_table_offset;
uint64_t animation_table_offset;

Papa String

uint32_t length;
uint32_t padding;
uint64_t characters_offset;

Papa Texture

uint16_t name_index;
uint8_t format (R8G8B8A8, R8G8B8X8, B8G8R8A8, DXT1, DXT3, DXT5, R32F, RG32F, RGBA32F,  R16F, RG16F, RGBA16F, R8, RG8,  D0, D16, D24, D24S8, D32, R8I, R8UI, R16I, R16UI, RG8I, RG8UI, RG16I, RG16UI, R32I, R32UI, Shadow16, Shadow24, Shadow32);
uint8_t mips:7;
uint8_t srgb:1;
uint16_t width;
uint16_t height;

uint64_t data_size;
uint64_t data_offset;

Papa Vertex Buffer

uint8_t format (Position3, Position3Color4bTexCoord2, Position3Color4bTexCoord4, Position3Color4bTexCoord6, Position3Normal3, Position3Normal3TexCoord2, Position3Normal3Color4TexCoord2, Position3Normal3Color4TexCoord4, Position3Weights4bBones4bNormal3TexCoord2, Position3Normal3Tan3Bin3TexCoord2, Position3Normal3Tan3Bin3TexCoord4, Position3Normal3Tan3Bin3Color4TexCoord4, TexCoord4, Position3Color8fTexCoord6, Matrix)
uint8_t padding[3];
uint32_t num_vertices;

uint64_t data_size;
uint64_t data_offset;

Papa Vertex Buffer Position3 Format

Vec3f pos

Papa Vertex Buffer Position3Normal3Color4TexCoord2 Format

Vec3f pos;
Vec3f normal;
Color4b color;
Vec2f texcoord;

Papa Vertex Buffer Position3Weights4bBones4bNormal3TexCoord2 Format

Vec3f pos;
Vec4<uint8_t> weights;
Vec4<uint8_t> bones;
Vec3f normal;
Vec2f texcoord;

Papa Vertex Buffer Position3Normal3Tan3Bin3TexCoord4 Format

Vec3f pos;
Vec3f normal;
Vec3f tangent;
Vec3f binormal;
Vec2f texcoord;
Vec2f texcoord1;

Papa Index Buffer

uint8_t format (UInt16, UInt32);
uint8_t padding[3];
uint32_t num_indices;

uint64_t data_size;
uint64_t data_offset;

Papa Material

uint16_t shader_index;
uint16_t num_vector_params;
uint16_t num_texture_params;
uint16_t num_matrix_params;
uint64_t vector_params_offset;
uint64_t texture_params_offset;
uint64_t matrix_params_offset;

Papa Vector

uint16_t name_index;
uint16_t padding;
Vec4f value;

Papa Texture

uint16_t name_index;
uint16_t texture_index;

Papa Matrix

uint16_t name_index;
uint16_t padding;
Mat4x4f value;

Papa Mesh

uint16_t vertex_buffer_index;
uint16_t index_buffer_index;
uint16_t num_material_groups;
uint16_t padding;
uint64_t material_groups_offset;

Papa Skeleton

uint16_t num_bones;
uint16_t padding[3];
uint64_t bones_offset;

Papa Bone

uint16_t name_index;
int16_t parent_bone;
Vec3f translation;
Quatf rotation;
Mat3x3f shear_scale;
Mat4x4f bind2bone;

Papa Material Group

uint16_t name_index;
uint16_t material_index;
uint32_t first_index;
uint32_t num_primitives;
uint8_t primitive_type;
uint8_t padding[3];

Papa Model

uint16_t name_index;
uint16_t skeleton_index;
uint16_t num_mesh_bindings;
uint16_t padding;
Mat4x4f model2scene;
uint64_t mesh_binding_table_offset;

Papa Mesh Binding

uint16_t name_index;
uint16_t mesh_index;
uint16_t num_bone_mappings;
uint16_t padding;
Mat4x4f mesh2model;
uint64_t bone_mapping_offset;

Papa Animation Transform

Vec3f translation;
Quatf rotation;

Papa Animation

uint16_t name_index;
uint16_t num_bones;
uint32_t num_frames;
uint32_t frames_per_second_numerator;
uint32_t frames_per_second_denominator;
uint64_t bone_table_offset;
uint64_t transforms_offset;