Skip to content

Commit

Permalink
Update EXT_mesh_features schema
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Oct 13, 2021
1 parent 0e3877e commit 270e7ad
Show file tree
Hide file tree
Showing 14 changed files with 335 additions and 124 deletions.
11 changes: 6 additions & 5 deletions extensions/2.0/Vendor/EXT_mesh_features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -681,18 +681,19 @@ Composite|A glTF containing a 3D mesh (house), a point cloud (tree), and instanc
* Renamed extension from `EXT_feature_metadata` to `EXT_mesh_features`
* Renamed `constant` to `offset`, and `divisor` to `repeat`
* Removed `statistics` specification, to be considered as a future extension
* Renamed `featureTable` `propertyTable` and `featureTexture` `propertyTexture`
* Renamed `featureTable` to `propertyTable` and `featureTexture` to `propertyTexture`
* Removed `featureIdAttributes` and `featureIdTextures`, replaced with `featureIds`
* Removed string ID references to property tables and textures, replaced with integer IDs
* Removed `optional` and `default` and rephrased with properties `noData` and `required`:
* Properties are now assumed to be optional unless `required` is true
* `noData` is used to specify a sentinel value that indicates missing data
* Removed `optional` and added `required`. Properties are now assumed to be optional unless `required` is true.
* Added `noData` for specifying a sentinel value that indicates missing data
* Removed `default`
* Feature ID values outside the range `[0, count - 1]` now indicate "no associated feature"
* `NaN` and `Infinity` are now explicitly disallowed as property values
* Binary alignment, offset, and padding changes:
* Byte offsets for buffer views in a GLB-stored BIN chunk are no longer different from the core glTF specification
* Relaxed buffer view alignment to component size, rather than strict 8-byte boundaries
* Renamed `_FEATURE_ID_#` to `FEATURE_ID_#`
* Added vector and matrix types
* Added vector and matrix types: `VEC2`, `VEC3`, `VEC4`, `MAT2`, `MAT3`, `MAT4`
* Refactored `type` and `componentType` to avoid overlap. Properties that store a single value now have a `type` of `SINGLE` and a `componentType` of the desired type (e.g. `type: "SINGLE", componentType: "UINT8"`)
* Class IDs, enum IDs, and property IDs must now contain only alphanumeric and underscore characters
* Clarified that nodes with GPU instancing cannot reference property textures
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Class property",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "class.property.schema.json",
"title": "Property",
"type": "object",
"description": "A class property.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"properties": {
"name": {
"type": "string",
Expand All @@ -15,41 +21,88 @@
"description": "The description of the property."
},
"type": {
"type": "string",
"enum": [
"SINGLE",
"VEC2",
"VEC3",
"VEC4",
"MAT2",
"MAT3",
"MAT4",
"ARRAY"
],
"description": "Element type represented by each property value. `VECN` is a vector with `N` components. `MATN` is an `N ⨉ N` matrix. `ARRAY` is fixed-length when `componentCount` is defined, and is variable-length otherwise.",
"default": "SINGLE",
"description": "Element type represented by each property value. `VECN` is a vector with `N` components. `MATN` is an `N ⨉ N` matrix. `ARRAY` is fixed-length when `componentCount` is defined, and is variable-length otherwise."
"anyOf": [
{
"const": "SINGLE"
},
{
"const": "VEC2"
},
{
"const": "VEC3"
},
{
"const": "VEC4"
},
{
"const": "MAT2"
},
{
"const": "MAT3"
},
{
"const": "MAT4"
},
{
"const": "ARRAY"
},
{
"type": "string"
}
]
},
"enumType": {
"type": "string",
"description": "Enum ID as declared in the `enums` dictionary. Required when `componentType` is `ENUM`."
},
"componentType": {
"enum": [
"INT8",
"UINT8",
"INT16",
"UINT16",
"INT32",
"UINT32",
"INT64",
"UINT64",
"FLOAT32",
"FLOAT64",
"BOOLEAN",
"STRING",
"ENUM"
],
"description": "Data type of an element's components. When `type` is `SINGLE`, then `componentType` is also the data type of the element. When `componentType` is `ENUM`, `enumType` is required."
"description": "Data type of an element's components. When `type` is `SINGLE`, then `componentType` is also the data type of the element. When `componentType` is `ENUM`, `enumType` is required.",
"anyOf": [
{
"const": "INT8"
},
{
"const": "UINT8"
},
{
"const": "INT16"
},
{
"const": "UINT16"
},
{
"const": "INT32"
},
{
"const": "UINT32"
},
{
"const": "INT64"
},
{
"const": "UINT64"
},
{
"const": "FLOAT32"
},
{
"const": "FLOAT64"
},
{
"const": "BOOLEAN"
},
{
"const": "STRING"
},
{
"const": "ENUM"
},
{
"type": "string"
}
]
},
"componentCount": {
"type": "integer",
Expand All @@ -58,22 +111,38 @@
},
"normalized": {
"type": "boolean",
"description": "Specifies whether integer values are normalized. This applies both when `componentType` is an integer type. For unsigned integer component types, values are normalized between `[0.0, 1.0]`. For signed integer component types, values are normalized between `[-1.0, 1.0]`. For all other component types, this property must be false.",
"description": "Specifies whether integer values are normalized. This applies when `componentType` is an integer type. For unsigned integer component types, values are normalized between `[0.0, 1.0]`. For signed integer component types, values are normalized between `[-1.0, 1.0]`. For all other component types, this property must be false.",
"default": false
},
"max": {
"oneOf": [
{"type": "number"},
{"type": "array", "items": {"type": "number"}, "minItems": 1}
{
"type": "number"
},
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 1
}
],
"description": "Maximum allowed value for the property. Only applicable for single-value numeric types, fixed-length arrays of numeric types, and `VECN` types. For single-value numeric types this is a single number. For fixed-length arrays and `VECN`, the maximum is an array with the same number of elements. The `normalized` property has no effect on the maximum, which always contains integer values."
"description": "Maximum allowed value for the property. Only applicable for single-value numeric types, fixed-length arrays of numeric types, `VECN`, and `MATN` types. For single-value numeric types this is a single number. For fixed-length arrays, `VECN`, and `MATN` types, the maximum is an array with the same number of elements. The `normalized` property has no effect on the maximum, which always contains integer values."
},
"min": {
"oneOf": [
{"type": "number"},
{"type": "array", "items": {"type": "number"}, "minItems": 1}
{
"type": "number"
},
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 1
}
],
"description": "Minimum allowed value for the property. Only applicable for single-value numeric types, fixed-length arrays of numeric types, and `VECN` types. For single-value numeric types this is a single number. For fixed-length arrays and `VECN`, the minimum is an array with the same number of elements. The `normalized` property has no effect on the minimum, which always contains integer values."
"description": "Minimum allowed value for the property. Only applicable for single-value numeric types, fixed-length arrays of numeric types, `VECN`, and `MATN` types. For single-value numeric types this is a single number. For fixed-length arrays, `VECN`, and `MATN` types, the minimum is an array with the same number of elements. The `normalized` property has no effect on the minimum, which always contains integer values."
},
"required": {
"type": "boolean",
Expand All @@ -82,10 +151,26 @@
},
"noData": {
"oneOf": [
{"type": "number"},
{"type": "string"},
{"type": "array", "items": {"type": "number"}, "minItems": 1},
{"type": "array", "items": {"type": "string"}, "minItems": 1}
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 1
},
{
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
],
"description": "A `noData` value represents missing data — also known as a sentinel value — wherever it appears. If omitted (excluding variable-length `ARRAY` properties), property values exist for all features, and the property is required in property tables or textures instantiating the class. For variable-length `ARRAY` elements, `noData` is implicitly `[]` and the property is never required; an additional `noData` array, such as `[\"UNSPECIFIED\"]`, may be provided if necessary. For fixed-length `ARRAY` properties, `noData` must be an array of length `componentCount`. For `VECN` properties, `noData` must be an array of length `N`. For `MATN` propperties, `noData` must be an array of length `N²`. `BOOLEAN` properties may not specify `noData` values. `ENUM` `noData` values must be a valid item name, not an integer value."
},
Expand All @@ -105,4 +190,4 @@
"required": [
"componentType"
]
}
}
10 changes: 8 additions & 2 deletions extensions/2.0/Vendor/EXT_mesh_features/schema/class.schema.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "class.schema.json",
"title": "Class",
"type": "object",
"description": "A class containing a set of properties.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"properties": {
"name": {
"type": "string",
Expand All @@ -25,4 +31,4 @@
"extensions": {},
"extras": {}
}
}
}
52 changes: 38 additions & 14 deletions extensions/2.0/Vendor/EXT_mesh_features/schema/enum.schema.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "enum.schema.json",
"title": "Enum",
"type": "object",
"description": "An object defining the values of an enum.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"properties": {
"name": {
"type": "string",
Expand All @@ -15,19 +21,37 @@
"description": "The description of the enum."
},
"valueType": {
"type": "string",
"default": "UINT16",
"enum": [
"INT8",
"UINT8",
"INT16",
"UINT16",
"INT32",
"UINT32",
"INT64",
"UINT64"
],
"description": "The type of the integer enum value."
"description": "The type of the integer enum value.",
"anyOf": [
{
"const": "INT8"
},
{
"const": "UINT8"
},
{
"const": "INT16"
},
{
"const": "UINT16"
},
{
"const": "INT32"
},
{
"const": "UINT32"
},
{
"const": "INT64"
},
{
"const": "UINT64"
},
{
"type": "string"
}
]
},
"values": {
"type": "array",
Expand All @@ -43,4 +67,4 @@
"required": [
"values"
]
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "enum.value.schema.json",
"title": "Enum value",
"type": "object",
"description": "An enum value.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"properties": {
"name": {
"type": "string",
Expand All @@ -25,4 +31,4 @@
"name",
"value"
]
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Feature IDs",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "featureIdAttribute.schema.json",
"title": "Feature ID Attribute",
"type": "object",
"description": "Feature IDs to be used as indices to property arrays in the property table.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"properties": {
"attribute": {
"type": "integer",
"minimum": 0,
"description": "The name of the attribute containing feature IDs."
"description": "This integer value is used to construct a string in the format `FEATURE_ID_<set index>` which is a reference to a key in `mesh.primitives.attributes` (e.g. a value of `0` corresponds to `FEATURE_ID_0`)."
},
"offset": {
"type": "integer",
Expand Down Expand Up @@ -53,4 +59,4 @@
}
}
]
}
}
Loading

0 comments on commit 270e7ad

Please sign in to comment.