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

extensionsRequired property #720

Merged
merged 2 commits into from
Sep 17, 2016
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
57 changes: 46 additions & 11 deletions specification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Copyright (C) 2013-2016 The Khronos Group Inc. All Rights Reserved. glTF is a tr
* [Animations](#animations)
* [Metadata](#metadata)
* [Specifying Extensions](#specifying-extensions)
* [Specifying GL Extensions](#specifying-gl-extensions)
* [Properties Reference](#properties)
* [Acknowledgements](#acknowledgements)
* [Appendix A: Default Material](#appendix-a)
Expand Down Expand Up @@ -1123,25 +1124,50 @@ Only the `version` property is required. For example,

glTF defines an extension mechanism that allows the base format to be extended with new capabilities. Any glTF object can have an optional `extensions` property, as in the following example:

```javascript
"a_shader": {
```json
{
"a_shader": {
"extensions": {
"binary_glTF": {
"bufferView": // ...
}
"KHR_binary_glTF": {
"bufferView": "a_shader_bufferView"
}
}
}
}
```

All extensions used in a model are listed in the top-level `extensionsUsed` dictionary object, e.g.,
All extensions used in a glTF asset are listed in the top-level `extensionsUsed` dictionary object, e.g.,

```javascript
"extensionsUsed": [
"KHR_binary_glTF"
]
```json
{
"extensionsUsed": [
"KHR_binary_glTF", "VENDOR_physics"
]
}
```

All glTF extensions required to load and/or render an asset must be listed in the top-level `extensionsRequired` dictionary object, e.g.,

```json
{
"extensionsRequired": [
"KHR_binary_glTF"
]
}
```

_TODO: add note on how this is different than `glExtensionsUsed` property._
<a name="specifying-gl-extensions"></a>
### Specifying GL extensions

If loading an asset requires enabling GL extensions to provide functionality beyond used profile (e.g., WebGL 1.0), such extensions must be listed in the top-level `glExtensionsUsed` dictionary object, e.g.,

```json
{
"glExtensionsUsed": [
"OES_element_index_uint"
]
}
```

For more information on glTF extensions, consult the [extensions registry specification](../extensions/README.md).

Expand Down Expand Up @@ -2049,6 +2075,7 @@ The root object for a glTF asset.
|**techniques**|`object`|A dictionary object of [`technique`](#reference-technique) objects.|No, default: `{}`|
|**textures**|`object`|A dictionary object of [`texture`](#reference-texture) objects.|No, default: `{}`|
|**extensionsUsed**|`string[]`|Names of glTF extensions used somewhere in this asset.|No, default: `[]`|
|**extensionsRequired**|`string[]`|Names of glTF extensions required to properly load this asset.|No, default: `[]`|
|**glExtensionsUsed**|`string[]`|Names of WebGL extensions required to render this asset.|No, default: `[]`|
|**extensions**|`object`|Dictionary object with extension-specific objects.|No|
|**extras**|`any`|Application-specific data.|No|
Expand Down Expand Up @@ -2208,6 +2235,14 @@ Names of extensions used somewhere in this asset.
* Each element in the array must be unique.
* **Required**: No, default: `[]`

### glTF.extensionsRequired

Names of glTF extensions required to properly load this asset.

* **Type**: `string[]`
* Each element in the array must be unique.
* **Required**: No, default: `[]`

### glTF.extensions

Dictionary object with extension-specific objects.
Expand Down
9 changes: 9 additions & 0 deletions specification/schema/glTF.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
"uniqueItems" : true,
"default" : []
},
"extensionsRequired" : {
"type" : "array",
"description" : "Names of glTF extensions required to properly load this asset.",
"items" : {
"type" : "string"
},
"uniqueItems" : true,
"default" : []
},
"accessors" : {
"type" : "object",
"description" : "A dictionary object of accessors.",
Expand Down