Air Point Cloud File Format

Air can save and re-use point-based data for effects such as indirect illumination, occlusion, subsurface scattering, and caustics.  The Air Point Tool (airpt) included with Air allows point data to be translated to and from several formats including a simple text format.  However, some users have requested information on the native Air Point Cloud (.apc) format used to store unstructured point data.  We’ve uploaded the source code for a simple APC reader here.

An Air point cloud is a simple binary file with a short header followed by a list of records, one record for each point.  Here’s the header:

typedef struct {
  char diName[48];
  int diType, diNarr, diIndex, diSize;
} DataInfo;

typedef struct {
  char id[4];
  unsigned int hsize;
  float gbound[6];
  float world2camera[16], world2ndc[16];
  int xres, yres;
  float par, fov;
  int flags;
  int maxdepth, maxleafsize;
  int nbrick, bricksize;
  int nbiv,npts;
  unsigned int ptoffset;
  float minwidth, maxwidth;
  int pad[256];
  int ndata,datasize;
  DataInfo di[64];
} AirPointHeader; 

The ptoffset field gives the file position where the actual data begins.  The data for each point is stored as a binary array of floats with little-endian byte order.

This entry was posted in Uncategorized and tagged . Bookmark the permalink.