KhronosGroup / KhronosGroup/glTF
[glTF 2.1] 64-bit upgrade to binary format
- Dominant language
- HTML
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 17h 26m
- Merged PRs (30d)
- 5
Description
# 64-bit upgrade to the binary format
glTF 2.0's binary format (`.glb`) uses 32-bit integers for lengths. glTF 2.1 provides a upgraded binary format that uses 64-bit integers for lengths. This is known as binary format version 3, and the existing binary format (version 2) is still defined.
Additionally, a new chunk encoding field is added to the chunk header for version 3 only. For glTF 2.1, this field is always zero. Future versions of glTF or extensions may use this field.
Importers must support both binary format version 2 and version 3. Exporters may choose to keep using version 2 binary format for compatibility, so long as the files are smaller than 4 GiB and do not use the new chunk encoding field.
## Use cases
The 64-bit binary format allows for files larger than 4 GiB. The upgraded limit is 8 EiB, with the most significant bit reserved for future use.
The chunk encoding field may be used in the future for chunk-level compression, encryption, or other features. glTF 2.1 does not define any of those, however glTF extensions already allow for compression at other levels.
## Example
> [!NOTE]
> Examples are illustrative and not exhaustive.
## Why this design
The 8 EiB limit ensures that the most significant bit is always zero, allowing glTF binary parsers to safely use signed 64-bit integers, as well as unsigned 64-bit integers. This allows for easier implementation in signed-only languages, allows `-1` to be used as a sentinel or error value, and reserves the most significant bit for future use if needed.
Contributor guide
Research direction
Start by reviewing the existing glTF 2.0 binary format definition alongside the 64-bit version 3 requirements described here. The issue's design must be resolved and documented so importers support versions 2 and 3 while exporters retain the stated compatibility rules.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100