diff --git a/specification/README.md b/specification/README.md index 26a1a9e2ee..5f494cd426 100644 --- a/specification/README.md +++ b/specification/README.md @@ -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) @@ -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._ + +### 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). @@ -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| @@ -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. diff --git a/specification/schema/glTF.schema.json b/specification/schema/glTF.schema.json index 0799a882fb..d91fc4146a 100644 --- a/specification/schema/glTF.schema.json +++ b/specification/schema/glTF.schema.json @@ -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.",