KhronosGroup / KhronosGroup/glTF
[glTF 2.1] Shapes
- Dominant language
- HTML
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 17h 26m
- Merged PRs (30d)
- 5
Description
# Shapes
glTF 2.1 adds a new `shapes` array to the top-level. This provides the same data as the pending `KHR_implicit_shapes` extension, which is now superseded by glTF 2.1.
The base glTF 2.1 specification includes `"box"`, `"capsule"`, `"cylinder"`, `"plane"`, and `"sphere"` shape types. Data for these shapes, such as size and radius, can be specified in sub-objects with keys matching the type name. Extensions may define additional shape types.
## Use cases
Shapes are useful for a variety of use cases, such as:
- Bounding volumes (core to glTF 2.1)
- Useful for culling, deferred loading, volume restriction, semantic labeling of volumes, and so on.
- Physics colliders (not core)
- Solid objects, triggers, bone colliders, and so on.
- Procedural mesh generation (not core)
## Example
> [!NOTE]
> Examples are illustrative and not exhaustive.
```json
{
"shapes": [
{
"type": "box",
"box": {
"size": [2.5, 3.0, 2.0]
}
}
]
}
```
## Why this design
Ratifying and using the existing `KHR_implicit_shapes` extension was considered. However, there was a strong desire for bounding volumes to be a core glTF 2.1 feature, and it would be inappropriate for a core feature to depend on an extension. Additionally, shapes are broadly useful, so it makes sense to define them in the core specification, even if they were not used for bounding volumes.
Contributor guide
Research direction
Start by reviewing the glTF 2.1 Shapes proposal and the superseded KHR_implicit_shapes extension described in the issue. Define the specification changes for a top-level shapes array, the five listed core shape types, their sub-objects, and extension-defined types, using the provided JSON example as a reference.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100