Difference between revisions of "BSP Format (BO1)"

From COD Engine Research
Jump to: navigation, search
(Created page with "Category:BO1 == BSP Header == <syntaxhighlight lang="cpp"> enum LumpType { LUMP_MATERIALS = 0x0, LUMP_LIGHTBYTES = 0x1, LUMP_LIGHTGRIDENTRIES = 0x2, LUMP_LIGHTGRID...")
 
(No difference)

Latest revision as of 03:28, 23 January 2015

BSP Header

enum LumpType
{
  LUMP_MATERIALS = 0x0,
  LUMP_LIGHTBYTES = 0x1,
  LUMP_LIGHTGRIDENTRIES = 0x2,
  LUMP_LIGHTGRIDCOLORS = 0x3,
  LUMP_PLANES = 0x4,
  LUMP_BRUSHSIDES = 0x5,
  LUMP_BRUSHSIDEEDGECOUNTS = 0x6,
  LUMP_BRUSHEDGES = 0x7,
  LUMP_BRUSHES = 0x8,
  LUMP_TRIANGLES = 0x9,
  LUMP_DRAWVERTS = 0xA,
  LUMP_DRAWINDICES = 0xB,
  LUMP_CULLGROUPS = 0xC,
  LUMP_CULLGROUPINDICES = 0xD,
  LUMP_OBSOLETE_1 = 0xE,
  LUMP_OBSOLETE_2 = 0xF,
  LUMP_OBSOLETE_3 = 0x10,
  LUMP_OBSOLETE_4 = 0x11,
  LUMP_OBSOLETE_5 = 0x12,
  LUMP_PORTALVERTS = 0x13,
  LUMP_OBSOLETE_6 = 0x14,
  LUMP_UINDS = 0x15,
  LUMP_BRUSHVERTSCOUNTS = 0x16,
  LUMP_BRUSHVERTS = 0x17,
  LUMP_AABBTREES = 0x18,
  LUMP_CELLS = 0x19,
  LUMP_PORTALS = 0x1A,
  LUMP_NODES = 0x1B,
  LUMP_LEAFS = 0x1C,
  LUMP_LEAFBRUSHES = 0x1D,
  LUMP_LEAFSURFACES = 0x1E,
  LUMP_COLLISIONVERTS = 0x1F,
  LUMP_COLLISIONTRIS = 0x20,
  LUMP_COLLISIONEDGEWALKABLE = 0x21,
  LUMP_COLLISIONBORDERS = 0x22,
  LUMP_COLLISIONPARTITIONS = 0x23,
  LUMP_COLLISIONAABBS = 0x24,
  LUMP_MODELS = 0x25,
  LUMP_VISIBILITY = 0x26,
  LUMP_ENTITIES = 0x27,
  LUMP_PATHCONNECTIONS = 0x28,
  LUMP_REFLECTION_PROBES = 0x29,
  LUMP_VERTEX_LAYER_DATA = 0x2A,
  LUMP_PRIMARY_LIGHTS = 0x2B,
  LUMP_LIGHTGRIDHEADER = 0x2C,
  LUMP_LIGHTGRIDROWS = 0x2D,
  LUMP_OBSOLETE_10 = 0x2E,
  LUMP_OBSOLETE_11 = 0x2F,
  LUMP_OBSOLETE_12 = 0x30,
  LUMP_OBSOLETE_13 = 0x31,
  LUMP_OBSOLETE_14 = 0x32,
  LUMP_OBSOLETE_15 = 0x33,
  LUMP_WATERHEADER = 0x34,
  LUMP_WATERCELLS = 0x35,
  LUMP_WATERCELLDATA = 0x36,
  LUMP_BURNABLEHEADER = 0x37,
  LUMP_BURNABLECELLS = 0x38,
  LUMP_BURNABLECELLDATA = 0x39,
  LUMP_SIMPLELIGHTMAPBYTES = 0x3A,
  LUMP_LODCHAINS = 0x3B,
  LUMP_LODINFOS = 0x3C,
  LUMP_LODSURFACES = 0x3D,
  LUMP_LIGHTREGIONS = 0x3E,
  LUMP_LIGHTREGION_HULLS = 0x3F,
  LUMP_LIGHTREGION_AXES = 0x40,
  LUMP_WIILIGHTGRID = 0x41,
  LUMP_LIGHTGRID2D_LIGHTS = 0x42,
  LUMP_LIGHTGRID2D_INDICES = 0x43,
  LUMP_LIGHTGRID2D_POINTS = 0x44,
  LUMP_LIGHTGRID2D_CELLS = 0x45,
  LUMP_LIGHT_CORONAS = 0x46,
  LUMP_SHADOWMAP_VOLUMES = 0x47,
  LUMP_SHADOWMAP_VOLUME_PLANES = 0x48,
  LUMP_EXPOSURE_VOLUMES = 0x49,
  LUMP_EXPOSURE_VOLUME_PLANES = 0x4A,
  LUMP_OCCLUDERS = 0x4B,
  LUMP_OUTDOORBOUNDS = 0x4C,
  LUMP_HERO_ONLY_LIGHTS = 0x4D,
};
 
struct BspChunk
{
  LumpType type;
  unsigned int length;
};
 
struct BspHeader
{
  unsigned int ident;
  unsigned int version;
  unsigned int chunkCount;
  BspChunk chunks[100];
};

Lump Types

MATERIALS

struct dmaterial_t
{
  char material[64];
  int surfaceFlags;
  int contentFlags;
};

LIGHTBYTES

LIGHTGRIDENTRIES

struct GfxLightGridEntry
{
  unsigned __int16 colorsIndex;
  char primaryLightIndex;
  char needsTrace;
};

LIGHTGRIDCOLORS

PLANES

struct dplane_t
{
  float normal[3];
  float dist;
};

BRUSHSIDES

struct dbrushside_t
{
  union
  {
    int planeNum;
    float bound;
  } u;
  int materialNum;
};

BRUSHSIDEEDGECOUNTS

BRUSHEDGES

BRUSHES

struct dbrush_t
{
  __int16 numSides;
  __int16 materialNum;
};

TRIANGLES

struct DiskTriangleSoup
{
  unsigned __int16 materialIndex;
  char lightmapIndex;
  char reflectionProbeIndex;
  char primaryLightIndex;
  bool hasPrimaryLightConflict;
  bool castsSunShadow;
  __int16 castsShadow;
  int vertexLayerData;
  unsigned int firstVertex;
  unsigned __int16 vertexCount;
  unsigned __int16 indexCount;
  int firstIndex;
};

DRAWVERTS

struct DiskGfxVertex
{
  float xyz[3];
  float normal[3];
  char color[4];
  float texCoord[2];
  float lmapCoord[2];
  float tangent[3];
  float binormal[3];
};

DRAWINDICES

CULLGROUPS

struct DiskGfxCullGroup
{
  float mins[3];
  float maxs[3];
  unsigned int firstSurface;
  unsigned int surfaceCount;
};

CULLGROUPINDICES

PORTALVERTS

OBSOLETE_1

OBSOLETE_2

OBSOLETE_3

OBSOLETE_4

OBSOLETE_5

UINDS

OBSOLETE_6

BRUSHVERTSCOUNT

BRUSHVERTS

AABBTREES

struct DiskGfxAabbTree
{
  unsigned int firstSurface;
  unsigned int surfaceCount;
  unsigned int childCount;
};

CELLS

struct DiskGfxCell
{
  float mins[3];
  float maxs[3];
  unsigned __int16 aabbTreeIndex;
  int firstPortal;
  int portalCount;
  int firstCullGroup;
  int cullGroupCount;
  char reflectionProbeCount;
  char reflectionProbes[64];
};

PORTALS

struct DiskGfxPortal
{
  int planeIndex;
  int cellIndex;
  int firstPortalVertex;
  int portalVertexCount;
};

NODES

struct dnode_t
{
  int planeNum;
  int children[2];
  int mins[3];
  int maxs[3];
};

LEAFS

struct DiskLeaf
{
  int cluster;
  int firstCollAabbIndex;
  int collAabbCount;
  int firstLeafBrush;
  int numLeafBrushes;
  int cellNum;
};

LEAFBRUSHES

LEAFSURFACES

COLLISIONVERTS

COLLISIONTRIS

COLLISIONEDGEWALKABLE

COLLISIONBORDERS

struct DiskCollBorder
{
  float distEq[3];
  float zBase;
  float zSlope;
  float start;
  float length;
};

COLLISIONPARTITIONS

struct DiskCollPartition
{
  unsigned __int16 checkStamp;
  char triCount;
  char borderCount;
  int firstTriIndex;
  int firstBorderIndex;
  int nuinds;
  int fuind;
};

COLLISIONAABBS

struct DiskCollAabbTree
{
  float origin[3];
  float halfSize[3];
  unsigned __int16 materialIndex;
  unsigned __int16 childCount;
  union
  {
    int firstChildIndex;
    int partitionIndex;
  } u;
};

MODELS

struct DiskBrushModel
{
  float mins[3];
  float maxs[3];
  unsigned __int16 firstTriSoup;
  unsigned __int16 triSoupCount;
  int firstSurface;
  int numSurfaces;
  int firstBrush;
  int numBrushes;
};

VISIBILITY

ENTITIES

PATHCONNECTIONS

REFLECTION_PROBES

struct DiskGfxReflectionProbeVolumeData
{
  float volumePlanes[6][4];
};
 
struct DiskGfxReflectionProbe
{
  float origin[3];
  char pixels[262224];
  DiskGfxReflectionProbeVolumeData probeVolumes[16];
  unsigned int probeVolumeCount;
  char colorCorrectionFilename[64];
  char name[64];
};

VERTEX_LAYER_DATA

PRIMARY_LIGHTS

struct DiskPrimaryLight
{
  char type;
  char canUseShadowMap;
  __int16 cullDist;
  char priority;
  char _pad[3];
  float dir[3];
  float origin[3];
  float color[3];
  float specularcolor[3];
  float attenuation[3];
  float angle[3];
  float bouncecolor[3];
  float intensity;
  float cutOn;
  float radius;
  float nearEdge;
  float farEdge;
  float cosHalfFovOuter;
  float cosHalfFovInner;
  int exponent;
  float rotationLimit;
  float translationLimit;
  float roundness;
  float mipDistance;
  float aAbB[4];
  float cookieControl0[4];
  float cookieControl1[4];
  float cookieControl2[4];
  char defName[64];
};

LIGHTGRIDHEADER

struct GfxLightGridHeader
{
  unsigned __int16 mins[3];
  unsigned __int16 maxs[3];
  unsigned int rowAxis;
  unsigned int colAxis;
  unsigned __int16 rowDataStart[8192];
};

LIGHTGRIDROWS

OBSOLETE_10

OBSOLETE_11

OBSOLETE_12

OBSOLETE_13

OBSOLETE_14

OBSOLETE_15

WATERHEADER

struct DiskWaterHeader
{
  int minx;
  int miny;
  int maxx;
  int maxy;
  unsigned __int16 materialIndex;
};

WATERCELLS

struct DiskWaterCell
{
  __int16 waterheight;
  char flooroffset;
  char shoreDist;
  char color[4];
};

WATERCELLDATA

BURNABLEHEADER

struct DiskBurnableHeader
{
  int minx;
  int miny;
  int maxx;
  int maxy;
};

BURNABLECELLS

struct DiskBurnableSample
{
  char state;
};
 
struct DiskBurnableCell
{
  int x;
  int y;
  DiskBurnableSample data;
  int dataIndex;
};

BURNABLECELLDATA

struct DiskBurnableSample
{
  char state;
};
 
struct DiskBurnableBlock
{
  DiskBurnableSample data[32];
};

SIMPLELIGHTMAPBYTES

LODCHAINS

struct DiskLodChain
{
  float origin[3];
  float lastDist;
  unsigned int firstLodInfo;
  unsigned __int16 lodInfoCount;
};

LODINFOS

struct DiskLodInfo
{
  float dist;
  unsigned int firstSurf;
  unsigned __int16 surfCount;
};

LODSURFACES

LIGHTREGIONS

struct DiskLightRegion
{
  char hullCount;
};

LIGHTREGION_HULLS

struct DiskLightRegionHull
{
  float kdopMidPoint[9];
  float kdopHalfSize[9];
  unsigned int axisCount;
};

LIGHTREGION_AXES

struct DiskLightRegionAxis
{
  float dir[3];
  float midPoint;
  float halfSize;
};

WIILIGHTGRID

LIGHTGRID2D_LIGHTS

LIGHTGRID2D_INDICES

LIGHTGRID2D_POINTS

LIGHTGRID2D_CELLS

LIGHT_CORONAS

struct DiskGfxLightCorona
{
  float origin[3];
  float radius;
  float color[3];
  float intensity;
};

SHADOWMAP_VOLUMES

struct DiskGfxShadowMapVolume
{
  unsigned int control;
  unsigned int paddingforlater[3];
};

SHADOWMAP_VOLUME_PLANES

struct DiskGfxVolumePlane
{
  float plane[4];
};

EXPOSURE_VOLUMES

struct DiskGfxExposureVolume
{
  unsigned int control;
  float exposure;
  float luminanceIncreaseScale;
  float luminanceDecreaseScale;
  float featherRange;
  float featherAdjust;
  float boundingSphere[4];
};

EXPOSURE_VOLUME_PLANES

struct DiskGfxVolumePlane
{
  float plane[4];
};

OCCLUDERS

struct DiskGfxOccluder
{
  char name[16];
  float pts[4][3];
};

OUTDOORBOUNDS

struct DiskGfxOutdoorBounds
{
  float bounds[2][3];
};

HERO_ONLY_LIGHTS

struct DiskHeroOnlyLight
{
  char type;
  char unused[3];
  float color[3];
  float dir[3];
  float origin[3];
  float radius;
  float cosHalfFovOuter;
  float cosHalfFovInner;
  int exponent;
};