Shape Resource Container (SRC)

Subtitle
5 Format

An SRC file contains a Header and a Data section. The Header is divied into a preable and a body. The preamble is a fixed size as binary data. The header body is encoded in the format specified in the preamble. For this version the only format is JSON. It is described below. The Data section is binary encoded and is described in section-entity TBD.

Header

The SRC file Header is JSON-encoded text that describes all characteristics of the file and embedded data. It is a single array consisting of the following elements

SRC File Header Array Elements
Element Value Description
preamble Array Information identifying the file and structure. This data is not JSON encoded.
meta Array Meta information about the scene. This is user configurable.
bufferChunks Array Listing and size of the data chunks.
bufferViews Array Structure of the data views into the buffer.
textureViews Array Structure of the texture views into the buffer.
accessors Array How the data is accessed.
meshes Array The model data structure.
textures Array The texture data (image) structure.
preamble Field Array Elements
Binary data
Element Value Description
magicNumber SRC Identifies this file as a SRC file.
headerFormat JSON UTF-8 encoded character string that identifies this file header as JSON formatted.
headerVersion 1_0 UTF-8 encoded character string that identifies the version of this header for this encoding. Fraunhofer currently has this field and headerFormat as a single string. Should these be split? Is it necessary to have a byte/character count prior to the string? Should the headerLength (binary number) occur prior to these strings?
headerLength Total number of bytes in the header not including the preamble.
meta Field Array Elements
The contents of this field may be empty.
Element Value Description
unique-meta-label-1 User defined and supplied free-text. These fields are optional.
unique-meta-label-2 User defined and supplied free-text. These fields are optional.
buffferChunks Field Array Elements
Element Value Description
unique-buffferChunks-label-1 User-defined file-wide unique label for the chunk array.
unique-buffferChunks-label-2 Same as previous. Repeat as necessary.
chunk Field Array Elements
Element Value Description
byteOffset The offset to the first byte of this section from the beginning of the DATA portion of the file.
byteLength The number of bytes in this chunk.
bufferViews Field Array Elements
Element Value Description
unique-bufferViews-label-1 User-defined file-wide unique label for the bufferView array.
unique-bufferViews-label-2 Same as previous. Repeat as necessary.
buffferView Field Array Elements
Element Value Description
byteLength The number of bytes in this bufferView.
chunks An array of strings of chunk-labels.
textureViews Field Array Elements
Element Value Description
unique-textureViews-label-1 User-defined file-wide unique label for the textureView array.
unique-textureViews-label-2 Same as previous. Repeat as necessary.
textureView Field Array Elements
Element Value Description
byteLength The number of bytes in this bufferView.
chunks An array of strings of chunk-labels.
format png | jpg | gif A code indicating the format of the texture associated with this textureView. All standard browser image formats are supported. Support for dxt and other compressed texture formats are TBD.
accessors Field Array Elements
Element Value Description
indexViews An array of indexViews elements.
attributeViews An array of attributeViews elements.
indexViews Field Array Elements
Element Value Description
unique-indexViews-label-1 User-defined file-wide unique label for the attributeView array.
unique-indexViews-label-2 Same as previous. Repeat as necessary.
indexViews Field Array Elements
Element Value Description
bufferView The label of a bufferView.
byteOffset The offset to the first byte of this section relative to the beginning of the DATA portion of the file.
componentType TBD
count The number of elements of type in this indexView
attributeViews Field Array Elements
Element Value Description
unique-attributeViews-label-1 User-defined file-wide unique label for the attributeView array.
unique-attributeViews-label-2 Same as previous. Repeat as necessary. Additional documentation in glTF.
attributeView Field Array Elements
Element Value Description
bufferView The label of a bufferView.
byteOffset The offset to the first byte of this section relative to the beginning of the DATA portion of the file.
byteStride TBD
componentType TBD
type VEC3 | VEC2 | ... A character code that describes the encoded data.
count The number of elements of type in this attributeView
decodeOffset A numeric array that indicates the offset to be applied to each element of this attributeView data. There is exactly one value for element of type.
decodeScale A numeric array that indicates the scale factor to be applied to each element of this attributeView data. There is exactly one value for element of type. The real value for each stored value is computed as
R[i,j] = S[i]*D[i,j] + O[i]
where,
i
is the type index
j
is the data index
R
is the real data
S[i]
is the decodeScale element i
D[i,j]
is the stored data
O[i]
is the decodeOffset element i
meshes Field Array Elements
Element Value Description
unique-meshes-label-1 User-defined file-wide unique label for the mesh array.
unique-meshes-label-2 Same as previous. Repeat as necessary.
mesh Field Array Elements
Additional documentation at glTF
Element Value Description
attributes An array of attributes that describes the geometry of this object.
indices Identifier for an indexView
material TBD
primitive TBD
bboxCenter A 3-vector of the coordinates of the center of the bounding box for this object.
bboxSize A 3-vector of the coordinates of the size of the bounding box for this object.
meta An array of additional information needed for streaming the geometry of this object.
attributes Field Array Elements
Element Value Description
position The name of an attributeView describing the vertex coordinate positions of this object.
normal The name of an attributeView describing the normal coordinate values of this object.
texcoord The name of an attributeView describing the texture coordinate values of this object.
meta Field Array Elements
Element Value Description
progressionMethod POP | ... A string code that refers to the method of progressive transmission for this object.
indexProgression TBD
attributeProgression A numeric array of TBD.
textures Field Array Elements
Element Value Description
unique-textures-label-1 User-defined file-wide unique label for the texture array.
unique-textures-label-2 Same as previous. Repeat as necessary.
texture Field Array Elements
Element Value Description
textureView The name of an textureView describing the vertex coordinate positions of this object.
imageByteLengths An array of strings of chunk-labels.
width The number of pixels in the horizontal direction of the texture image.
height The number of pixels in the vertical direction of the texture image.
internalFormat 6408 | ... TBD
border TBD
type 5121 | ... TBD
format 6408 | ... TBD
meta TBD

Data

The "Data" block of the SRC file then simply contains bytes, which are described within the structured header to be a sequence of chunks. A valid structured header must describe all of the "Data" block by a list of subsequent, non-overlapping chunks. There must not be any range of bytes within the body that is not described by a chunk.