-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
mesh.primitive.schema.json
81 lines (81 loc) · 3.68 KB
/
mesh.primitive.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
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Mesh Primitive",
"type": "object",
"description": "Geometry to be rendered with the given material.",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
"properties": {
"attributes": {
"type": "object",
"description": "A dictionary object, where each key corresponds to mesh attribute semantic and each value is the index of the accessor containing attribute's data.",
"minProperties": 1,
"additionalProperties": {
"$ref": "glTFid.schema.json"
}
},
"indices": {
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The index of the accessor that contains the indices.",
"gltf_detailedDescription": "The index of the accessor that contains mesh indices. When this is not defined, the primitives should be rendered without indices using `drawArrays()`. When defined, the accessor must contain indices: the `bufferView` referenced by the accessor should have a `target` equal to 34963 (ELEMENT_ARRAY_BUFFER); `componentType` must be 5121 (UNSIGNED_BYTE), 5123 (UNSIGNED_SHORT) or 5125 (UNSIGNED_INT), the latter may require enabling additional hardware support; `type` must be `\"SCALAR\"`. For triangle primitives, the front face has a counter-clockwise (CCW) winding order."
},
"material": {
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The index of the material to apply to this primitive when rendering."
},
"mode": {
"description": "The type of primitives to render.",
"default": 4,
"gltf_detailedDescription": "The type of primitives to render. All valid values correspond to WebGL enums.",
"anyOf": [
{
"enum": [ 0 ],
"description": "POINTS"
},
{
"enum": [ 1 ],
"description": "LINES"
},
{
"enum": [ 2 ],
"description": "LINE_LOOP"
},
{
"enum": [ 3 ],
"description": "LINE_STRIP"
},
{
"enum": [ 4 ],
"description": "TRIANGLES"
},
{
"enum": [ 5 ],
"description": "TRIANGLE_STRIP"
},
{
"enum": [ 6 ],
"description": "TRIANGLE_FAN"
},
{
"type": "integer"
}
]
},
"targets": {
"type": "array",
"description": "An array of Morph Targets, each Morph Target is a dictionary mapping attributes (only `POSITION`, `NORMAL`, and `TANGENT` supported) to their deviations in the Morph Target.",
"items": {
"type": "object",
"minProperties": 1,
"additionalProperties": {
"$ref": "glTFid.schema.json"
},
"description": "A dictionary object specifying attributes displacements in a Morph Target, where each key corresponds to one of the three supported attribute semantic (`POSITION`, `NORMAL`, or `TANGENT`) and each value is the index of the accessor containing the attribute displacements' data."
},
"minItems": 1
},
"extensions": { },
"extras": { }
},
"gltf_webgl": "`drawElements()` and `drawArrays()`",
"required": [ "attributes" ]
}