diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/README.md b/extensions/2.0/Vendor/EXT_structural_metadata/README.md new file mode 100644 index 0000000000..43f4f2a605 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/README.md @@ -0,0 +1,576 @@ + +# EXT_structural_metadata + + +## Contributors + +* Peter Gagliardi, Cesium +* Sean Lilley, Cesium +* Sam Suhag, Cesium +* Don McCurdy, Independent +* Marco Hutter, Cesium +* Bao Tran, Cesium +* Samuel Vargas, Cesium +* Patrick Cozzi, Cesium + + +## Status + +Draft + + +## Dependencies + +Written against the glTF 2.0 specification. + + +## Table of Contents + +- [Overview](#overview) +- [Schema Definitions](#schema-definitions) + - [Overview](#overview-1) + - [Schema](#schema) + - [Class](#class) + - [Class Property](#class-property) + - [Enum](#enum) + - [Enum Value](#enum-value) +- [Metadata Storage](#metadata-storage) + - [Property Tables](#property-tables) + - [Property Attributes](#property-attributes) + - [Property Textures](#property-textures) + - [Binary Data Storage](#binary-data-storage) +- [Assigning Metadata](#assigning-metadata) +- [Optional vs. Required](#optional-vs-required) +- [Schema](#schema-1) +- [Revision History](#revision-history) + +## Overview + +This extension defines a means of storing structured metadata within a glTF 2.0 asset. The key concepts of this extension are the definition of a schema that describes the structure of the metadata, and methods for storing and associating metadata with different entities within the asset. + +The metadata schema definition includes a JSON representation of the schema structure, suitable for being stored inside a glTF asset. The storage formats that are defined in this extension allow storing metadata in standard glTF vertex attributes, or in the channels of a texture. Both representations are compact binary storage formats that are appropriate for efficiently transmitting large quantities of metadata. + +The schema definition and the storage formats in this extension are implementations of the [3D Metadata Specification](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata). This specification should be considered a normative reference for definitions and requirements. This document provides inline definitions of terms where appropriate. + +> **Disambiguation:** glTF has other methods of storing details that could similarly be described as metadata or properties, including [`KHR_xmp_json_ld`](../../Khronos/KHR_xmp_json_ld), Extras, and Extensions. While those methods associate data with discrete objects in a glTF asset — nodes, materials, etc. — `EXT_structural_metadata` is uniquely suited for properties of more granular conceptual features in subregions composed of vertices or texels. + +## Schema Definitions + +#### Overview + +Data types and meanings of properties are provided by a schema, as defined in the [3D Metadata Specification](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata/) and summarized below. + +#### Schema + +*Defined in [schema.schema.json](./schema/schema.schema.json).* + +Top-level definitions for the structure and data types of properties. The schema provides a set of [classes](#class) and [enums](#enum) the asset can reference. + +A schema may be embedded in the extension directly or referenced externally with the `schemaUri` property. Multiple glTF assets may refer to the same external schema to avoid duplication. A schema is defined by an `EXT_structural_metadata` extension attached to the glTF root object. + +> **Example:** A simple schema defining enums and classes. +> +> ```jsonc +> { +> "extensions": { +> "EXT_structural_metadata": { +> "schema": { +> "id": "schema_001", +> "name": "Schema 001", +> "description": "An example schema.", +> "version": "3.5.1", +> "enums": { ... }, +> "classes": { ... } +> } +> } +> } +> } +> ``` + +#### Class + +*Defined in [class.schema.json](./schema/class.schema.json).* + +Template for metadata entities. Classes provide a list of property definitions. Instances of a class can be created from property values that conform to the class's property definitions. + +Classes are defined as entries in the `schema.classes` dictionary, indexed by class ID. Class IDs must be alphanumeric identifiers matching the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`. + +> **Example:** A "Tree" class, which might describe a table of tree measurements taken in a park. Property definitions are abbreviated here, and introduced in the next section. +> +> ```jsonc +> { +> "extensions": { +> "EXT_structural_metadata": { +> "schema": { +> "classes": { +> "tree": { +> "name": "Tree", +> "description": "Woody, perennial plant.", +> "properties": { +> "species": { ... }, +> "age": { ... }, +> "height": { ... }, +> "diameter": { ... } +> } +> } +> } +> } +> } +> } +> } +> ``` + +#### Class Property + +*Defined in [class.property.schema.json](./schema/class.property.schema.json).* + +Class properties are defined abstractly in a class. The class is instantiated with specific values conforming to these properties. Class properties support a richer variety of data types than glTF accessors or GPU shading languages allow. Details about the supported types can be found in the [3D Metadata Specification](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#property). + +Class properties are defined as entries in the `class.properties` dictionary, indexed by property ID. Property IDs must be alphanumeric identifiers matching the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`. + +> **Example:** A "Tree" class, which might describe a table of tree measurements taken in a park. Properties include species, height, and diameter of each tree, as well as the number of birds observed in its branches. +> +> ```jsonc +> { +> "extensions": { +> "EXT_structural_metadata": { +> "schema": { +> "classes": { +> "tree": { +> "name": "Tree", +> "description": "Woody, perennial plant.", +> "properties": { +> "species": { +> "description": "Type of tree.", +> "type": "ENUM", +> "enumType": "speciesEnum", +> "required": true +> }, +> "age": { +> "description": "The age of the tree, in years", +> "type": "SCALAR", +> "componentType": "UINT8", +> "required": true +> }, +> "height": { +> "description": "Height of tree measured from ground level, in meters.", +> "type": "SCALAR", +> "componentType": "FLOAT32" +> }, +> "diameter": { +> "description": "Diameter at trunk base, in meters.", +> "type": "SCALAR", +> "componentType": "FLOAT32" +> } +> } +> } +> } +> } +> } +> } +> } +> ``` + +#### Enum + +*Defined in [enum.schema.json](./schema/enum.schema.json).* + +Set of categorical types, defined as `(name, value)` pairs. Enum properties use an enum as their type. + +Enums are defined as entries in the `schema.enums` dictionary, indexed by an enum ID. Enum IDs must be alphanumeric identifiers matching the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`. + +> **Example:** A "Species" enum defining types of trees. An "Unspecified" enum value is optional, but when provided as the `noData` value for a property (see: [3D Metadata → No Data Values](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#required-properties-no-data-values-and-default-values)) may be helpful to identify missing data. +> +> ```jsonc +> { +> "extensions": { +> "EXT_structural_metadata": { +> "schema": { +> "enums": { +> "speciesEnum": { +> "name": "Species", +> "description": "An example enum for tree species.", +> "values": [ +> {"name": "Unspecified", "value": 0}, +> {"name": "Oak", "value": 1}, +> {"name": "Pine", "value": 2}, +> {"name": "Maple", "value": 3} +> ] +> } +> } +> } +> } +> } +> } +> ``` + +#### Enum Value + +*Defined in [enum.value.schema.json](./schema/enum.value.schema.json).* + +Pairs of `(name, value)` entries representing possible values of an enum property. + +Enum values are defined as entries in the `enum.values` array. Duplicate names or duplicate integer values are not allowed. + + +## Metadata Storage + +The classes defined in the schema are templates describing the data types and meanings of properties. An instance of such a metadata class is referred to as a _metadata entity_, and can be created from a set of values that conform to the structure of the class. This extension defines different ways of storing large amounts of property values inside a glTF asset, in compact binary forms: + +- **Property Tables** store property values as parallel arrays in a column-based binary layout, using standard glTF buffer views. These tables can be accessed with a row index, and allow associating complex, structured metadata with arbitrary types with entities of a glTF asset on different levels of granularity. +- **Property Attributes** associate vertex attributes of a mesh primitive with a particular metadata class. +- **Property Textures** store property values in channels of a texture, suitable for very high-frequency data mapped to less-detailed 3D surfaces. + +Each storage type refers to a metadata class, and contains a dictionary of `properties`. Each of these properties corresponds to one property of the metadata class and defines how the actual property data is stored. These property storage definitions may override the [`minimum` and `maximum` values](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#minimum-and-maximum-values) and the [`offset` and `scale`](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#offset-and-scale) from the property definition in the class, to account for the actual range of values that is stored for each property. + +The following sections describe these storage formats in more detail. + +### Property Tables + +*Defined in [propertyTable.schema.json](./schema/propertyTable.schema.json).* + +Each property table defines a specified number (`count`) of metadata entities conforming to a particular class (`class`), with property values stored as parallel arrays in a column-based binary layout. Property tables support a richer variety of data types than glTF accessors or GPU shading languages allow, and are suitable for datasets that can be expressed in a tabular layout. + +Property tables are defined as entries in the `propertyTables` array of the root-level `EXT_structural_metadata` extension, and may be referenced by [assigning metadata](#assigning-metadata) to glTF elements, or by other extensions. + +The property table may provide value arrays for only a subset of the properties of its class, but class properties marked `required: true` must not be omitted. Each property value array given by the property table must be defined by a class property with the same alphanumeric property ID, with values matching the data type of the class property. + +> **Example:** A `tree_survey_2021-09-29` property table, implementing the `tree` class defined in earlier examples. The table contains observations for 10 trees, with each property defined by a buffer view containing 10 values. +> +> The glTF asset contains multiple objects (trees) that are associated with unique identifiers. These identifiers can be assigned to the objects in different ways. For example, using the [`EXT_mesh_features`](../EXT_mesh_features) extension, the [`EXT_instance_features`](../EXT_instance_features) extension, or an application-specific mechanism for identifying the objects. The identifiers then serve as an index into the property table row that stores the property values for the properties that are defined in the `tree` class. +> +> > ![Property Table](figures/property-table.png) +> +> +> ```jsonc +> { +> "extensions": { +> "EXT_structural_metadata": { +> "schema": { ... }, +> "propertyTables": [{ +> "name": "tree_survey_2021-09-29", +> "class": "tree", +> "count": 10, +> "properties": { +> "species": { +> "values": 0, +> }, +> "age": { +> "values": 1 +> }, +> "height": { +> "values": 2 +> }, +> // "diameter" is not required and has been omitted from this table. +> } +> }] +> } +> } +> } +> ``` + +Property arrays are stored in glTF buffer views and use the binary encoding defined in the [Binary Table Format](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#binary-table-format) section of the [3D Metadata Specification](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata). + +As in the core glTF specification, values of `NaN`, `+Infinity`, and `-Infinity` are never allowed. + +Each buffer view `byteOffset` must be aligned to a multiple of its component size. + +> **Implementation note:** Authoring tools may choose to align all buffer views to 8-byte boundaries for consistency, but client implementations should only depend on 8-byte alignment for buffer views containing 64-bit component types. + +### Property Attributes + +*Defined in [propertyAttribute.schema.json](./schema/propertyAttribute.schema.json).* + +Property attributes associate vertex attributes of a mesh primitive with a metadata class. They refer to a certain class from the schema definition via their `class` property, and contain a `properties` dictionary that defines a set of properties that conform to this class. Each property refers to an attribute that may be stored in a mesh primitive. + +The property types that are supported via property attributes are therefore restricted to the types that are supported by standard glTF accessors. These types are a strict subset of the types that are supported with the schema definitions in this extension. + +> **Example:** +> +> An example of a property attribute that represents information about the movement of points in a point cloud. +> +> The schema defines a class called `movement`. It has a `direction` property that is a normalized 3D float vector for the movement direction, and a `magnitude` property that describes the magnitude of the movement. +> +> The top-level `propertyAttributes` array contains a property attribute that refers to this class. The `movement` and `direction` properties of the class are associated with attributes called `_DIRECTION` and `_MAGNITUDE`. +> +> The mesh primitive defines (non-indexed) vertices with primitive mode 0, and thus, represents a simple point cloud, with the positions of the points being stored in the `POSITION` attribute. Additionally, it defines vertex attributes `_DIRECTION` and `_MAGNITUDE`, which contain the data for the properties from the property attribute. +> +> ![Property Attribute](figures/property-attribute.png) +> +> _Top-level extension object:_ +> ```jsonc +> { +> "extensions": { +> "EXT_structural_metadata": { +> "schema": { +> "classes": { +> "movement": { +> "name": "movement", +> "description": "The movement of points in a point cloud", +> "properties": { +> "direction": { +> "description": "The movement direction, as a normalized 3D vector", +> "type": "VEC3", +> "componentType": "FLOAT32", +> "required": true +> }, +> "magnitude": { +> "description": "The magnitude of the movement", +> "type": "SCALAR", +> "componentType": "FLOAT32", +> "required": true +> } +> } +> } +> } +> }, +> "propertyAttributes": [{ +> "class": "movement", +> "properties": { +> "direction": { +> "attribute": "_DIRECTION", +> }, +> "magnitude": { +> "attribute": "_MAGNITUDE", +> } +> } +> }] +> } +> } +> } +> ``` +> _Primitive_ +> +> ```jsonc +> { +> "primitives": [ +> { +> "mode:": 0, +> "attributes": { +> "POSITION": 0, +> "_DIRECTION": 1, +> "_MAGNITUDE": 2, +> }, +> "extensions": { +> "EXT_structural_metadata": { +> "propertyAttributes": [0] +> } +> } +> } +> ] +> } +> ``` + + +### Property Textures + +*Defined in [propertyTexture.schema.json](./schema/propertyTexture.schema.json).* + +Property textures use texture channels to store property values conforming to a particular class (identified by ID `class`), with those values accessed directly by texture coordinates. Property textures are especially useful when texture mapping high frequency data to less detailed 3D surfaces. Unlike textures used in glTF materials, property textures are not necessarily visible in a rendered scene. Like property tables, property textures are implementations of the [3D Metadata Specification](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata). + +Property textures are defined as entries in the `propertyTextures` array of the root-level `EXT_structural_metadata` extension, and may be referenced by extensions on primitive objects. + +A property texture may provide channels for only a subset of the properties of its class, but class properties marked `required: true` must not be omitted. + +> **Example:** Property texture implementing a "wall" class, with property values stored in a glTF texture at index 0 and indexed by `TEXCOORD_0`. Each property of the `"wall"` class is stored in one channel of the texture. +> +> ![Property Texture](figures/property-texture.png) +> +> _Class and property texture_ +> +> ```jsonc +> { +> "extensions": { +> "EXT_structural_metadata": { +> "schema": { +> "classes": { +> "wall": { +> "name": "Wall Temperature vs. Insulation", +> "properties": { +> "insideTemperature": { +> "name": "Inside Temperature", +> "type": "SCALAR", +> "componentType": "UINT8" +> }, +> "outsideTemperature": { +> "name": "Outside Temperature", +> "type": "SCALAR", +> "componentType": "UINT8" +> }, +> "insulation": { +> "name": "Insulation Thickness", +> "type": "SCALAR", +> "componentType": "UINT8", +> "normalized": true +> } +> } +> } +> } +> }, +> "propertyTextures": [ +> { +> "class": "wall", +> "properties": { +> "insideTemperature": { +> "index": 0, +> "texCoord": 0, +> "channels": [0] +> }, +> "outsideTemperature": { +> "index": 0, +> "texCoord": 0, +> "channels": [1] +> }, +> "insulation": { +> "index": 0, +> "texCoord": 0, +> "channels": [2] +> } +> } +> } +> ] +> } +> } +> } +> ``` +> +> _Primitive_ +> +> ```jsonc +> { +> "primitives": [ +> { +> "attributes": { +> "POSITION": 0, +> "TEXCOORD_0": 1 +> }, +> "indices": 2, +> "material": 0, +> "extensions": { +> "EXT_structural_metadata": { +> "propertyTextures": [0] +> } +> } +> } +> ] +> } +> ``` + +Each property that is defined in the `propertyTexture` object extends the glTF [`textureInfo`](../../../../specification/2.0/schema/textureInfo.schema.json) object. The `texCoord` specifies a texture coordinate set in the referring primitive. The `index` is the index of the glTF texture object that stores the actual data. Additionally, each property specifies an array of `channels`, which are the indices of the texture channels providing data for the respective property. Channels of an `RGBA` texture are numbered 0–3 respectively. + +Texture filtering must be `9728` (NEAREST), `9729` (LINEAR), or undefined, for any texture object referenced as a property texture. Texture values must be encoded with a linear transfer function. + +> **Example:** A property texture for 2D wind velocity samples. The "speed" property values are stored in the red channel. The "direction" property values are stored as a unit-length vector, with X/Y components in the green and blue channels. Both properties are indexed by UV coordinates in a `TEXCOORD_0` attribute. +> +> ```jsonc +> // Root EXT_structural_metadata extension: +> { +> "propertyTextures": [ +> { +> "class": "wind", +> "properties": { +> "speed": { +> "index": 0, +> "texCoord": 0, +> "channels": [0] +> }, +> "direction": { +> "index": 0, +> "texCoord": 0, +> "channels": [1, 2] +> } +> } +> } +> ] +> } + + +#### Property Texture Data Storage + +Multiple channels of a property texture can be used to represent individual bytes of larger data types. The values from the selected channels represent the bytes of the actual property value, in little-endian order. + +> **Implementation note:** Specialized texture formats may allow additional channels, or channels with a higher number of bits per channel. The usage of such texture formats for property textures has to be defined by additional extensions. + +Certain property types cannot be encoded in property textures. For example, variable-length arrays or strings are not supported. Enum values may be encoded as integer values according to their enum value type (see [Enum](#enum)). For other property types, the number of channels that are selected must match the number of bytes of the property type. + +> **Example:** +> +> If a property is defined to store (single) `FLOAT32` components, then these values can be stored in the 4 channels of a property texture. The raw bits of the property value can be computed as +> ``` +> vec4 rgba = texture(sampler, coordinates); +> uint8 byte0 = rgba[channels[0]]; +> uint8 byte1 = rgba[channels[1]]; +> uint8 byte2 = rgba[channels[2]]; +> uint8 byte3 = rgba[channels[3]]; +> uint32 rawBits = byte0 | (byte1 << 8) | (byte2 << 16) | (byte3 << 24); +> float32 value = uintBitsToFloat(rawBits); +> ``` +> +> If a property has the type `VEC2` with `UIN16` components, or an array with a fixed length of 2 and `UINT16` components, then the respective property can be represented with 4 channels as well: +> ``` +> vec4 rgba = texture(sampler, coordinates); +> uint8 byte0 = rgba[channels[0]]; +> uint8 byte1 = rgba[channels[1]]; +> uint8 byte2 = rgba[channels[2]]; +> uint8 byte3 = rgba[channels[3]]; +> value[0] = byte0 | (byte1 << 8); +> value[1] = byte2 | (byte3 << 8); +> ``` + +### Binary Data Storage + +Property values are stored in a compact binary tabular format described in the [3D Metadata Specification](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata), with each property table array occupying a glTF buffer view. `EXT_structural_metadata` imposes 8-byte binary data alignment requirements on an asset, allowing support for 64-bit data types while remaining compatible with the 4-byte alignments in the core glTF specification: + +- GLB-stored `JSON` chunk must be padded with trailing `Space` characters (`0x20`) to 8-byte boundary. +- GLB-stored `BIN` chunk must be padded with trailing zeroes (`0x00`) to 8-byte boundary. + +As a result, byte length of the `BIN` chunk may be up to 7 bytes larger than JSON-defined `buffer.byteLength` to satisfy alignment requirements. + +## Assigning Metadata to glTF objects + +*Defined in [EXT_structural_metadata.schema.json](./schema/EXT_structural_metadata.schema.json).* + +Each glTF object can contain an `EXT_structural_metadata` object that defines the metadata values for that object. It contains the name of the class that it is an instance of, as well as a dictionary of property values that correspond to the properties of that class. Each property value assigned shall be defined by a class property with the same property ID, with values matching the data type of the class property. The extension object may provide values for only a subset of the properties of its class, but class properties marked `required: true` shall not be omitted. + +> **Example:** +> +> An example of metadata that is assigned to a node. +> +> ```jsonc +> { +> "extensions": { +> "EXT_structural_metadata": { +> "schema": { ... }, +> } +> }, +> "nodes": [ +> ... +> { +> "name": "A node with metadata", +> "extensions": { +> "EXT_structural_metadata": { +> "class": "building", +> "properties": { +> "height": 16.8, +> "owners": [ "John Doe", "Jane Doe" ], +> "buildingType": "Residential" +> } +> } +> } +> } +> ] +> } +> ``` + +## Optional vs. Required + +This extension is optional, meaning it should be placed in the `extensionsUsed` list, but not in the `extensionsRequired` list. + +## Schema + +* [glTF.EXT_structural_metadata.schema.json](./schema/glTF.EXT_structural_metadata.schema.json) +* [mesh.primitive.EXT_structural_metadata.schema.json](./schema/mesh.primitive.EXT_structural_metadata.schema.json) + +## Revision History + +The revision history of this extension can be found in the [common revision history of the 3D Tiles Next extensions](https://github.com/CesiumGS/3d-tiles/blob/main/next/REVISION_HISTORY.md). diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-attribute.png b/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-attribute.png new file mode 100644 index 0000000000..47de4b0abb Binary files /dev/null and b/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-attribute.png differ diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-attribute.svg b/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-attribute.svg new file mode 100644 index 0000000000..24f9403631 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-attribute.svg @@ -0,0 +1,474 @@ + + + + + + + + + + POSITION + _DIRECTION + _MAGNITUDE + + + + + ( 0.59,-0.16, -0.80),( 0.30, 0.69, 0.66),(0.98, 0.14, -0.13), ... + + + + + 0.538, 2.011, 1.319, ... + Magnitude + + + + + (1.3, 8.3, 2.4 ),(5.5, 4.2, 6.0 ),(2.1, 1.1, 9.8 ), ... + Metadata stored for each point: + Metadata storage in vertex attribute accessors: + Point cloud: + + + + + + + 0 + + + 1 + + + + + + ... + + ... + + ... + + ... + 2 + + + + + + Position + Direction + + diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-table.png b/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-table.png new file mode 100644 index 0000000000..f0dc4de4c2 Binary files /dev/null and b/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-table.png differ diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-table.svg b/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-table.svg new file mode 100644 index 0000000000..a3e3d1a783 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-table.svg @@ -0,0 +1,1501 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ID: + 0 + 1 + 2 + 3 + 4 + 5 + ... + + + + + + + + 0 + 1 + 2 + + + ID + + + + "Oak" + + species + "Pine" + "Maple" + age + + + + + height + + + + + diameter + 8.1 + - + - + - + 19 + 34 + 22 + 11.7 + 9.3 + + + + + + + 3 + 4 + 5 + + + + "Pine" + "Pine" + "Oak" + + ... + + ... + + ... + + + + + ... + + + + + 7.4 + - + - + - + - + 38 + 29 + 43 + 9.1 + 13.3 + + + + diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-texture.png b/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-texture.png new file mode 100644 index 0000000000..db8958212b Binary files /dev/null and b/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-texture.png differ diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-texture.svg b/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-texture.svg new file mode 100644 index 0000000000..85f39e6d50 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/figures/property-texture.svg @@ -0,0 +1,1987 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Property texture + Property texture channelsRed: Inside TemperatureGreen: Outside TemperatureBlue: Insulation Thickness + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside Temperature:Outside Temperature:Insulatation Thickness: + 22180.2 + + + + + diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/EXT_structural_metadata.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/EXT_structural_metadata.schema.json new file mode 100644 index 0000000000..297f1b4e27 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/EXT_structural_metadata.schema.json @@ -0,0 +1,28 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "EXT_structural_metadata.schema.json", + "title": "EXT_structural_metadata glTF extension", + "type": "object", + "description": "Structural metadata about a glTF element.", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "properties": { + "class": { + "type": "string", + "description": "The class that property values conform to. The value shall be a class ID declared in the `classes` dictionary of the metadata schema." + }, + "properties": { + "type": "object", + "description": "A dictionary, where each key corresponds to a property ID in the class' `properties` dictionary and each value contains the property values. The type of the value shall match the property definition: For `BOOLEAN` use `true` or `false`. For `STRING` use a JSON string. For numeric types use a JSON number. For `ENUM` use a valid enum `name`, not an integer value. For `ARRAY`, `VECN`, and `MATN` types use a JSON array containing values matching the `componentType`. Required properties shall be included in this dictionary.", + "minProperties": 1, + "additionalProperties": { + "$ref": "definitions.schema.json#/definitions/anyValue" + } + }, + "extensions": {}, + "extras": {} + } +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/class.property.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/class.property.schema.json new file mode 100644 index 0000000000..aea17c8ef3 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/class.property.schema.json @@ -0,0 +1,182 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "class.property.schema.json", + "title": "Class Property in EXT_structural_metadata", + "type": "object", + "description": "A class property.", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "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": { + "description": "The element type.", + "anyOf": [ + { + "const": "SCALAR" + }, + { + "const": "VEC2" + }, + { + "const": "VEC3" + }, + { + "const": "VEC4" + }, + { + "const": "MAT2" + }, + { + "const": "MAT3" + }, + { + "const": "MAT4" + }, + { + "const": "STRING" + }, + { + "const": "BOOLEAN" + }, + { + "const": "ENUM" + }, + { + "type": "string" + } + ] + }, + "componentType": { + "description": "The datatype of the element's components. Only applicable to `SCALAR`, `VECN`, and `MATN` types.", + "anyOf": [ + { + "const": "INT8" + }, + { + "const": "UINT8" + }, + { + "const": "INT16" + }, + { + "const": "UINT16" + }, + { + "const": "INT32" + }, + { + "const": "UINT32" + }, + { + "const": "INT64" + }, + { + "const": "UINT64" + }, + { + "const": "FLOAT32" + }, + { + "const": "FLOAT64" + }, + { + "type": "string" + } + ] + }, + "enumType": { + "type": "string", + "description": "Enum ID as declared in the `enums` dictionary. Required when `type` is `ENUM`." + }, + "array": { + "type": "boolean", + "default": false, + "description": "Whether the property is an array. When `count` is defined the property is a fixed-length array. Otherwise the property is a variable-length array." + }, + "count": { + "type": "integer", + "minimum": 2, + "description": "The number of array elements. May only be defined when `array` is true." + }, + "normalized": { + "type": "boolean", + "description": "Specifies whether integer values are normalized. Only applicable to `SCALAR`, `VECN`, and `MATN` types with integer component types. 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 + }, + "offset": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "An offset to apply to property values. Only applicable to `SCALAR`, `VECN`, and `MATN` types when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`." + }, + "scale": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "A scale to apply to property values. Only applicable to `SCALAR`, `VECN`, and `MATN` types when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`." + }, + "max": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "Maximum allowed value for the property. Only applicable to `SCALAR`, `VECN`, and `MATN` types. This is the maximum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied." + }, + "min": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "Minimum allowed value for the property. Only applicable to `SCALAR`, `VECN`, and `MATN` types. This is the minimum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied." + }, + "required": { + "type": "boolean", + "description": "If required, the property must be present in every entity conforming to the class. If not required, individual entities may include `noData` values, or the entire property may be omitted. As a result, `noData` has no effect on a required property. Client implementations may use required properties to make performance optimizations.", + "default": false + }, + "noData": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/noDataValue" + } + ], + "description": "A `noData` value represents missing data — also known as a sentinel value — wherever it appears. `BOOLEAN` properties may not specify `noData` values. This is given as the plain property value, without the transforms from the `normalized`, `offset`, and `scale` properties. Must not be defined if `required` is true." + }, + "default": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/anyValue" + } + ], + "description": "A default value to use when encountering a `noData` value or an omitted property. The value is given in its final form, taking the effect of `normalized`, `offset`, and `scale` properties into account. Must not be defined if `required` is true." + }, + "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": {} + }, + "required": [ + "type" + ] +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/class.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/class.schema.json new file mode 100644 index 0000000000..a7c98cdc08 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/class.schema.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "class.schema.json", + "title": "Class in EXT_structural_metadata", + "type": "object", + "description": "A class containing a set of properties.", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "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. Property IDs must be alphanumeric identifiers matching the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`.", + "minProperties": 1, + "additionalProperties": { + "$ref": "class.property.schema.json" + } + }, + "extensions": {}, + "extras": {} + } +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/definitions.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/definitions.schema.json new file mode 100644 index 0000000000..63a74b8f6b --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/definitions.schema.json @@ -0,0 +1,119 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "definitions.schema.json", + "title": "Definitions", + "description": "Common definitions used in schema files.", + "definitions": { + "numericValue": { + "title": "Numeric Value", + "oneOf": [ + { + "type": "number" + }, + { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 1 + }, + { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 1 + }, + "minItems": 1 + } + ], + "description": "For `SCALAR` this is a number. For `VECN` this is an array of `N` numbers. For `MATN` this is an array of `N²` numbers. For fixed-length arrays this is an array of `count` elements of the given `type`." + }, + "noDataValue": { + "title": "No Data Value", + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 1 + }, + { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 1 + }, + "minItems": 1 + } + ], + "description": "For `SCALAR` this is a number. For `STRING` this is a string. For `ENUM` this is a string that must be a valid enum `name`, not an integer value. For `VECN` this is an array of `N` numbers. For `MATN` this is an array of `N²` numbers. For fixed-length arrays this is an array of `count` elements of the given `type`." + }, + "anyValue": { + "title": "Any Value", + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 1 + }, + { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + { + "type": "array", + "items": { + "type": "boolean" + }, + "minItems": 1 + }, + { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 1 + }, + "minItems": 1 + } + ], + "description": "For `SCALAR` this is a number. For `STRING` this is a string. For `ENUM` this is a string that must be a valid enum `name`, not an integer value. For `BOOLEAN` this is a boolean. For `VECN` this is an array of `N` numbers. For `MATN` this is an array of `N²` numbers. For fixed-length array this is an array of `count` elements of the given `type`. For variable-length arrays this is an array of any length of the given `type`." + } + } +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/enum.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/enum.schema.json new file mode 100644 index 0000000000..5f78f75dd4 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/enum.schema.json @@ -0,0 +1,70 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "enum.schema.json", + "title": "Enum in EXT_structural_metadata", + "type": "object", + "description": "An object defining the values of an enum.", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "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": { + "default": "UINT16", + "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", + "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" + ] +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/enum.value.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/enum.value.schema.json new file mode 100644 index 0000000000..b84c5f2b43 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/enum.value.schema.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "enum.value.schema.json", + "title": "Enum Value in EXT_structural_metadata", + "type": "object", + "description": "An enum value.", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "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" + ] +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/glTF.EXT_structural_metadata.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/glTF.EXT_structural_metadata.schema.json new file mode 100644 index 0000000000..e33b1edb32 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/glTF.EXT_structural_metadata.schema.json @@ -0,0 +1,71 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "glTF.EXT_structural_metadata.schema.json", + "title": "EXT_structural_metadata glTF Document extension", + "type": "object", + "description": "glTF extension that provides structural metadata about vertices, texels, and features in a glTF asset.", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "properties": { + "schema": { + "allOf": [ + { + "$ref": "schema.schema.json" + } + ], + "description": "An object defining classes and enums." + }, + "schemaUri": { + "type": "string", + "description": "The URI (or IRI) of the external schema file.", + "format": "iri-reference" + }, + "propertyTables": { + "type": "array", + "description": "An array of property table definitions, which may be referenced by index.", + "minItems": 1, + "items": { + "$ref": "propertyTable.schema.json" + } + }, + "propertyTextures": { + "type": "array", + "description": "An array of property texture definitions, which may be referenced by index.", + "minItems": 1, + "items": { + "$ref": "propertyTexture.schema.json" + } + }, + "propertyAttributes": { + "type": "array", + "description": "An array of property attribute definitions, which may be referenced by index.", + "minItems": 1, + "items": { + "$ref": "propertyAttribute.schema.json" + } + }, + "extensions": {}, + "extras": {} + }, + "oneOf": [ + { + "description": "External schema, if any.", + "not": { + "required": [ + "schema" + ] + } + }, + { + "description": "Internal schema, if any.", + "not": { + "required": [ + "schemaUri" + ] + } + } + ] +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/mesh.primitive.EXT_structural_metadata.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/mesh.primitive.EXT_structural_metadata.schema.json new file mode 100644 index 0000000000..673f4fb5b7 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/mesh.primitive.EXT_structural_metadata.schema.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "mesh.primitive.EXT_structural_metadata.schema.json", + "title": "EXT_structural_metadata glTF Mesh Primitive extension", + "type": "object", + "description": "Structural metadata about a glTF primitive.", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "properties": { + "propertyTextures": { + "type": "array", + "description": "An array of indexes of property textures in the root `EXT_structural_metadata` object.", + "minItems": 1, + "items": { + "allOf": [ { "$ref": "glTFid.schema.json" } ] + } + }, + "propertyAttributes": { + "type": "array", + "description": "An array of indexes of property attributes in the root `EXT_structural_metadata` object.", + "minItems": 1, + "items": { + "allOf": [ { "$ref": "glTFid.schema.json" } ] + } + }, + "extensions": {}, + "extras": {} + } +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyAttribute.property.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyAttribute.property.schema.json new file mode 100644 index 0000000000..418963f3cd --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyAttribute.property.schema.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "propertyAttribute.property.schema.json", + "title": "Property Attribute Property in EXT_structural_metadata", + "type": "object", + "description": "An attribute containing property values.", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "properties": { + "attribute": { + "type": "string", + "description": "The name of the attribute containing property values." + }, + "offset": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "An offset to apply to property values. Only applicable when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`. Overrides the class property's `offset` if both are defined." + }, + "scale": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "A scale to apply to property values. Only applicable when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`. Overrides the class property's `scale` if both are defined." + }, + "max": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "Maximum value present in the property values. Only applicable to `SCALAR`, `VECN`, and `MATN` types. This is the maximum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied." + }, + "min": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "Minimum value present in the property values. Only applicable to `SCALAR`, `VECN`, and `MATN` types. This is the minimum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied." + }, + "extensions": {}, + "extras": {} + }, + "required": [ + "attribute" + ] +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyAttribute.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyAttribute.schema.json new file mode 100644 index 0000000000..2ce472d8dd --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyAttribute.schema.json @@ -0,0 +1,36 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "propertyAttribute.schema.json", + "title": "Property Attribute in EXT_structural_metadata", + "type": "object", + "description": "Properties conforming to a class, organized as property values stored in attributes.", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "The name of the property attribute, e.g. for display purposes." + }, + "class": { + "type": "string", + "description": "The class that property values conform to. The value must be a class ID declared in the `classes` dictionary." + }, + "properties": { + "type": "object", + "description": "A dictionary, where each key corresponds to a property ID in the class' `properties` dictionary and each value is an object describing where property values are stored. Required properties must be included in this dictionary.", + "minProperties": 1, + "additionalProperties": { + "$ref": "propertyAttribute.property.schema.json" + } + }, + "extensions": {}, + "extras": {} + }, + "required": [ + "class" + ] +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTable.property.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTable.property.schema.json new file mode 100644 index 0000000000..ad13da27c6 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTable.property.schema.json @@ -0,0 +1,117 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "propertyTable.property.schema.json", + "title": "Property Table Property in EXT_structural_metadata", + "type": "object", + "description": "An array of binary property values.", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "properties": { + "values": { + "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 bitstream. When `type` is `STRING` values are stored as byte sequences and decoded as UTF-8 strings. When `type` is `SCALAR`, `VECN`, or `MATN` the values are stored as the provided `componentType` and the buffer view `byteOffset` must be aligned to a multiple of the `componentType` size. When `type` is `ENUM` values are stored as the enum's `valueType` and the buffer view `byteOffset` must be aligned to a multiple of the `valueType` size. Each enum value in the array must match one of the allowed values in the enum definition. `arrayOffsets` is required for variable-length arrays and `stringOffsets` is required for strings (for variable-length arrays of strings, both are required)." + }, + "arrayOffsets": { + "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 property 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 subsequent offset and the current offset. If `type` is `STRING` the offsets index into the string offsets array (stored in `stringOffsets`), otherwise they index into the property array (stored in `values`). The data type of these offsets is determined by `arrayOffsetType`. The buffer view `byteOffset` must be aligned to a multiple of the `arrayOffsetType` size." + }, + "stringOffsets": { + "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 elements plus one. The offsets represent the byte offsets of each string in the property array (stored in `values`), with the last offset representing the byte offset after the last string. The string byte length is computed using the difference between the subsequent offset and the current offset. The data type of these offsets is determined by `stringOffsetType`. The buffer view `byteOffset` must be aligned to a multiple of the `stringOffsetType` size." + }, + "arrayOffsetType": { + "description": "The type of values in `arrayOffsets`.", + "default": "UINT32", + "anyOf": [ + { + "const": "UINT8" + }, + { + "const": "UINT16" + }, + { + "const": "UINT32" + }, + { + "const": "UINT64" + }, + { + "type": "string" + } + ] + }, + "stringOffsetType": { + "description": "The type of values in `stringOffsets`.", + "default": "UINT32", + "anyOf": [ + { + "const": "UINT8" + }, + { + "const": "UINT16" + }, + { + "const": "UINT32" + }, + { + "const": "UINT64" + }, + { + "type": "string" + } + ] + }, + "offset": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "An offset to apply to property values. Only applicable when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`. Overrides the class property's `offset` if both are defined." + }, + "scale": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "A scale to apply to property values. Only applicable when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`. Overrides the class property's `scale` if both are defined." + }, + "max": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "Maximum value present in the property values. Only applicable to `SCALAR`, `VECN`, and `MATN` types. This is the maximum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied." + }, + "min": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "Minimum value present in the property values. Only applicable to `SCALAR`, `VECN`, and `MATN` types. This is the minimum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied." + }, + "extensions": {}, + "extras": {} + }, + "required": [ + "values" + ] +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTable.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTable.schema.json new file mode 100644 index 0000000000..e4a8e0d23b --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTable.schema.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "propertyTable.schema.json", + "title": "Property Table in EXT_structural_metadata", + "type": "object", + "description": "Properties conforming to a class, organized as property values stored in binary columnar arrays.", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "The name of the property table, e.g. for display purposes." + }, + "class": { + "type": "string", + "description": "The class that property values conform to. The value must be a class ID declared in the `classes` dictionary." + }, + "count": { + "type": "integer", + "minimum": 1, + "description": "The number of elements in each property array." + }, + "properties": { + "type": "object", + "description": "A dictionary, where each key corresponds to a property ID in the class' `properties` dictionary and each value is an object describing where property values are stored. Required properties must be included in this dictionary.", + "minProperties": 1, + "additionalProperties": { + "$ref": "propertyTable.property.schema.json" + } + }, + "extensions": {}, + "extras": {} + }, + "required": [ + "class", + "count" + ] +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTexture.property.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTexture.property.schema.json new file mode 100644 index 0000000000..45af22d2a1 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTexture.property.schema.json @@ -0,0 +1,62 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "propertyTexture.schema.json", + "title": "Property Texture Property in EXT_structural_metadata", + "type": "object", + "description": "A texture containing property values.", + "allOf": [ + { + "$ref": "textureInfo.schema.json" + } + ], + "properties": { + "channels": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + }, + "minItems": 1, + "description": "Texture channels containing property values, identified by index. The values may be packed into multiple channels if a single channel does not have sufficient bit depth. The values are packed in little-endian order.", + "default": [ + 0 + ] + }, + "offset": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "An offset to apply to property values. Only applicable when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`. Overrides the class property's `offset` if both are defined." + }, + "scale": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "A scale to apply to property values. Only applicable when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`. Overrides the class property's `scale` if both are defined." + }, + "max": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "Maximum value present in the property values. Only applicable to `SCALAR`, `VECN`, and `MATN` types. This is the maximum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied." + }, + "min": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/numericValue" + } + ], + "description": "Minimum value present in the property values. Only applicable to `SCALAR`, `VECN`, and `MATN` types. This is the minimum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied." + }, + "index": {}, + "texCoord": {}, + "extensions": {}, + "extras": {} + } +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTexture.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTexture.schema.json new file mode 100644 index 0000000000..21e260d95d --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTexture.schema.json @@ -0,0 +1,36 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "propertyTexture.schema.json", + "title": "Property Texture in EXT_structural_metadata", + "type": "object", + "description": "Properties conforming to a class, organized as property values stored in textures.", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "The name of the property texture, e.g. for display purposes." + }, + "class": { + "type": "string", + "description": "The class that property values conform to. The value must be a class ID declared in the `classes` dictionary." + }, + "properties": { + "type": "object", + "description": "A dictionary, where each key corresponds to a property ID in the class' `properties` dictionary and each value is an object describing where property values are stored. Required properties must be included in this dictionary.", + "minProperties": 1, + "additionalProperties": { + "$ref": "propertyTexture.property.schema.json" + } + }, + "extensions": {}, + "extras": {} + }, + "required": [ + "class" + ] +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_structural_metadata/schema/schema.schema.json b/extensions/2.0/Vendor/EXT_structural_metadata/schema/schema.schema.json new file mode 100644 index 0000000000..6c615803e1 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_structural_metadata/schema/schema.schema.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "schema.schema.json", + "title": "Schema in EXT_structural_metadata", + "type": "object", + "description": "An object defining classes and enums.", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "properties": { + "id": { + "type": "string", + "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$", + "description": "Unique identifier for the schema. Schema IDs must be alphanumeric identifiers matching the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`." + }, + "name": { + "type": "string", + "minLength": 1, + "description": "The name of the schema, e.g. for display purposes." + }, + "description": { + "type": "string", + "minLength": 1, + "description": "The description of the schema." + }, + "version": { + "type": "string", + "minLength": 1, + "description": "Application-specific version of the schema." + }, + "classes": { + "type": "object", + "description": "A dictionary, where each key is a class ID and each value is an object defining the class. Class IDs must be alphanumeric identifiers matching the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`.", + "minProperties": 1, + "additionalProperties": { + "$ref": "class.schema.json" + } + }, + "enums": { + "type": "object", + "description": "A dictionary, where each key is an enum ID and each value is an object defining the values for the enum. Enum IDs must be alphanumeric identifiers matching the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`.", + "minProperties": 1, + "additionalProperties": { + "$ref": "enum.schema.json" + } + }, + "extensions": {}, + "extras": {} + }, + "required": [ + "id" + ] +} \ No newline at end of file