|
|
This format holds the meta data stored in a VertexArrayObject as well as the accociated ArrayBuffer and (optional) ElementArrayBuffer data blobs. The geometry and connectivity data is stored in a way, that it can get loaded directly onto the GPU (this format assumes Little Endian). Goals are simple parsing and quick uploading of the data.
|
|
|
Each file has to store at least one ArrayBuffer but can store multiple (all AB belong to the same object but don't need to be of the same size - they just have to be renderable together (e.g. smaller ABs with an attrib divisor)).
|
|
|
While VAOs only contain 0 or 1 EAB, this file format can store multiple EABs - these can be alternative indices (e.g. one with and one without adjacency or the same object in different render order).
|
|
|
|
|
|
<pre>
|
|
|
Magic Number 4 bytes "VAO1"
|
|
|
#ABs 4 bytes (1 uint) At least 1
|
|
|
#EABs 4 bytes (1 uint) May be 0
|
|
|
Default Mode 4 bytes (1 GLenum) Default geometry mode if no EAB is present (e.g. GL_POINTS)
|
|
|
* (#ABs ArrayBuffer sections)
|
|
|
* (#EABs ElementArrayBuffer sections)
|
|
|
</pre>
|
|
|
|
|
|
ArrayBuffer section:
|
|
|
<pre>
|
|
|
AB Name Length 4 bytes (1 uint) Length of the following name in bytes, including the trailing '\0'
|
|
|
AB Name * bytes Name of the AB, including a trailing '\0'. Might be used for storing the AB in a NameManager
|
|
|
AB Stride 4 bytes (1 GLsizei) stride size in bytes
|
|
|
AB #Attributes 4 bytes (1 uint) Number of attributes
|
|
|
* (#Attributes ArrayBuffer Attribute sections)
|
|
|
AB Data Length 8 bytes (1 uint64) Length of the following data section in bytes
|
|
|
AB Data * bytes data that can get uploaded directly to an OpenGL buffer object
|
|
|
</pre>
|
|
|
|
|
|
ArrayBuffer Attribute section:
|
|
|
<pre>
|
|
|
Attr Name Length 4 bytes (1 uint) Length of the following name in bytes, including the trailing '\0'
|
|
|
Attr Name * bytes Name of the Attribute, including a trailing '\0'.
|
|
|
Attr Type 4 bytes (1 GLenum) (e.g. GL_FLOAT)
|
|
|
Attr Size 4 bytes (1 GLint) (number of scalars per attribute: 1,2,3 or 4)
|
|
|
Attr Offset 4 bytes (1 GLuint) (in bytes)
|
|
|
Attr Normalized 1 bytes (1 GLboolean) (true or false (0))
|
|
|
Attr IsInteger 1 bytes (1 GLboolean) (true or false (0))
|
|
|
Attr Divisor 4 bytes (1 GLuint) for glVertexAttribDivisor in GL 3.3 or later
|
|
|
</pre>
|
|
|
|
|
|
ElementArrayBuffer section:
|
|
|
<pre>
|
|
|
EAB Name Length 4 bytes (1 uint) Length of the following name in bytes, including the trailing '\0'
|
|
|
EAB Name * bytes Name of the EAB, including a trailing '\0'. Used for choosing which EAB to load
|
|
|
EAB Mode 4 bytes (1 GLenum) (e.g. GL_TRIANGLES)
|
|
|
EAB Type 4 bytes (1 GLenum) (GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT or GL_UNSIGNED_INT)
|
|
|
EAB PR 1 bytes (1 bool) If != 0, use Primitive Restart
|
|
|
EAB PR Index 4 bytes (1 GLuint) PR index is stored in 32bit, may have to be converted to 8 or 16 bit depending on type
|
|
|
EAB Data Length 8 bytes (1 uint64) Length of the following data section
|
|
|
EAB Data * bytes data that can get uploaded directly to an OpenGL buffer object
|
|
|
</pre> |
|
|
\ No newline at end of file |