You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: extensions/Khronos/KHR_binary_glTF/README.md
+12-12
Original file line number
Diff line number
Diff line change
@@ -30,10 +30,10 @@ In Binary glTF, a glTF asset (JSON, .bin, images, and shaders) can be stored in
30
30
This binary blob (which can be a file, for example) is divided into three subsequent parts:
31
31
32
32
* A 20-byte preamble, entitled the `header`
33
-
* The structured glTF scene description, entitled the `scene`
33
+
* The structured glTF content, entitled the `content`
34
34
* The binary `body`
35
35
36
-
The `scene` part can refer to external resources as usual, and can also reference resources stored within the binary `body`.
36
+
The `content` part can refer to external resources as usual, and can also reference resources stored within the binary `body`.
37
37
38
38
## Binary glTF Layout
39
39
@@ -53,11 +53,11 @@ The 20-byte header consists of the following five 4-byte entries:
53
53
54
54
*`version` is an `uint32` that indicates the version of the Binary glTF container format. Currently available versions are shown in Table 1.
55
55
56
-
*`length` is the total length of the Binary glTF, including `header`, `scene`, and `body`, in bytes.
56
+
*`length` is the total length of the Binary glTF, including `header`, `content`, and `body`, in bytes.
57
57
58
-
*`sceneLength` is the length, in bytes, of the glTF `scene`. It must be greater than zero.
58
+
*`contentLength` is the length, in bytes, of the glTF `content`. It must be greater than zero.
59
59
60
-
*`sceneFormat` specifies the format of the glTF `scene`. A list of all valid values currently available is in Table 2.
60
+
*`contentFormat` specifies the format of the glTF `content`. A list of all valid values currently available is in Table 2.
61
61
62
62
**Table 1**: Valid values for `version`
63
63
@@ -66,22 +66,22 @@ The 20-byte header consists of the following five 4-byte entries:
66
66
| 1 | 0x00000001 | Version 1 |
67
67
68
68
69
-
**Table 2**: Valid values for `sceneFormat`
69
+
**Table 2**: Valid values for `contentFormat`
70
70
71
71
| Decimal | Hex | Description |
72
72
|--------:|-----------:|------------:|
73
73
| 0 | 0x00000000 | JSON |
74
74
75
75
76
-
### Scene
76
+
### Content
77
77
78
-
The `scene` part holds the structured glTF scene description, as it would be provided within a .gltf file in glTF without this extension.
79
-
In a JavaScript implementation, the `TextDecoder` API can be used to extract the glTF scene from the arraybuffer, and then the JSON can be parsed with `JSON.parse` as usual.
78
+
The `content` part holds the structured glTF content description, as it would be provided within a .gltf file in glTF without this extension.
79
+
In a JavaScript implementation, the `TextDecoder` API can be used to extract the glTF content from the arraybuffer, and then the JSON can be parsed with `JSON.parse` as usual.
80
80
81
-
By reading the `scene` first, an implementation is able to progressively retrieve resources from the binary body.
81
+
By reading the `content` first, an implementation is able to progressively retrieve resources from the binary body.
82
82
This way, it is also possible to read only a selected subset of resources from a Binary glTF asset (for instance, the coarsest LOD of a mesh).
83
83
84
-
Elements of the `scene` can refer to binary data within the `body`, using a special buffer with an id equal to `"binary_glTF"`.
84
+
Elements of the `content` can refer to binary data within the `body`, using a special buffer with an id equal to `"binary_glTF"`.
85
85
For more details, see [glTF Schema Updates](#gltf-schema-updates) below.
86
86
87
87
Binary glTF still supports external resources.
@@ -93,7 +93,7 @@ An advantage of Binary glTF over glTF is that resources can be embedded without
93
93
94
94
The binary `body` is the binary payload for geometry, animation key frames, skins, images, and shaders.
95
95
96
-
The start of `body` is 4-byte aligned to ease its use with JavaScript Typed Arrays. This implies that trailing spaces may be added to the JSON in the `scene` part such that `(20 + sceneLength)` is divisible by `4`.
96
+
The start of `body` is 4-byte aligned to ease its use with JavaScript Typed Arrays. This implies that trailing spaces may be added to the JSON in the `content` part such that `(20 + contentLength)` is divisible by `4`.
97
97
98
98
The buffer with id equal to `"binary_glTF"` is used to address the content of the binary `body`.
99
99
An offset of zero addresses the first byte of the binary `body`.
0 commit comments