diff --git a/extensions/2.0/Vendor/EXT_implicit_geometry/README.md b/extensions/2.0/Vendor/EXT_implicit_geometry/README.md index 7fad6f524c..88c69e7432 100644 --- a/extensions/2.0/Vendor/EXT_implicit_geometry/README.md +++ b/extensions/2.0/Vendor/EXT_implicit_geometry/README.md @@ -12,9 +12,7 @@ Written against the glTF 2.0 specification. ## Overview -This extension allows mesh primitives to represent renderable implicit surfaces. Typically, a glTF mesh primitive requires `attributes` that supply mesh data, and uses `mode` to indicate the mesh topology. With `EXT_implicit_geometry`, the primitive may omit these properties and instead use the extension to infer the implicit 3D volume. - -Primitives with this extension may still be affected by node transforms to position, orient, and scale the shape as needed. +This extension allows glTF assets to define implicit geometry surfaces at the root level. This extension does not define any particular behavior for these shapes, but other extensions may build upon it for use in various functions. ## Supported Geometry @@ -25,9 +23,9 @@ Currently, this extension supports the following implicit geometries: - [`ellipsoid`](#ellipsoid) - [`region`](#region) -Only **one** shape may be defined at a time. +The extension may also be extended itself to permit other geometry types. Only **one** shape may be defined at a time. -By default, the implicit 3D volume is assumed to fill the entire shape specified in the extension. However, each shape allows an optional `slice` property to define the subsection of the shape in which the 3D volume is actually rendered. For instance, while the extension may define an implicit sphere, its `slice` can limit the volume to be only half of the full sphere. +By default, the implicit 3D volume is assumed to fill the entire shape specified in the extension. However, shapes may allow an optional `slice` property to define the subsection of the shape in which the 3D volume is actually rendered. For instance, while the extension may define an implicit sphere, its `slice` can limit the volume to be only half of the full sphere. ### Box @@ -41,14 +39,16 @@ The `box` property represents an axis-aligned box that is centered at the origin
-    "primitives": [
+    "extensions": [
       {
-        "extensions": {
-          "EXT_implicit_geometry": {
-            "box": {
-              "size": [1, 0.5, 2],
+        "EXT_implicit_geometry": {
+          "geometries": [
+            {
+              "box": {
+                "size": [1, 0.5, 2],
+              }
             }
-          }
+          ]
         }
       }
     ]
@@ -71,15 +71,17 @@ The `cylinder` property represents a cylinder that is aligned with the `y`-axis
   
   
     
-    "primitives": [
+    "extensions": [
       {
-        "extensions": {
-          "EXT_implicit_geometry": {
-            "cylinder": {
-              "radius": 2,
-              "height": 3
+        "EXT_implicit_geometry": {
+          "geometries": [
+            {
+              "cylinder": {
+                "radius": 2,
+                "height": 3
+              }
             }
-          }
+          ]
         }
       }
     ]
@@ -102,14 +104,16 @@ The `sphere` property represents a sphere that is centered at the origin. The `r
   
   
     
-    "primitives": [
+    "extensions": [
       {
-        "extensions": {
-          "EXT_implicit_geometry": {
-            "sphere": {
-              "radius": 2,
+        "EXT_implicit_geometry": {
+          "geometries": [
+            {
+              "sphere": {
+                "radius": 2
+              }
             }
-          }
+          ]
         }
       }
     ]
@@ -134,17 +138,19 @@ The `ellipsoid` property represents an ellipsoid that is centered at the origin.
   
   
     
-      "primitives": [
-        {
-          "extensions": {
-            "EXT_implicit_geometry": {
+    "extensions": [
+      {
+        "EXT_implicit_geometry": {
+          "geometries": [
+            {
               "ellipsoid": {
                 "radii": [2, 3, 4]
               }
             }
-          }
+          ]
         }
-      ]
+      }
+    ]
     
**TODO** visual example @@ -169,19 +175,21 @@ The `heightFromSurface` property indicates the height of the region from the ell
-      "primitives": [
-        {
-          "extensions": {
-            "EXT_implicit_geometry": {
+    "extensions": [
+      {
+        "EXT_implicit_geometry": {
+          "geometries": [
+            {
               "region": {
                 "semiMajorAxisRadius": 4,
                 "semiMinorAxisRadius": 2,
                 "heightFromSurface": 0.5 
               }
             }
-          }
+          ]
         }
-      ]
+      }
+    ]
     
**TODO** visual example diff --git a/extensions/2.0/Vendor/EXT_implicit_geometry/schema/ellipsoid.slice.schema.json b/extensions/2.0/Vendor/EXT_implicit_geometry/schema/ellipsoid.slice.schema.json index 39ca274197..ae7a91d965 100644 --- a/extensions/2.0/Vendor/EXT_implicit_geometry/schema/ellipsoid.slice.schema.json +++ b/extensions/2.0/Vendor/EXT_implicit_geometry/schema/ellipsoid.slice.schema.json @@ -1,9 +1,9 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "ellipsoid.bounds.schema.json", - "title": "Ellipsoid Bounds", + "$id": "ellipsoid.slice.schema.json", + "title": "Ellipsoid Slice", "type": "object", - "description": "A set of bounds for an implicit ellipsoid surface. Defines the subsection of the ellipsoid that the implicit volume actually occupies.", + "description": "A slice of an implicit ellipsoid. Defines the subsection of the ellipsoid that the implicit volume actually occupies.", "allOf": [ { "$ref": "glTFProperty.schema.json" @@ -12,41 +12,41 @@ "properties": { "minRadius": { "type": "number", - "description": "The minimum radial bound of the ellipsoid.", + "description": "The start of the slice along the radius of the ellipsoid.", "minimum": 0, "maximum": 1, "default": 0 }, "maxRadius": { "type": "number", - "description": "The maximum radial bound of the ellipsoid.", + "description": "The end of the slice along the radius of the ellipsoid.", "minimum": 0, "maximum": 1, "default": 1 }, "minAngle": { "type": "array", - "description": "The minimum angular bounds of the ellipsoid in radians. The first element corresponds to the azimuthal angle (a.k.a longitude) and must be in the range [-pi, pi]. The second element corresponds to the polar angle (a.k.a. latitude) and must be in the range [-pi/2, pi/2].", + "description": "The start of the slice across the angles of the sphere, given in radians. The first element corresponds to the azimuthal angle (a.k.a longitude) and must be in the range [-pi, pi]. The second element corresponds to the polar angle (a.k.a. latitude) and must be in the range [-pi/2, pi/2].", "items": { "type": "number", "minimum": -3.14159265359, - "maximum": 3.14159265359, + "maximum": 3.14159265359 }, "minItems": 2, "maxItems": 2, "default": [-3.14159265359, -1.57079632679] }, - "minAngle": { + "maxAngle": { "type": "array", - "description": "The maximum angular bounds of the ellipsoid in radians. The first element corresponds to the azimuthal angle (a.k.a longitude) and must be in the range [-pi, pi]. The second element corresponds to the polar angle (a.k.a. latitude) and must be in the range [-pi/2, pi/2].", + "description": "The end of the slice across the angles of the sphere, given in radians. The first element corresponds to the azimuthal angle (a.k.a longitude) and must be in the range [-pi, pi]. The second element corresponds to the polar angle (a.k.a. latitude) and must be in the range [-pi/2, pi/2].", "items": { "type": "number", "minimum": -3.14159265359, - "maximum": 3.14159265359, + "maximum": 3.14159265359 }, "minItems": 2, "maxItems": 2, "default": [3.14159265359, 1.57079632679] - }, + } } } \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_implicit_geometry/schema/mesh.primitive.EXT_implicit_geometry.schema.json b/extensions/2.0/Vendor/EXT_implicit_geometry/schema/geometry.schema.json similarity index 57% rename from extensions/2.0/Vendor/EXT_implicit_geometry/schema/mesh.primitive.EXT_implicit_geometry.schema.json rename to extensions/2.0/Vendor/EXT_implicit_geometry/schema/geometry.schema.json index ffbd656bfe..9cb6b880f2 100644 --- a/extensions/2.0/Vendor/EXT_implicit_geometry/schema/mesh.primitive.EXT_implicit_geometry.schema.json +++ b/extensions/2.0/Vendor/EXT_implicit_geometry/schema/geometry.schema.json @@ -1,9 +1,9 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "mesh.primitive.EXT_implicit_geometry.schema.json", - "title": "EXT_primitive_voxels glTF Mesh Primitive extension", + "$id": "geometry.schema.json", + "title": "Geometry in EXT_implicit_geometry", "type": "object", - "description": "`EXT_implicit_geometry` extension for a primitive in a glTF model to represent implicit 3D geometry", + "description": "A definition of implicit 3D geometry.", "allOf": [ { "$ref": "glTFProperty.schema.json" @@ -11,20 +11,20 @@ ], "properties": { "box": { - "$ref": "box.schema.json" + "$ref": "geometry.box.schema.json" }, "cylinder": { - "$ref": "cylinder.schema.json" + "$ref": "geometry.cylinder.schema.json" }, "sphere": { - "$ref": "sphere.schema.json" + "$ref": "geometry.sphere.schema.json" }, "ellipsoid": { - "$ref": "ellipsoid.schema.json" + "$ref": "geometry.ellipsoid.schema.json" }, "region": { - "$ref": "region.schema.json" - }, + "$ref": "geometry.region.schema.json" + } }, "oneOf": [ { diff --git a/extensions/2.0/Vendor/EXT_implicit_geometry/schema/glTF.EXT_implicit_geometry.schema.json b/extensions/2.0/Vendor/EXT_implicit_geometry/schema/glTF.EXT_implicit_geometry.schema.json new file mode 100644 index 0000000000..86fb48087d --- /dev/null +++ b/extensions/2.0/Vendor/EXT_implicit_geometry/schema/glTF.EXT_implicit_geometry.schema.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "glTF.EXT_implicit_geometry.schema.json", + "title": "EXT_implicit_geometry glTF extension", + "type": "object", + "description": "`EXT_implicit_geometry` extension to represent implicit 3D geometry in a glTF model", + "allOf": [ + { + "$ref": "glTFProperty.schema.json" + } + ], + "properties": { + "geometries": { + "type": "array", + "description": "An array of implicit geometry definitions.", + "minItems": 1, + "items": { + "$ref": "geometry.schema.json" + } + } + } +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_implicit_geometry/schema/region.schema.json b/extensions/2.0/Vendor/EXT_implicit_geometry/schema/region.schema.json index 539c1bbd0f..abb0dec8f7 100644 --- a/extensions/2.0/Vendor/EXT_implicit_geometry/schema/region.schema.json +++ b/extensions/2.0/Vendor/EXT_implicit_geometry/schema/region.schema.json @@ -22,7 +22,7 @@ }, "heightFromSurface": { "type": "number", - "description": "The height of this region from the surface of the reference ellipsoid in meters.", + "description": "The height of this region from the surface of the reference ellipsoid in meters." }, "slice": { "$ref": "region.slice.schema.json", diff --git a/extensions/2.0/Vendor/EXT_implicit_geometry/schema/region.slice.schema.json b/extensions/2.0/Vendor/EXT_implicit_geometry/schema/region.slice.schema.json index ae5ac69349..724b9177f6 100644 --- a/extensions/2.0/Vendor/EXT_implicit_geometry/schema/region.slice.schema.json +++ b/extensions/2.0/Vendor/EXT_implicit_geometry/schema/region.slice.schema.json @@ -1,7 +1,7 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "region.bounds.schema.json", - "title": "Region Bounds", + "$id": "region.slice.schema.json", + "title": "Region Slice", "type": "object", "description": "A slice of an implicit region relative to an ellipsoid. Defines the subsection of the region that the implicit volume actually occupies.", "allOf": [ diff --git a/extensions/2.0/Vendor/EXT_implicit_geometry/schema/sphere.slice.schema.json b/extensions/2.0/Vendor/EXT_implicit_geometry/schema/sphere.slice.schema.json index 2e3c333a6c..7e822dc556 100644 --- a/extensions/2.0/Vendor/EXT_implicit_geometry/schema/sphere.slice.schema.json +++ b/extensions/2.0/Vendor/EXT_implicit_geometry/schema/sphere.slice.schema.json @@ -30,23 +30,23 @@ "items": { "type": "number", "minimum": -3.14159265359, - "maximum": 3.14159265359, + "maximum": 3.14159265359 }, "minItems": 2, "maxItems": 2, "default": [-3.14159265359, -1.57079632679] }, - "minAngle": { + "maxAngle": { "type": "array", "description": "The end of the slice across the angles of the sphere, in radians. The first element corresponds to the azimuthal angle (a.k.a longitude) and must be in the range [-pi, pi]. The second element corresponds to the polar angle (a.k.a. latitude) and must be in the range [-pi/2, pi/2].", "items": { "type": "number", "minimum": -3.14159265359, - "maximum": 3.14159265359, + "maximum": 3.14159265359 }, "minItems": 2, "maxItems": 2, "default": [3.14159265359, 1.57079632679] - }, + } } } \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_primitive_voxels/README.md b/extensions/2.0/Vendor/EXT_primitive_voxels/README.md index 2175ffa563..e53b7287da 100644 --- a/extensions/2.0/Vendor/EXT_primitive_voxels/README.md +++ b/extensions/2.0/Vendor/EXT_primitive_voxels/README.md @@ -26,22 +26,18 @@ Typically, glTF mesh primitives use the `POSITION` attribute to store positional ``` "primitives": [ { + "attributes": { + "_TEMPERATURE": 0 + }, "mode": 2147483648, "extensions": { - "EXT_implicit_geometry": { - "box": { - "size": [2, 2, 2] - } - }, "EXT_primitive_voxels": { + "shape": 0, "dimensions": [8, 8, 8], "padding": { "before": [1, 1, 1], "after": [1, 1, 1] - }, - "attributes": { - "_TEMPERATURE": 0 - }, + } } } } @@ -60,27 +56,7 @@ The relationship between `dimensions` and the grid geometry is explained in deta ### Box Grid -A **box** grid is a Cartesian grid defined by `x`, `y`, and `z` axes with equally-sized boxes. A voxel primitive that is based on a box grid may be defined like so: - -``` -{ -"extensions": { - "EXT_implicit_geometry": { - "box": { - "size": [2, 2, 2] - } - }, - "EXT_primitive_voxels": { - "dimensions": [8, 8, 8], - "attributes": { - "_TEMPERATURE": 0 - }, - } - } -} -``` - -The `dimensions` correspond to the subdivisions of the box along the `x`, `y`, and `z` axes respectively. +A **box** grid is a Cartesian grid defined by `x`, `y`, and `z` axes with equally-sized boxes. The `dimensions` correspond to the subdivisions of the box along the `x`, `y`, and `z` axes respectively. ![Uniform box grid](figures/uniform-box.png)

A box grid spanning from -1 to 1 in all three axes, subdivided into two cells along each axis. The origin is in the center of the box.

@@ -98,27 +74,6 @@ A **cylinder** grid is subdivided along the radius, height, and angle ranges of The cylinder is aligned with the `y`-axis in the primitive's local space. As such, the `height` is subdivided along that local `y`-axis. Subdivisions along the `radius` are concentric, centered around the `y`-axis and extending outwards. The `angle` is subdivided around the circumference of the cylinder. -A voxel primitive that is based on a cylinder grid may define the `cylinder` property like so: - -``` -{ -"extensions": { - "EXT_implicit_geometry": { - "cylinder": { - "radius": 2, - "height": 3 - } - }, - "EXT_primitive_voxels": { - "dimensions": [8, 8, 8], - "attributes": { - "_TEMPERATURE": 0 - }, - } - } -} -``` - [TODO](image) ### Ellipsoidal Grid @@ -178,10 +133,40 @@ The padding data must be supplied with the rest of the voxel data - this means i This extension may be paired with the `EXT_structural_metadata` extension. +``` { "extensions": { + "EXT_implicit_geometry": { + geometries: [ + { + "box":{ + "size": [2, 2, 2] + } + } + ] + }, "EXT_structural_metadata": { - + "schema": { + "classes": { + "voxels": { + "properties": { + "temperature": { + // ... + } + } + } + } + } + propertyAttributes: [ + { + "class": "voxels", + "properties": { + "temperature":{ + "attribute": "_TEMPERATURE" + } + } + } + ] } }, "meshes": [ @@ -191,18 +176,16 @@ This extension may be paired with the `EXT_structural_metadata` extension. "attributes": { "_TEMPERATURE": 0 }, - "mode": 2147483648, "extensions": { "EXT_primitive_voxels": { "dimensions": [8, 8, 8], - "bounds": { - "min": [0.25, 0.5, 0.5], - "max": [0.375, 0.625, 0.625] - }, "padding": { "before": [1, 1, 1], "after": [1, 1, 1] } + }, + EXT_structural_metadata: { + propertyAttributes: [0] } } } @@ -210,6 +193,7 @@ This extension may be paired with the `EXT_structural_metadata` extension. } ] } +``` ## Optional vs. Required This extension is required, meaning it should be placed in both the `extensionsUsed` list and `extensionsRequired` list. diff --git a/extensions/2.0/Vendor/EXT_primitive_voxels/schema/mesh.primitive.EXT_primitive_voxels.schema.json b/extensions/2.0/Vendor/EXT_primitive_voxels/schema/mesh.primitive.EXT_primitive_voxels.schema.json index 61636d8a67..98e7939131 100644 --- a/extensions/2.0/Vendor/EXT_primitive_voxels/schema/mesh.primitive.EXT_primitive_voxels.schema.json +++ b/extensions/2.0/Vendor/EXT_primitive_voxels/schema/mesh.primitive.EXT_primitive_voxels.schema.json @@ -3,7 +3,7 @@ "$id": "mesh.primitive.EXT_primitive_voxels.schema.json", "title": "EXT_primitive_voxels glTF Mesh Primitive extension", "type": "object", - "description": "`EXT_primitive_voxels` extension for a primitive in a glTF model, to specify voxel grid geometry for volumetric data", + "description": "`EXT_primitive_voxels` extension for a primitive in a glTF model to indicate voxel-based volumetric data", "allOf": [ { "$ref": "glTFProperty.schema.json" @@ -12,7 +12,7 @@ "properties": { "dimensions": { "type": "array", - "description": "Dimensions of the voxel grid. x/y/z for a box, r/z/theta for a cylinder, lon/lat/height for an ellipsoid.", + "description": "Dimensions of the voxel grid. The values are interpreted with respect to the shape of the grid indicated by `EXT_implicit_geometry`.", "items": { "type": "integer", "minimum": 1 @@ -21,6 +21,7 @@ "maxItems": 3 }, "padding": { + "description": "The optional padding of the voxels.", "$ref": "padding.schema.json" } }, diff --git a/extensions/2.0/Vendor/EXT_primitive_voxels/schema/padding.schema.json b/extensions/2.0/Vendor/EXT_primitive_voxels/schema/padding.schema.json index ad94b3ed0c..70b59e5d0b 100644 --- a/extensions/2.0/Vendor/EXT_primitive_voxels/schema/padding.schema.json +++ b/extensions/2.0/Vendor/EXT_primitive_voxels/schema/padding.schema.json @@ -3,7 +3,7 @@ "$id": "padding.schema.json", "title": "Padding", "type": "object", - "description": "The padding property specifies how many rows of attribute data in each dimension come from neighboring grids.", + "description": "The padding around a voxel grid. Specifies how many rows of attribute data come from neighboring grids in each dimension.", "allOf": [ { "$ref": "glTFProperty.schema.json"