Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore EXT_feature_metadata alongside EXT_mesh_features #23

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,691 changes: 1,691 additions & 0 deletions extensions/2.0/Vendor/EXT_feature_metadata/README.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "EXT_feature_metadata extension for EXT_mesh_gpu_instancing",
"type": "object",
"description": "An object describing per-instance feature IDs to be used as indices to property arrays in the feature table.",
"properties": {
"featureIdAttributes": {
"type": "array",
"description": "An array of objects mapping per-instance feature IDs to property arrays in a feature table.",
"items": {
"$ref": "../featureIdAttribute.schema.json"
},
"minItems": 1
},
"extensions": {},
"extras": {}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Class property",
"type": "object",
"description": "A class property.",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "The name of the property, e.g. for display purposes."
},
"description": {
"type": "string",
"minLength": 1,
"description": "The description of the property."
},
"type": {
"type": "string",
"enum": [
"INT8",
"UINT8",
"INT16",
"UINT16",
"INT32",
"UINT32",
"INT64",
"UINT64",
"FLOAT32",
"FLOAT64",
"BOOLEAN",
"STRING",
"ENUM",
"ARRAY"
],
"description": "The property type. If `ENUM` is used, then `enumType` must also be specified. If `ARRAY` is used, then `componentType` must also be specified. `ARRAY` is a fixed-length array when `componentCount` is defined, and variable-length otherwise."
},
"enumType": {
"type": "string",
"description": "An enum ID as declared in the `enums` dictionary. This value must be specified when `type` or `componentType` is `ENUM`."
},
"componentType": {
"enum": [
"INT8",
"UINT8",
"INT16",
"UINT16",
"INT32",
"UINT32",
"INT64",
"UINT64",
"FLOAT32",
"FLOAT64",
"BOOLEAN",
"STRING",
"ENUM"
],
"description": "When `type` is `ARRAY` this indicates the type of each component of the array. If `ENUM` is used, then `enumType` must also be specified."
},
"componentCount": {
"type": "integer",
"minimum": 2,
"description": "The number of components per element for `ARRAY` elements."
},
"normalized": {
"type": "boolean",
"description": "Specifies whether integer values are normalized. This applies both when `type` is an integer type, or when `type` is `ARRAY` with a `componentType` that is an integer type. For unsigned integer types, values are normalized between `[0.0, 1.0]`. For signed integer types, values are normalized between `[-1.0, 1.0]`. For all other types, this property is ignored.",
"default": false
},
"max": {
"type": [
"number",
"array"
],
"items": {
"type": "number"
},
"description": "Maximum allowed values for property values. Only applicable for numeric types and fixed-length arrays of numeric types. For numeric types this is a single number. For fixed-length arrays this is an array with `componentCount` number of elements. The `normalized` property has no effect on these values: they always correspond to the integer values."
},
"min": {
"type": [
"number",
"array"
],
"items": {
"type": "number"
},
"description": "Minimum allowed values for property values. Only applicable for numeric types and fixed-length arrays of numeric types. For numeric types this is a single number. For fixed-length arrays this is an array with `componentCount` number of elements. The `normalized` property has no effect on these values: they always correspond to the integer values."
},
"default": {
"type": [
"boolean",
"number",
"string",
"array"
],
"description": "A default value to use when the property value is not defined. If used, `optional` must be set to true. The type of the default value must match the property definition: For `BOOLEAN` use `true` or `false`. For `STRING` use a JSON string. For a numeric type use a JSON number. For `ENUM` use the enum `name`, not the integer value. For `ARRAY` use a JSON array containing values matching the `componentType`."
},
"optional": {
"type": "boolean",
"description": "If true, this property is optional.",
"default": false
},
"semantic": {
"type": "string",
"minLength": 1,
"description": "An identifier that describes how this property should be interpreted. The semantic cannot be used by other properties in the class."
},
"extensions": {},
"extras": {}
},
"dependencies": {
"componentCount": [
"componentType"
],
"default": [
"optional"
]
},
"required": [
"type"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Class",
"type": "object",
"description": "A class containing a set of properties.",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "The name of the class, e.g. for display purposes."
},
"description": {
"type": "string",
"minLength": 1,
"description": "The description of the class."
},
"properties": {
"type": "object",
"description": "A dictionary, where each key is a property ID and each value is an object defining the property.",
"minProperties": 1,
"additionalProperties": {
"$ref": "class.property.schema.json"
}
},
"extensions": {},
"extras": {}
}
}
46 changes: 46 additions & 0 deletions extensions/2.0/Vendor/EXT_feature_metadata/schema/enum.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Enum",
"type": "object",
"description": "An object defining the values of an enum.",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "The name of the enum, e.g. for display purposes."
},
"description": {
"type": "string",
"minLength": 1,
"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."
},
"values": {
"type": "array",
"description": "An array of enum values. Duplicate names or duplicate integer values are not allowed.",
"items": {
"$ref": "enum.value.schema.json"
},
"minItems": 1
},
"extensions": {},
"extras": {}
},
"required": [
"values"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Enum value",
"type": "object",
"description": "An enum value.",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "The name of the enum value."
},
"description": {
"type": "string",
"minLength": 1,
"description": "The description of the enum value."
},
"value": {
"type": "integer",
"description": "The integer enum value."
},
"extensions": {},
"extras": {}
},
"required": [
"name",
"value"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Feature IDs",
"type": "object",
"description": "Feature IDs to be used as indices to property arrays in the feature table.",
"properties": {
"attribute": {
"type": "string",
"pattern": "^_FEATURE_ID_([1-9]\\d*|0)$",
"description": "The name of the attribute containing feature IDs."
},
"constant": {
"type": "integer",
"minimum": 0,
"default": 0,
"description": "Sets a constant feature ID when the attribute property is omitted."
},
"divisor": {
"type": "integer",
"minimum": 0,
"default": 0,
"description": "The rate at which feature IDs increment. If `divisor` is 0 then `constant` is used. If `divisor` is non-zero the feature ID increments once per `divisor` sets of elements, starting at `constant`. For example, if `constant` is 0 and `divisor` is 1 the feature IDs are [0, 1, 2, ...]; if `constant` is 2 and `divisor` is 3 the feature IDs are [2, 2, 2, 3, 3, 3, 4, 4, 4, ...]"
},
"extensions": {},
"extras": {}
},
"not": {
"anyOf": [
{
"required": [
"attribute",
"constant"
]
},
{
"required": [
"attribute",
"divisor"
]
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Feature ID Attribute",
"type": "object",
"description": "An object mapping feature IDs to a feature table.",
"properties": {
"featureTable": {
"type": "string",
"description": "The ID of the feature table in the model's root `EXT_feature_metadata.featureTables` dictionary."
},
"featureIds": {
"allOf": [ { "$ref": "featureIdAttribute.featureIds.schema.json" } ],
"description": "An object describing feature IDs to be used as indices to property arrays in the feature table. Feature IDs must be whole numbers in the range `[0, count - 1]` (inclusive), where `count` is the total number of features in the feature table."
},
"extensions": {},
"extras": {}
},
"required": [
"featureTable",
"featureIds"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Feature ID Texture",
"type": "object",
"description": "An object describing a texture used for storing per-texel feature IDs.",
"properties": {
"featureTable": {
"type": "string",
"description": "The ID of the feature table in the model's root `EXT_feature_metadata.featureTables` dictionary."
},
"featureIds": {
"allOf": [ { "$ref": "textureAccessor.schema.json" } ],
"description": "A description of the texture and channel to use for feature IDs. The `channels` property must have a single channel. Furthermore, feature IDs must be whole numbers in the range `[0, count - 1]` (inclusive), where `count` is the total number of features in the feature table. Texel values must be read as integers. Texture filtering should be disabled when fetching feature IDs."
},
"extensions": {},
"extras": {}
},
"required": [
"featureTable",
"featureIds"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Feature Table Property",
"type": "object",
"description": "An array of binary property values.",
"properties": {
"bufferView": {
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The index of the buffer view containing property values. The data type of property values is determined by the property definition: When `type` is `BOOLEAN` values are packed into a bitfield. When `type` is `STRING` values are stored as byte sequences and decoded as UTF-8 strings. When `type` is a numeric type values are stored as the provided `type`. When `type` is `ENUM` values are stored as the enum's `valueType`. Each enum value in the buffer must match one of the allowed values in the enum definition. When `type` is `ARRAY` elements are packed tightly together and the data type is based on the `componentType` following the same rules as above. `arrayOffsetBufferView` is required for variable-size arrays and `stringOffsetBufferView` is required for strings (for variable-length arrays of strings, both are required). The buffer view `byteOffset` must be aligned to a multiple of 8 bytes. If the buffer view's `buffer` is the GLB-stored `BIN` chunk, the byte offset is measured relative to the beginning of the GLB. Otherwise, it is measured relative to the beginning of the buffer."
},
"offsetType": {
"type": "string",
"default": "UINT32",
"enum": [
"UINT8",
"UINT16",
"UINT32",
"UINT64"
],
"description": "The type of values in `arrayOffsetBufferView` and `stringOffsetBufferView`."
},
"arrayOffsetBufferView": {
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The index of the buffer view containing offsets for variable-length arrays. The number of offsets is equal to the feature table `count` plus one. The offsets represent the start positions of each array, with the last offset representing the position after the last array. The array length is computed using the difference between the current offset and the subsequent offset. If `componentType` is `STRING` the offsets index into the string offsets array (stored in `stringOffsetBufferView`), otherwise they index into the property array (stored in `bufferView`). The data type of these offsets is determined by `offsetType`. The buffer view `byteOffset` must be aligned to a multiple of 8 bytes in the same manner as the main `bufferView`"
},
"stringOffsetBufferView": {
"allOf": [ { "$ref": "glTFid.schema.json" } ],
"description": "The index of the buffer view containing offsets for strings. The number of offsets is equal to the number of string components plus one. The offsets represent the byte offsets of each string in the main `bufferView`, with the last offset representing the byte offset after the last string. The string byte length is computed using the difference between the current offset and the subsequent offset. The data type of these offsets is determined by `offsetType`. The buffer view `byteOffset` must be aligned to a multiple of 8 bytes in the same manner as the main `bufferView`."
},
"extensions": {},
"extras": {}
},
"required": [
"bufferView"
]
}
Loading