Vertex Buffer Object (VBO) is an extremely simple mesh format originally defined by the Windows 8.0 Resource Loading sample.

VBO is supported as a runtime format for DirectXTK's Model class.

Windows 8 app samples
http://code.msdn.microsoft.com/Windows-8-app-samples-4d76cbbf

DirectX Tool Kit
http://go.microsoft.com/fwlink/?LinkId=248929

Meshconvert
http://go.microsoft.com/fwlink/?LinkID=324981

To aid in debugging, here is a simple console program for dumping out the content of a VBO in a human-readable form.
vbodump.cpp

File Format Details

The VBO object is essentially a binary dump of a VB and an IB. It does not describe the input layout, the vertex size, attributes or material information, or support 32-bit index buffers.

DWORD numVertices
DWORD numIndices
<vertex data>
<16-bit index data>

The ResourceLoading sample used a vertex layout of { XMFLOAT3 position, XMFLOAT3 normal, XMFLOAT2 textureCoordinates } which is assumed to be fixed for the format. Variants could use alternative vertex formats, but this information is not encoded in the VBO file itself.

Example Code

std::ifstream vboFile(szFileName, std::ifstream::in | std::ifstream::binary);
if ( !vboFile.is_open() )
    return HRESULT_FROM_WIN32( ERROR_FILE_NOT_FOUND );

uint32_t numVertices = 0;
uint32_t numIndices = 0;

vboFile.read( reinterpret_cast<char*>( &numVertices ), sizeof(uint32_t ) );
if ( !numVertices )
    return E_FAIL;

vboFile.read( reinterpret_cast<char*>( &numIndices ), sizeof(uint32_t ) );
if ( !numIndices )
    return E_FAIL;

struct Vertex
{
    XMFLOAT3 position;
    XMFLOAT3 normal;
    XMFLOAT2 textureCoordinates;
};

std::vector<Vertex> vertices;
vertices.resize( numVertices );
vboFile.read( reinterpret_cast<char*>( &vertices.front() ), sizeof(Vertex) * numVertices );

std::vector<uint16_t> indices;
indices.resize( numIndices );
vboFile.read( reinterpret_cast<char*>( &indices.front() ), sizeof(uint16_t) * numIndices );

Last edited Jun 16, 2015 at 7:19 PM by walbourn, version 10