-
Notifications
You must be signed in to change notification settings - Fork 271
Buffer interpolators
x3dom extends the standard interpolators with an option to use a binary data file, the buffer. This extension is based on how gltf uses binary data, and in fact the gltf inline function takes advantage of this extension. A few addtional fields for the interpolator nodes facilitate.
The buffer field defines the url to the binary data file. Accessor field nodes define key and keyValue pointers into the buffer and an additional offset for a view into the buffer. They also define size and data type for key and keyValue.
Here a glTF explanation of the terms: https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#binary-data-storage
The url to the binary file, that contains the binary buffer data. [ could be MFString to be consistent with Urls in x3d which have fallback options ]. Binary data are expected in little endian byte order.
A list of BufferAccessor nodes. One of bufferType "SAMPLER_INPUT" is intended for the key, and one of bufferType "SAMPLER_OUTPUT" for the keyValue. Both nodes are required. Other bufferTypes are ignored.
-
The node has these fields:
Specifies if the accessor’s elements are scalars, vectors, or matrices, or sampler input or output. Use "SAMPLER_INPUT" for key, and "SAMPLER_OUTPUT" for keyValue. Other values may be used for binary buffer storage of geometry or other nodes. Due to glTF standards, SAMPLER_INPUT values (keys) will be divided by the value of the duration field of the interpolator (see below).
The related buffer view. Index into the related array of bufferViews.
The buffer byteOffset. The offset from the beginning of the referenced view in bytes.
The buffer component type. The type of numerical representation as GL enum. Allowed values:
5120 BYTE 5121 UNSIGNED_BYTE 5122 SHORT 5123 UNSIGNED_SHORT 5125 UNSIGNED_INT 5126 FLOAT
Attribute normalization. If true, integer values will be normalized to [0,1] or [-1,1] based on their representation range.
The buffer element count. The count times the number of bytes defined by the components field is used to determine the size of the data in the buffer.
The buffer components. The number of bytes per value.
The buffer byteStride. not used.
A list of BufferView nodes. Each nodes defines a byte offsets into the binary buffer.
-
The node has these fields:
The hint representing the intended GPU buffer type as GL enum to use with this buffer view. Allowed values:
34962 ARRAY_BUFFER 34963 ELEMENT_ARRAY_BUFFER
The offset into the buffer in bytes.
The stride, in bytes, between vertex attributes. Not used for interpolator. Always assumes tightly packed.
The length of the bufferView in bytes. Not used.
X3DOM wiki