This project has moved and is read-only. For the latest updates, please go here.
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

DirectX Tool Kit


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

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() )

uint32_t numVertices = 0;
uint32_t numIndices = 0; reinterpret_cast<char*>( &numVertices ), sizeof(uint32_t ) );
if ( !numVertices )
    return E_FAIL; 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 ); reinterpret_cast<char*>( &vertices.front() ), sizeof(Vertex) * numVertices );

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

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