Browse Source

add schema's EXT_mesh_features

Bert Temme 2 years ago
parent
commit
1bd0caefe0

+ 10 - 0
src/SharpGLTF.Cesium/EXT_mesh_features/README.md

@@ -0,0 +1,10 @@
+# EXT_mesh_features
+
+This directory contains schema's for Cesium extension 
+EXT_mesh_features
+
+PR at Khronos: https://github.com/KhronosGroup/glTF/pull/2082
+
+Schema's are copied from https://github.com/CesiumGS/glTF/tree/proposal-EXT_mesh_features/extensions/2.0/Vendor/EXT_mesh_features/schema
+
+

+ 47 - 0
src/SharpGLTF.Cesium/EXT_mesh_features/schema/featureId.schema.json

@@ -0,0 +1,47 @@
+{
+    "$schema": "https://json-schema.org/draft/2020-12/schema",
+    "$id": "featureId.schema.json",
+    "title": "Feature ID in EXT_mesh_features",
+    "type": "object",
+    "description": "Feature IDs stored in an attribute or texture.",
+    "allOf": [
+        {
+            "$ref": "glTFProperty.schema.json"
+        }
+    ],
+    "properties": {
+        "featureCount": {
+            "type": "integer",
+            "minimum": 1,
+            "description": "The number of unique features in the attribute or texture."
+        },
+        "nullFeatureId": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "A value that indicates that no feature is associated with this vertex or texel."
+        },
+        "label": {
+            "type": "string",
+            "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
+            "description": "A label assigned to this feature ID set. Labels must be alphanumeric identifiers matching the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`."
+        },
+        "attribute": {
+            "description": "An attribute containing feature IDs. When `attribute` and `texture` are omitted the feature IDs are assigned to vertices by their index.",
+            "$ref": "featureIdAttribute.schema.json"
+        },
+        "texture": {
+            "description": "A texture containing feature IDs.",
+            "$ref": "featureIdTexture.schema.json"
+        },
+        "propertyTable": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "The index of the property table containing per-feature property values. Only applicable when using the `EXT_structural_metadata` extension."
+        },
+        "extensions": {},
+        "extras": {}
+    },
+    "required": [
+        "featureCount"
+    ]
+}

+ 8 - 0
src/SharpGLTF.Cesium/EXT_mesh_features/schema/featureIdAttribute.schema.json

@@ -0,0 +1,8 @@
+{
+    "$schema": "https://json-schema.org/draft/2020-12/schema",
+    "$id": "featureIdAttribute.schema.json",
+    "title": "Feature ID Attribute in EXT_mesh_features",
+    "type": "integer",
+    "minimum": 0,
+    "description": "An integer value 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`)."
+}

+ 30 - 0
src/SharpGLTF.Cesium/EXT_mesh_features/schema/featureIdTexture.schema.json

@@ -0,0 +1,30 @@
+{
+    "$schema": "https://json-schema.org/draft/2020-12/schema",
+    "$id": "featureIdTexture.schema.json",
+    "title": "Feature ID Texture in EXT_mesh_features",
+    "type": "object",
+    "description": "A texture containing feature IDs",
+    "allOf": [
+        {
+            "$ref": "textureInfo.schema.json"
+        }
+    ],
+    "properties": {
+        "channels": {
+            "type": "array",
+            "items": {
+                "type": "integer",
+                "minimum": 0
+            },
+            "minItems": 1,
+            "description": "Texture channels containing feature IDs, identified by index. Feature IDs may be packed into multiple channels if a single channel does not have sufficient bit depth to represent all feature ID values. The values are packed in little-endian order.",
+            "default": [
+                0
+            ]
+        },
+        "index": {},
+        "texCoord": {},
+        "extensions": {},
+        "extras": {}
+    }
+}

+ 27 - 0
src/SharpGLTF.Cesium/EXT_mesh_features/schema/mesh.primitive.EXT_mesh_features.schema.json

@@ -0,0 +1,27 @@
+{
+    "$schema": "https://json-schema.org/draft/2020-12/schema",
+    "$id": "mesh.primitive.EXT_mesh_features.schema.json",
+    "title": "EXT_mesh_features glTF Mesh Primitive extension",
+    "type": "object",
+    "description": "An object describing feature IDs for a mesh primitive.",
+    "allOf": [
+        {
+            "$ref": "glTFProperty.schema.json"
+        }
+    ],
+    "properties": {
+        "featureIds": {
+            "type": "array",
+            "description": "An array of feature ID sets.",
+            "minItems": 1,
+            "items": {
+                "$ref": "featureId.schema.json"
+            }
+        },
+        "extensions": {},
+        "extras": {}
+    },
+    "required": [
+        "featureIds"
+    ]
+}