Graphics Reference
In-Depth Information
To implement buffers, glTF borrowed two fundamental types from typed ar-
rays:
ArrayBuffer for entries in buffers property, and
ArrayBufferView for entries in the bufferView s property.
Both buffer sand bufferView s implement the same interface of their respective
typed-array counterpart. However, types are not named exactly the same because
glTF buffer sand bufferView s contain additional properties. In the JSON snip-
pets in Figure 2.4, properties in blue come directly from typed arrays. Properties
in red are not part of typed arrays and were added to provide
external storage via a path property,
a hint about the kind of data stored via a target property, which is optional
but a useful optimization for binding the corresponding VBO once and just
updating the offset for subsequent draw calls.
”buffers” :
{ ”office” : {
”byteLength” : 829958,
”path” : ”office .bin”
}
} ,
”bufferViews” : {
”bufferView 7958” : {
”buffer” : ”office” ,
”byteLength” : 686264,
”byteOffset” :0,
”target” : ”ARRAY BUFFER”
} ,
”bufferView 7959” : {
”buffer” : ”office” ,
”byteLength” : 143694,
”byteOffset” : 686264,
”target” : ”ELEMENT ARRAY BUFFER”
}
}
While buffers and bufferView s provide access to data, other concepts are
needed:
Types: In order to map directly to GL APIs, glTF reuses existing GL types.
Interleaving: Typed arrays deal with contiguous buffers, but to interleave
vertex attributes, other properties like stride are needed. Also, semantically,
count fits better than length.
Search WWH ::




Custom Search