Skip to content

Buffer interpolators

Andreas Plesch edited this page Jan 5, 2022 · 25 revisions

Buffer interpolators

Introduction

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.

Summary

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

New fields

SFString buffer ""

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 ].

MFNode accessors []

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.

SFNode BufferAccessor

The node has these fields:

SFString bufferType ""

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

SFInt32 view 0

The related buffer view. Id of a BufferView.

SFInt32 byteOffset 0

The buffer byteOffset. The offset from the beginning of the referenced view in bytes.

SFInt32 componentType 5126

The buffer component type. The type of numerical representation as GL enum.

SFBool normalized false

Attribute normalization. If true, integer values will be normalized to [0,1] or [-1,1] based on their representation range.

SFInt32 count 0

The buffer element count. The count times the number of bytes defined by the component type is used to determine the size of the data in the buffer.

SFInt32 byteStride 0

The buffer byteStride. not used.

SFInt32 components 0

The buffer components. not used.