forked from KhronosGroup/glTF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccessor.schema.json
135 lines (135 loc) · 6.5 KB
/
accessor.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Accessor",
"type": "object",
"description": "A typed view into a bufferView. A bufferView contains raw binary data. An accessor provides a typed view into a bufferView or a subset of a bufferView similar to how WebGL's `vertexAttribPointer()` defines an attribute in a buffer.",
"allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],
"properties": {
"bufferView": {
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The index of the bufferView.",
"gltf_detailedDescription": "The index of the bufferView. When not defined, accessor must be initialized with zeros; `sparse` property or extensions could override zeros with actual values."
},
"byteOffset": {
"type": "integer",
"description": "The offset relative to the start of the bufferView in bytes.",
"minimum": 0,
"default": 0,
"gltf_detailedDescription": "The offset relative to the start of the bufferView in bytes. This must be a multiple of the size of the component datatype.",
"gltf_webgl": "`vertexAttribPointer()` offset parameter"
},
"componentType": {
"description": "The datatype of components in the attribute.",
"gltf_detailedDescription": "The datatype of components in the attribute. All valid values correspond to WebGL enums. The corresponding typed arrays are `Int8Array`, `Uint8Array`, `Int16Array`, `Uint16Array`, `Uint32Array`, and `Float32Array`, respectively. 5125 (UNSIGNED_INT) is only allowed when the accessor contains indices, i.e., the accessor is only referenced by `primitive.indices`.",
"gltf_webgl": "`vertexAttribPointer()` type parameter",
"anyOf": [
{
"enum": [ 5120 ],
"description": "BYTE",
"type": "integer"
},
{
"enum": [ 5121 ],
"description": "UNSIGNED_BYTE",
"type": "integer"
},
{
"enum": [ 5122 ],
"description": "SHORT",
"type": "integer"
},
{
"enum": [ 5123 ],
"description": "UNSIGNED_SHORT",
"type": "integer"
},
{
"enum": [ 5125 ],
"description": "UNSIGNED_INT",
"type": "integer"
},
{
"enum": [ 5126 ],
"description": "FLOAT",
"type": "integer"
},
{
"type": "integer"
}
]
},
"normalized": {
"type": "boolean",
"description": "Specifies whether integer data values should be normalized.",
"default": false,
"gltf_detailedDescription": "Specifies whether integer data values should be normalized (`true`) to [0, 1] (for unsigned types) or [-1, 1] (for signed types), or converted directly (`false`) when they are accessed. This property is defined only for accessors that contain vertex attributes or animation output data.",
"gltf_webgl": "`vertexAttribPointer()` normalized parameter"
},
"count": {
"type": "integer",
"description": "The number of attributes referenced by this accessor.",
"minimum": 1,
"gltf_detailedDescription": "The number of attributes referenced by this accessor, not to be confused with the number of bytes or number of components."
},
"type": {
"description": "Specifies if the attribute is a scalar, vector, or matrix.",
"anyOf": [
{
"enum": [ "SCALAR" ]
},
{
"enum": [ "VEC2" ]
},
{
"enum": [ "VEC3" ]
},
{
"enum": [ "VEC4" ]
},
{
"enum": [ "MAT2" ]
},
{
"enum": [ "MAT3" ]
},
{
"enum": [ "MAT4" ]
},
{
"type": "string"
}
]
},
"max": {
"type": "array",
"description": "Maximum value of each component in this attribute.",
"items": {
"type": "number"
},
"minItems": 1,
"maxItems": 16,
"gltf_detailedDescription": "Maximum value of each component in this attribute. Array elements must be treated as having the same data type as accessor's `componentType`. Both min and max arrays have the same length. The length is determined by the value of the type property; it can be 1, 2, 3, 4, 9, or 16.\n\n`normalized` property has no effect on array values: they always correspond to the actual values stored in the buffer. When accessor is sparse, this property must contain max values of accessor data with sparse substitution applied."
},
"min": {
"type": "array",
"description": "Minimum value of each component in this attribute.",
"items": {
"type": "number"
},
"minItems": 1,
"maxItems": 16,
"gltf_detailedDescription": "Minimum value of each component in this attribute. Array elements must be treated as having the same data type as accessor's `componentType`. Both min and max arrays have the same length. The length is determined by the value of the type property; it can be 1, 2, 3, 4, 9, or 16.\n\n`normalized` property has no effect on array values: they always correspond to the actual values stored in the buffer. When accessor is sparse, this property must contain min values of accessor data with sparse substitution applied."
},
"sparse": {
"allOf": [ { "$ref": "accessor.sparse.schema.json" } ],
"description": "Sparse storage of attributes that deviate from their initialization value."
},
"name": { },
"extensions": { },
"extras": { }
},
"dependencies": {
"byteOffset": [ "bufferView" ]
},
"required": [ "componentType", "count", "type" ]
}