diff --git a/README.md b/README.md index b3fa7a3036..107854abf1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

+

@@ -8,22 +8,25 @@ glTF is a draft specification, it may change before ratification. Everyone is e ## Specification -[glTF Specification 0.6](https://github.com/KhronosGroup/glTF/blob/schema/specification/README.md) +[glTF Specification 0.8](https://github.com/KhronosGroup/glTF/blob/master/specification/README.md) + +## Converter + +An open-source command-line [converter](https://github.com/KhronosGroup/glTF/wiki/converter) produces glTF assets from COLLADA using [OpenCOLLADA](https://github.com/khronosGroup/OpenCOLLADA/). + +Download the [binary](https://github.com/KhronosGroup/glTF/wiki/Converter-builds) for Mac or Windows. ## Cloning the repo + +Since this repo has git submodules, clone with: + ``` git clone --recurse-submodules https://github.com/KhronosGroup/glTF.git ``` -## Converter - -An open-source [converter](https://github.com/KhronosGroup/glTF/wiki/converter) produces glTF assets from COLLADA using [OpenCOLLADA](https://github.com/khronosGroup/OpenCOLLADA/). - -You can also find binary [builds](https://github.com/KhronosGroup/glTF/wiki/Converter-builds). - ## Viewers * [glTF viewer](https://github.com/fabrobinet/glTF-webgl-viewer) based on [montagejs](https://github.com/montagejs/montage) * [glTF loader](https://github.com/mrdoob/three.js/tree/master/examples/js/loaders/gltf) in [Three.js](http://threejs.org/) * [glTF loader](http://cesiumjs.org/2014/03/03/Cesium-3D-Models-Tutorial/) in the [Cesium](http://cesiumjs.org/) virtual globe engine -* [rest3d](https://github.com/amd/rest3d) - serves glTF and other 3D assets via a REST API +* [rest3d](https://github.com/amd/rest3d) - serves glTF and other 3D assets via a REST API \ No newline at end of file diff --git a/specification/README.md b/specification/README.md index c35aaea31f..17ca87c310 100644 --- a/specification/README.md +++ b/specification/README.md @@ -1,8 +1,12 @@ -# glTF - the runtime asset format for WebGL, OpenGL ES, and OpenGL +

+ +

-_This is a draft specification; it is incomplete and may change before ratification. We've made it available early in the spirit of transparency to receive early community feedback. Please create [issues](https://github.com/KhronosGroup/glTF/issues) with your feedback._ +Version 0.8 + +glTF is the runtime asset format for WebGL, OpenGL ES, and OpenGL. -_In particular, the definition of materials are in flux, and work on animations and texture and geometry compression are still in the early stages. We are also initially focusing on WebGL. OpenGL ES and OpenGL need additional considerations._ +_This is a draft specification; it is incomplete and may change before ratification. We've made it available early in the spirit of transparency to receive early community feedback. Please create [issues](https://github.com/KhronosGroup/glTF/issues) with your feedback._ Editors @@ -14,6 +18,54 @@ Editors # Contents * Motivation +* Schema + * `accessor` + * `animation` + * `animation/channel` + * `animation/channel/target` + * `animation/parameter` + * `animation/sampler` + * `asset` + * `buffer` + * `bufferView` + * `camera` + * `camera/orthographic` + * `camera/perspective` + * `extension` + * `extras` + * `glTF` (root property for model) + * `image` + * `light` + * `light/ambient` + * `light/directional` + * `light/point` + * `light/spot` + * `material` + * `material/instanceTechnique` + * `material/instanceTechnique/values` + * `mesh` + * `mesh/primitive` + * `mesh/primitive/attribute` + * `node` + * `node/instanceSkin` + * `program` + * `sampler` + * `scene` + * `shader` + * `skin` + * `technique` + * `technique/parameters` + * `technique/pass` + * `technique/pass/details` + * `technique/pass/details/commonProfile` + * `technique/pass/details/commonProfile/texcoordBindings` + * `technique/pass/instanceProgram` + * `technique/pass/instanceProgram/attribute` + * `technique/pass/instanceProgram/uniform` + * `technique/pass/states` + * `texture` + + # Motivation -glTF, the **GL** **T**ransmission **F**ormat, is the runtime asset format for the GL APIs: WebGL, OpenGL ES, and OpenGL. glTF bridges the gap between formats used by modeling tools and the GL APIs. +glTF, the GL Transmission Format, is the runtime asset format for the GL APIs: WebGL, OpenGL ES, and OpenGL. glTF bridges the gap between formats used by modeling tools and the GL APIs. There are industry-standard interchange formats, namely COLLADA, that allow sharing assets between modeling tools and within the content pipeline in general. However, these formats are not optimized for size or runtime use and neither are modeling-tool-specific formats. At runtime, an application wishing to render an asset needs to do a significant amount of processing to transform the asset's content into data appropriate for the GL APIs. @@ -108,7 +161,8 @@ For a simple example, see the converted [COLLADA duck model](https://github.com/ Finally, glTF is not part of COLLADA, that is, it is not a COLLADA profile. It is its own specification with many designs borrowed from COLLADA and simplified. - + # Conventions @@ -299,11 +352,9 @@ Alternatively, glTF could allow application-specific properties anywhere, but th * _Needs to pass through `extra` objects_. * _Should fill out all optional properties so that the user receives complete objects with default values, e.g., render state._ - # Schema - ## `attribute (mesh)` @@ -325,7 +376,6 @@ Alternatively, glTF could allow application-specific properties anywhere, but th * _COLLADA2JSON_ * _Add checking for Sections 6.3 and 6.9 above._ - ## `asset` @@ -348,7 +398,6 @@ None. * [#23](https://github.com/KhronosGroup/glTF/issues/23) - should glTF specify unit property? * [#24](https://github.com/KhronosGroup/glTF/issues/24) - glTF should specify more aspects of assets - ## `attribute` @@ -373,7 +422,6 @@ _TODO_ * _COLLADA2JSON_ * - ## `buffer` @@ -406,7 +454,6 @@ _TODO: Even though data URIs are part of the [spec](https://dvcs.w3.org/hg/xhr/r * Use `int_array` attributes `minInclusive` or `maxInclusive` to determine WebGL int datatype? - ## `bufferView` @@ -421,7 +468,6 @@ _TODO: Even though data URIs are part of the [spec](https://dvcs.w3.org/hg/xhr/r * [`ArrayBufferView`](http://www.khronos.org/registry/typedarray/specs/latest/#6) - ## `camera` @@ -454,7 +500,6 @@ See `orthographic` and `persp * _Loader and writer need to be updated to reflect the new organization and required properties, not all COLLADA properties._ * _`yfov` is degrees; it should be radians since this is a final-stage format._ - ## `geographicLocation` @@ -473,7 +518,6 @@ None. _TODO_ - ## `image` @@ -502,7 +546,6 @@ For compatibility with modern web browsers, the following image formats are supp * [#17](https://github.com/KhronosGroup/glTF/issues/17) - Supprot for render targets * [#18](https://github.com/KhronosGroup/glTF/issues/18) - convert images for destination Profile - ## `indices` @@ -523,7 +566,6 @@ Also see buffer. * [#14](https://github.com/KhronosGroup/glTF/issues/14) - support for models without indices ? - ## `material` @@ -545,7 +587,6 @@ See `parameters`. * _Schema_ * _Write schema for `parameters`._ - ## `mesh` @@ -564,7 +605,6 @@ See `attributes (mesh)` and ` * [#11](https://github.com/KhronosGroup/glTF/issues/11) - Splines should be converted - ## `node` @@ -589,7 +629,6 @@ Also see `mesh` subproperties See `acce * [#12](https://github.com/KhronosGroup/glTF/issues/12) - Convert all transformation elements to matrices * [#13](https://github.com/KhronosGroup/glTF/issues/13) - Should we keep one or more mesh,camera,light per node. - ## `orthographic` @@ -608,7 +647,6 @@ _TODO_ _TODO_ - ## `parameters` @@ -633,7 +671,6 @@ _TODO_ _TODO_ - ## `pass` @@ -655,7 +692,6 @@ See `program` and `states`. * _COLLADA2JSON_ * - ## `perspective` @@ -674,7 +710,6 @@ _TODO_ _TODO_ - ## `primitive` @@ -701,13 +736,11 @@ Also see: * _COLLADA2JSON_ * _Add checking for Section 6.3 above._ - ## `profile` _TODO_ - ## `program` @@ -733,7 +766,6 @@ Also see `attributes` and `uniform * [#25](https://github.com/KhronosGroup/glTF/issues/25) - naming for vertex and fragment shaders - ## `semantics` @@ -790,7 +822,6 @@ Other | `TEXBINORMAL` | | Texture binormal (bitangent) vector. | | `TEXTANGENT` | | Texture tangent vector | - ## `shader` @@ -815,7 +846,6 @@ _TODO: Even though data URIs are part of the [spec](https://dvcs.w3.org/hg/xhr/r Also see `program`. - ## `states` @@ -874,7 +904,6 @@ To satisfy Section 6.10 (Viewport Depth Range) of [WebGL 1.0](https://www.khrono * _COLLADA2JSON_ * _Add to loader and writer. Writer needs to derive state from common profile._ - ## `technique` @@ -896,7 +925,6 @@ See `parameters`. * [#7](https://github.com/KhronosGroup/glTF/issues/7) - Add Schema for parameter - ## `uniform` @@ -920,13 +948,11 @@ _TODO_ * Create list of built-in semantics. [#45](https://github.com/KhronosGroup/collada2json/issues/45). - ## `version` _TODO_ - # Note about About shaders @@ -974,7 +1000,6 @@ For instance, the diffuse component of the lighting might be a color or a textur [TODO]example: - # Asset Validation @@ -982,34 +1007,33 @@ The glTF schema is written using [JSON Schema 03](http://tools.ietf.org/html/dra An asset can be validated against the schema using the glTF Validator (based on [JSV](https://github.com/garycourt/JSV)). Setup a local webserver to point the root of your local copy of this repo, and browse to index.html. For example: ``` -http://localhost/gltf/specification/ +http://localhost/specification/ ``` There are a few query parameters. Use `schema` to provide the schema to validate against: ``` -http://localhost/gltf/specification/?schema=states.schema.json +http://localhost/specification/?schema=states.schema.json ``` Use `json` to provide the asset's JSON to validate: ``` -http://localhost/gltf/specification/?json=examples/states/translucency.json +http://localhost/specification/?json=examples/states/translucency.json ``` Use `validate` to immediately validate the json with the schema: ``` -http://localhost/gltf/specification/?validate=true +http://localhost/specification/?validate=true ``` The most common use is something like: ``` -http://localhost/gltf/specification/?schema=states.schema.json&json=examples/states/translucency.json&validate=true +http://localhost/specification/?schema=states.schema.json&json=examples/states/translucency.json&validate=true ``` Also, JSON in general can be valdiated with [JSONLint](http://jsonlint.com/), which can be useful for validating the glTF schema itself. - # Comparison between COLLADA and glTF @@ -1050,10 +1074,8 @@ becomes TODO: What's in COLLADA, but not in this version of glTF * No `profile`. Instead, this can be negotiated via a REST API. (platform, product name, etc.) - ## Schema - ### `accessor` Minor @@ -1062,7 +1084,6 @@ Minor * `accessor`. Pages 5-5 to 5-10. - ### `asset` * `asset` is only defined on the root glTF property; in COLLADA, it is available as a child of many elements. In practice, it is usually only a child of the `COLLADA` root node. @@ -1074,7 +1095,6 @@ Minor * `contributor`. Pages 5-27 to 5-28. * `geographic_location`. Pages 5-40 to 5-41. - ### `attribute` _TODO_ @@ -1083,7 +1103,6 @@ _TODO_ _TODO_ - ### `buffer` * Vertices and indices are stored in binary, not XML. @@ -1102,7 +1121,6 @@ _TODO_ * `float_array`. Page 5-37. * `int_array`. Page 5-69. - ### `camera` In order to better map to OpenGL, OpenGL ES, and WebGL, glTF differs from COLLADA in the following ways: @@ -1118,7 +1136,6 @@ In order to better map to OpenGL, OpenGL ES, and WebGL, glTF differs from COLLAD * `orthographic`. Pages 5-102 to 5-103. * `perspective`. Pages 5-108 to 5-109. - ### `geographicLocation` _TODO_ @@ -1127,7 +1144,6 @@ _TODO_ _TODO_ - ### `image` glTF 1.0 does not support: @@ -1140,7 +1156,6 @@ glTF 1.0 does not support: * `image`. Page 8-58 to 8-60. * `init_from`. Pages 8-62 to 8-63. - ### `indices` _TODO_ @@ -1149,7 +1164,6 @@ _TODO_ _TODO_ - ### `material` _TODO_ @@ -1158,7 +1172,6 @@ _TODO_ _TODO_ - ### `node` In order to better map to OpenGL, OpenGL ES, and WebGL, glTF differs from COLLADA in the following ways: @@ -1168,7 +1181,6 @@ In order to better map to OpenGL, OpenGL ES, and WebGL, glTF differs from COLLAD * `node`. Pages 5-98 to 5-99. - ### `orthographic` _TODO_ @@ -1177,7 +1189,6 @@ _TODO_ _TODO_ - ### `parameters` _TODO_ @@ -1186,7 +1197,6 @@ _TODO_ _TODO_ - ### `pass` _TODO_ @@ -1195,7 +1205,6 @@ _TODO_ _TODO_ - ### `perspective` _TODO_ @@ -1204,7 +1213,6 @@ _TODO_ _TODO_ - ### `primitive` TODO @@ -1213,7 +1221,6 @@ TODO * - ### `program` _TODO_ @@ -1222,7 +1229,6 @@ _TODO_ _TODO_ - ### `shader` _TODO_ @@ -1231,7 +1237,6 @@ _TODO_ _TODO_ - ### `states` Render states are based on the GLES2 profile in [COLLADA 1.5](http://www.khronos.org/files/collada_spec_1_5.pdf), Pages 8-120 to 8-125. In order to better map to OpenGL, OpenGL ES, and WebGL, glTF differs from COLLADA in the following ways: @@ -1245,7 +1250,6 @@ Render states are based on the GLES2 profile in [COLLADA 1.5](http://www.khronos * `states`. Pages 8-120 to 8-125. - ### `technique` _TODO_ @@ -1254,7 +1258,6 @@ _TODO_ _TODO_ - ### `uniform` _TODO_ @@ -1263,7 +1266,6 @@ _TODO_ _TODO_ - ## `attribute` @@ -1273,16 +1275,19 @@ _TODO_ * `input`. Pages 5-47 to 5-49. +--> + # Acknowledgments * Brandon Jones, for the first version of Three.js loader and all his support in the early days of this project. * Tom Fili, Analytical Graphics, Inc. +* Scott Hunter, Analytical Graphics, Inc. # References -* [WebGL 1.0 spec](https://www.khronos.org/registry/webgl/specs/1.0/) +* [WebGL 1.0.2 spec](https://www.khronos.org/registry/webgl/specs/1.0/) * [COLLADA 1.5 spec](http://www.khronos.org/files/collada_spec_1_5.pdf) diff --git a/specification/accessor.schema.json b/specification/accessor.schema.json new file mode 100644 index 0000000000..c2fd88d203 --- /dev/null +++ b/specification/accessor.schema.json @@ -0,0 +1,60 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "accessor", + "type" : "object", + "description" : "A typed accessor into a buffer-view.", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, + "properties" : { + "bufferView" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the buffer-view.", + "required" : true + }, + "byteOffset" : { + "type" : "integer", + "description" : "The offset relative to the buffer-view in bytes. Must be a multiple of the size of the data type. WebGL: see vertexAttribPointer() offset parameter.", + "minimum" : 0, + "required" : true + }, + "byteStride" : { + "type" : "integer", + "description" : "The stride, in bytes, between attributes referenced by this accessor. When 0, the attributes are tightly packed. WebGL: see vertexAttribPointer() stride parameter.", + "minimum" : 0, + "maximum" : 255, + "default" : 0 + }, + "componentType" : { + "type" : "integer", + "description" : "Valid values are BYTE (5120), UNSIGNED_BYTE (5121), SHORT (5122), UNSIGNED_SHORT (5123), FLOAT (5126). Corresponding typed arrays: Int8Array, Uint8Array, Int16Array, Uint16Array, and Float32Array.", + "enum" : [5120, 5121, 5122, 5123, 5126], + "required" : true + }, + "count" : { + "type" : "integer", + "description" : "The number of attributes referenced by this accessor, not to be confused with the number of bytes or number of components.", + "minimum" : 1, + "required" : true + }, + "type" : { + "type" : "string", + "description" : "Specifies if the attribute is a scale, vector, or matrix.", + "enum" : ["SCALAR", "VEC2", "VEC3", "VEC4", "MAT2", "MAT3", "MAT4"], + "required" : true + }, + "max" : { + "type" : "array", + "description" : "Maximum value of each component in this attribute.", + "items" : { + "type" : "number" + } + }, + "min" : { + "type" : "array", + "description" : "Minimum value of each component in this attribute.", + "items" : { + "type" : "number" + } + } + }, + "additionalProperties" : false +} diff --git a/specification/animation.schema.json b/specification/animation.schema.json new file mode 100644 index 0000000000..4c603ff4ea --- /dev/null +++ b/specification/animation.schema.json @@ -0,0 +1,37 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "animation", + "type" : "object", + "description" : "Keyframe animation.", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, + "properties" : { + "channels" : { + "type" : "array", + "items" : { + "$ref" : "animationChannel.schema.json" + }, + "default" : [] + }, + "parameters" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "animationParameter.schema.json" + }, + "default" : {} + }, + "samplers" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "animationSampler.schema.json" + }, + "default" : {} + } + }, + "dependencies" : { + "channels" : "samplers", + "samplers" : "parameters" + }, + "additionalProperties" : false +} diff --git a/specification/animationChannel.schema.json b/specification/animationChannel.schema.json new file mode 100644 index 0000000000..162e38fa25 --- /dev/null +++ b/specification/animationChannel.schema.json @@ -0,0 +1,20 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "animation/channel", + "type" : "object", + "description" : "Targets a sampler at a glTF property.", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "sampler" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of a sampler in this animation to use to compute the value for the target, e.g., translation, rotation, or scale.", + "required" : true + }, + "target" : { + "extends" : { "$ref" : "animationChannelTarget.schema.json" }, + "description" : "The glTF property to target from an animation channel.", + "required" : true + } + }, + "additionalProperties" : false +} diff --git a/specification/animationChannelTarget.schema.json b/specification/animationChannelTarget.schema.json new file mode 100644 index 0000000000..e71123681a --- /dev/null +++ b/specification/animationChannelTarget.schema.json @@ -0,0 +1,20 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "animation/channel/target", + "type" : "object", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "id" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the node to target.", + "required" : true + }, + "path" : { + "type" : "string", + "description" : "The node property name to modify.", + "enum" : ["translation", "rotation", "scale"], + "required" : true + } + }, + "additionalProperties" : false +} diff --git a/specification/animationParameter.schema.json b/specification/animationParameter.schema.json new file mode 100644 index 0000000000..6c7fea67ea --- /dev/null +++ b/specification/animationParameter.schema.json @@ -0,0 +1,7 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "animation/parameter", + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the accessor containing keyframes (samples) for this parameter.", + "additionalProperties" : false +} diff --git a/specification/animationSampler.schema.json b/specification/animationSampler.schema.json new file mode 100644 index 0000000000..3b566a8c49 --- /dev/null +++ b/specification/animationSampler.schema.json @@ -0,0 +1,20 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "animation/sampler", + "type" : "object", + "description" : "Combines input and output parameters with an interpolation algorithm.", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "input" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of a parameter in this animation to use as keyframe input, e.g., time. This parameter must have type FLOAT. The values represents time in seconds with time[0] >= 0.0, and monotonically increasing values, i.e. time[n + 1] >= time[n].", + "required" : true + }, + "output" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of a parameter in this animation to use as keyframe output.", + "required" : true + } + }, + "additionalProperties" : false +} diff --git a/specification/arrayValues.schema.json b/specification/arrayValues.schema.json new file mode 100644 index 0000000000..bd4947e38c --- /dev/null +++ b/specification/arrayValues.schema.json @@ -0,0 +1,7 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "type" : "array", + "items" : { + "type" : ["number", "boolean", "string"] + } +} diff --git a/specification/asset.schema.json b/specification/asset.schema.json index 0a509a77f0..481179b516 100644 --- a/specification/asset.schema.json +++ b/specification/asset.schema.json @@ -2,18 +2,31 @@ "$schema" : "http://json-schema.org/draft-03/schema", "title" : "asset", "type" : "object", - "description" : "Asset-management information for this model.", + "extends" : { "$ref" : "glTFProperty.schema.json" }, "properties" : { "copyright" : { "type" : "string", - "description" : "A copyright message suitable for display to credit the model author." + "description" : "A copyright message suitable for display to credit the content creator." }, - "geographicLocation" : { - "$ref" : "geographicLocation.schema.json" + "generator" : { + "type" : "string", + "description" : "Tool that generated this glTF model. Useful for debugging." + }, + "premultipliedAlpha" : { + "type" : "boolean", + "description" : "Specifies if the shaders were generated with premultiplied alpha. WebGL: see getContext() with premultipliedAlpha", + "default" : false + }, + "profile" : { + "type" : "string", + "description" : "Specifies the target rendering API and version, e.g., WebGL 1.0.2.", + "default" : "WebGL 1.0.2" }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." + "version" : { + "type" : "number", + "description" : "The glTF version.", + "minimum" : 0.0, + "default" : 0.6 } }, "additionalProperties" : false diff --git a/specification/attribute.schema.json b/specification/attribute.schema.json deleted file mode 100644 index 201d9cd6ce..0000000000 --- a/specification/attribute.schema.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "attribute", - "type" : "object", - "description" : "TODO", - "properties": { - "semantic" : { - "type" : "string", - "description" : "TODO", - "required" : true - }, - "symbol" : { - "type" : "string", - "description" : "TODO", - "required" : true - }, - "type" : { - "type" : "string", - "description" : "TODO", - "required" : true - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." - } - }, - "additionalProperties" : false -} diff --git a/specification/buffer.schema.json b/specification/buffer.schema.json index bf8c57bb1e..5e935d6b96 100644 --- a/specification/buffer.schema.json +++ b/specification/buffer.schema.json @@ -2,23 +2,26 @@ "$schema" : "http://json-schema.org/draft-03/schema", "title" : "buffer", "type" : "object", - "description" : "A buffer with vertex or index data.", + "description" : "Buffers contain geometry, animation, or skins.", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, "properties" : { - "path" : { + "uri" : { "type" : "string", - "description" : "The URL of the binary buffer. Relative URLs are relative to the .json file that references the shader. Instead of referencing an external shader, the URL can also be a base64 data URI.", + "description" : "The uri of the buffer. Relative paths are relative to the .json file. Instead of referencing an external file, the uri can also be a data-uri.", "format" : "uri", "required" : true }, "byteLength" : { - "type" : "number", + "type" : "integer", "description" : "The length of the buffer in bytes.", "minimum" : 0, - "required" : true - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." + "default" : 0 + }, + "type" : { + "type" : "string", + "description" : "XMLHttpRequest responseType.", + "enum" : ["arraybuffer", "text"], + "default" : "arraybuffer" } }, "additionalProperties" : false diff --git a/specification/bufferView.schema.json b/specification/bufferView.schema.json index 15c8207a7d..b4d89cf681 100644 --- a/specification/bufferView.schema.json +++ b/specification/bufferView.schema.json @@ -2,34 +2,30 @@ "$schema" : "http://json-schema.org/draft-03/schema", "title" : "bufferView", "type" : "object", - "description" : "Represents a view of a buffer for indexing and manipulation", + "description" : "A view into a buffer.", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, "properties" : { "buffer" : { - "type" : "string", - "description" : "The id (JSON property name) of the buffer referenced by this view.", + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the buffer.", "required" : true }, "byteOffset" : { - "type" : "number", - "description" : "The offset into the buffer, in bytes.", + "type" : "integer", + "description" : "The offset into the buffer in bytes.", "minimum" : 0, - "default" : 0 + "required" : true }, "byteLength" : { - "type" : "number", - "description" : "The length of the buffer view, in bytes.", + "type" : "integer", + "description" : "The length of the buffer-view in bytes.", "minimum" : 0, - "required" : true + "default" : 0 }, "target" : { - "type" : "string", - "description" : "Required target type for bindBuffer(), must be ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER", - "enum" : ["ARRAY_BUFFER", "ELEMENT_ARRAY_BUFFER"], - "required" : true - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." + "type" : "integer", + "description" : "Valid values are 34962 (ARRAY_BUFFER) or 34963 (ELEMENT_ARRAY_BUFFER). When not provided, the buffer-view contains animation or skin data. WebGL: see bindBuffer().", + "enum" : [34962, 34963] } }, "additionalProperties" : false diff --git a/specification/camera.schema.json b/specification/camera.schema.json index 73f9e04879..73d1208b04 100644 --- a/specification/camera.schema.json +++ b/specification/camera.schema.json @@ -2,21 +2,22 @@ "$schema" : "http://json-schema.org/draft-03/schema", "title" : "camera", "type" : "object", - "description" : "A view into the scene. The camera describes the projection, but not the camera's position and direction.", + "description" : "A camera's projection.", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, "properties" : { - "name" : { - "type" : "string", - "description" : "The application-visible globally-unique name of this node." - }, "orthographic" : { - "$ref" : "orthographic.schema.json" + "extends" : { "$ref" : "cameraOrthographic.schema.json" }, + "description" : "An orthographic camera containing properties to create an orthographic projection matrix." }, "perspective" : { - "$ref" : "perspective.schema.json" + "extends" : { "$ref" : "cameraPerspective.schema.json" }, + "description" : "A perspective camera containing properties to create a perspective projection matrix." }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." + "type" : { + "type" : "string", + "description" : "Specifies if the camera uses a perspective or orthographic projection.", + "enum" : ["perspective", "orthographic"], + "required" : true } }, "additionalProperties" : false diff --git a/specification/orthographic.schema.json b/specification/cameraOrthographic.schema.json similarity index 70% rename from specification/orthographic.schema.json rename to specification/cameraOrthographic.schema.json index 7d4de2d336..35f6808487 100644 --- a/specification/orthographic.schema.json +++ b/specification/cameraOrthographic.schema.json @@ -1,32 +1,30 @@ { "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "orthographic", + "title" : "camera/orthographic", "type" : "object", - "description" : "An orthographic camera. These properties are used to create an orthographic projection matrix.", + "extends" : { "$ref" : "glTFProperty.schema.json" }, "properties" : { "xmag" : { "type" : "number", "description" : "The floating-point horizontal magnification of the view.", - "default" : 1.0 + "required" : true }, "ymag" : { "type" : "number", "description" : "The floating-point vertical magnification of the view.", - "default" : 1.0 + "required" : true }, "zfar" : { "type" : "number", "description" : "The floating-point distance to the far clipping plane.", + "required" : true, "minimum" : 0.0 }, "znear" : { "type" : "number", "description" : "The floating-point distance to the near clipping plane.", + "required" : true, "minimum" : 0.0 - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." } }, "additionalProperties" : false diff --git a/specification/perspective.schema.json b/specification/cameraPerspective.schema.json similarity index 72% rename from specification/perspective.schema.json rename to specification/cameraPerspective.schema.json index 8e22bb8781..0332e1b3c0 100644 --- a/specification/perspective.schema.json +++ b/specification/cameraPerspective.schema.json @@ -1,8 +1,8 @@ { "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "perspective", + "title" : "camera/perspective", "type" : "object", - "description" : "A perspective camera. These properties are used to create a perspective projection matrix.", + "extends" : { "$ref" : "glTFProperty.schema.json" }, "properties" : { "aspectRatio" : { "type" : "number", @@ -19,16 +19,14 @@ "zfar" : { "type" : "number", "description" : "The floating-point distance to the far clipping plane.", - "minimum" : 0.0 + "required" : true, + "exclusiveMinimum" : 0.0 }, "znear" : { "type" : "number", "description" : "The floating-point distance to the near clipping plane.", - "minimum" : 0.0 - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." + "required" : true, + "exclusiveMinimum" : 0.0 } }, "additionalProperties" : false diff --git a/specification/examples/accessors.json b/specification/examples/accessors.json new file mode 100644 index 0000000000..3239729805 --- /dev/null +++ b/specification/examples/accessors.json @@ -0,0 +1,23 @@ +{ + "accessors" : { + "an_accessor" : { + "bufferView" : "bufferViewWithVertices_id", + "byteOffset" : 0, + "byteStride" : 3, + "componentType" : 5126, + "count" : 1024, + "type" : "SCALAR", + "name": "user-defined accessor name", + "max" : [-1.0, -1.0, -1.0], + "min" : [1.0, 1.0, 1.0], + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/animations.json b/specification/examples/animations.json new file mode 100644 index 0000000000..f95d4d1772 --- /dev/null +++ b/specification/examples/animations.json @@ -0,0 +1,59 @@ +{ + "animations" : { + "an_animation": { + "channels": [ + { + "sampler": "a_sampler", + "target": { + "id": "node_id", + "path": "rotation", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + ], + "name": "user-defined animation name", + "parameters": { + "TIME": "time_accessor", + "rotation": "rotation_accessor" + }, + "samplers": { + "a_sampler": { + "input": "TIME", + "interpolation": "LINEAR", + "output": "rotation", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + }, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/asset.json b/specification/examples/asset.json new file mode 100644 index 0000000000..e461c440d3 --- /dev/null +++ b/specification/examples/asset.json @@ -0,0 +1,17 @@ +{ + "asset" : { + "copyright" : "(C) Copyright Khronos Group", + "generator" : "collada2gltf@042d7d2a3782aaf6d86961d052fc53bea8b3e424", + "premultipliedAlpha" : true, + "profile" : "WebGL 1.0.2", + "version" : 0.6, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } +} \ No newline at end of file diff --git a/specification/examples/asset/asset.json b/specification/examples/asset/asset.json deleted file mode 100644 index a2cf90a1ad..0000000000 --- a/specification/examples/asset/asset.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "copyright" : "(C) Copyright Khronos Group", - "geographicLocation" : { - "longitude" : 0.0, - "latitude" : 0.0, - "altitude" : 20.0, - "altitudeMode" : "relativeToGround" - }, - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} \ No newline at end of file diff --git a/specification/examples/attribute/attribute.json b/specification/examples/attribute/attribute.json deleted file mode 100644 index b2b5301c27..0000000000 --- a/specification/examples/attribute/attribute.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "semantic" : "POSITION", - "symbol" : "position", - "type" : "FLOAT_VEC3", - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} diff --git a/specification/examples/buffer/buffer.json b/specification/examples/buffer/buffer.json deleted file mode 100644 index b355bbcba1..0000000000 --- a/specification/examples/buffer/buffer.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "path" : "vertices.bin", - "byteLength": 1024, - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} \ No newline at end of file diff --git a/specification/examples/bufferView/bufferView.json b/specification/examples/bufferView/bufferView.json deleted file mode 100644 index d3f53929de..0000000000 --- a/specification/examples/bufferView/bufferView.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "buffer" : "buffer_id", - "byteOffset": 20000, - "byteLength": 1024, - "target": "ELEMENT_ARRAY_BUFFER", - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} \ No newline at end of file diff --git a/specification/examples/bufferViews.json b/specification/examples/bufferViews.json new file mode 100644 index 0000000000..15f0faac90 --- /dev/null +++ b/specification/examples/bufferViews.json @@ -0,0 +1,34 @@ +{ + "bufferViews" : { + "vertices_id" : { + "buffer" : "buffer_id", + "byteLength": 76768, + "byteOffset": 0, + "name": "user-defined name of buffer-view with vertices", + "target": 34962, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "indices_id" : { + "buffer" : "buffer_id", + "byteLength": 25272, + "byteOffset": 76768, + "name": "user-defined name of buffer-view with indices", + "target": 34963, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/buffers.json b/specification/examples/buffers.json new file mode 100644 index 0000000000..43bd32be3d --- /dev/null +++ b/specification/examples/buffers.json @@ -0,0 +1,18 @@ +{ + "buffers" : { + "verticesBuffer_id" : { + "uri" : "vertices.bin", + "byteLength": 1024, + "name": "user-defined buffer name", + "type" : "arraybuffer", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/camera/camera.json b/specification/examples/camera/camera.json deleted file mode 100644 index 849fa01f08..0000000000 --- a/specification/examples/camera/camera.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name" : "application-visible globally-unique name", - "perspective" : { - "aspectRatio" : 1.77, - "yfov" : 0.7854, - "zfar" : 1000, - "znear" : 1 - }, - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} \ No newline at end of file diff --git a/specification/examples/cameras.json b/specification/examples/cameras.json new file mode 100644 index 0000000000..d957883d88 --- /dev/null +++ b/specification/examples/cameras.json @@ -0,0 +1,40 @@ +{ + "cameras" : { + "perspectiveCamera_id" : { + "name" : "user-defined name of perspective camera", + "perspective" : { + "aspectRatio" : 1.77, + "yfov" : 0.7854, + "zfar" : 1000, + "znear" : 1 + }, + "type" : "perspective", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "orthographicCamera_id" : { + "name" : "user-defined name of orthographic camera", + "orthographic" : { + "xmag" : 0.5, + "ymag" : 0.5, + "zfar" : 1000, + "znear" : 1 + }, + "type" : "orthographic", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/extensions.json b/specification/examples/extensions.json new file mode 100644 index 0000000000..73761e0b94 --- /dev/null +++ b/specification/examples/extensions.json @@ -0,0 +1,25 @@ +{ + "allExtensions" : ["EXT_texture_filter_anisotropic", "Example root-level extension"], + "extensions" : { + "Example root-level extension" : { + "extension specific" : "value" + } + }, + "samplers" : { + "sampler_id": { + "magFilter": 9729, + "minFilter": 9987, + "name": "user-defined sampler name", + "wrapS": 10497, + "wrapT": 10497, + "extensions" : { + "EXT_texture_filter_anisotropic" : { + "maximumAnisotropy" : 8 + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/geographicLocation/geographicLocation.json b/specification/examples/geographicLocation/geographicLocation.json deleted file mode 100644 index ba7c4b0e34..0000000000 --- a/specification/examples/geographicLocation/geographicLocation.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "longitude" : 0.0, - "latitude" : 0.0, - "altitude" : 20.0, - "altitudeMode" : "relativeToGround", - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} \ No newline at end of file diff --git a/specification/examples/glTF/asset.json b/specification/examples/glTF/asset.json deleted file mode 100644 index 7ff60a4c78..0000000000 --- a/specification/examples/glTF/asset.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "asset" : { - "copyright" : "(C) Copyright Khronos Group" - }, - "version" : "0.1", - "profile" : "WebGL 1.0" -} \ No newline at end of file diff --git a/specification/examples/glTF/bufferViews.json b/specification/examples/glTF/bufferViews.json deleted file mode 100644 index 10bd78e5da..0000000000 --- a/specification/examples/glTF/bufferViews.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "bufferViews" : { - "vertices_id" : { - "buffer" : "buffer_id", - "byteLength": 76768, - "target": "ARRAY_BUFFER" - }, - "indices_id" : { - "buffer" : "buffer_id", - "byteLength": 25272, - "byteOffset": 76768, - "target": "ELEMENT_ARRAY_BUFFER" - } - }, - "version" : "0.1", - "profile" : "WebGL 1.0" -} \ No newline at end of file diff --git a/specification/examples/glTF/buffers.json b/specification/examples/glTF/buffers.json deleted file mode 100644 index 12c1417199..0000000000 --- a/specification/examples/glTF/buffers.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "buffers" : { - "verticesBuffer_id" : { - "path" : "vertices.bin", - "byteLength": 1024 - } - }, - "version" : "0.1", - "profile" : "WebGL 1.0" -} \ No newline at end of file diff --git a/specification/examples/glTF/cameras.json b/specification/examples/glTF/cameras.json deleted file mode 100644 index 22df4a4932..0000000000 --- a/specification/examples/glTF/cameras.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "cameras" : { - "perspectiveCamera_id" : { - "perspective" : { - "aspectRatio" : 1.77, - "yfov" : 0.7854, - "zfar" : 1000, - "znear" : 1 - } - }, - "orthographicCamera_id" : { - "orthographic" : { - "xmag" : 0.5, - "ymag" : 0.5, - "zfar" : 1000, - "znear" : 1 - } - } - }, - "version" : "0.1", - "profile" : "WebGL 1.0" -} \ No newline at end of file diff --git a/specification/examples/glTF/images.json b/specification/examples/glTF/images.json deleted file mode 100644 index c6e4f69dde..0000000000 --- a/specification/examples/glTF/images.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "images" : { - "image_id" : { - "path" : "image.png" - }, - "anotherImage_id" : { - "path" : "anotherImage.png", - "generateMipmap" : false, - "extra" : { - "Application specific" : "The extra object can contain any properties." - } - } - }, - "version" : "0.1", - "profile" : "WebGL 1.0" -} \ No newline at end of file diff --git a/specification/examples/glTF/materials.json b/specification/examples/glTF/materials.json deleted file mode 100644 index b6d3f78d68..0000000000 --- a/specification/examples/glTF/materials.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "materials" : { - "material_id" : { - "name" : "application-visible globally-unique name", - "technique" : "technique_id", - "techniques" : { - "technique_id" : { - "pass" : { - "program" : { - "attributes" : [{ - "semantic" : "POSITION", - "symbol" : "position", - "type" : "FLOAT_VEC3" - }], - "fragmentShader" : "fragmentShader_id", - "vertexShader" : "vertexShader_id" - } - } - } - } - } - }, - "version" : "0.1", - "profile" : "WebGL 1.0" -} \ No newline at end of file diff --git a/specification/examples/glTF/meshes.json b/specification/examples/glTF/meshes.json deleted file mode 100644 index 7d65c50369..0000000000 --- a/specification/examples/glTF/meshes.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "meshes" : { - "mesh_id" : { - "attributes" : { - "attribute_id" : { - "bufferView" : "bufferViewWithVertices_id", - "byteOffset" : 0, - "byteStride" : 3, - "count" : 1024, - "type" : "FLOAT_VEC3", - "normalized" : false, - "max" : [-1.0, -1.0, -1.0], - "min" : [1.0, 1.0, 1.0] - } - }, - "name" : "application-visible globally-unique name", - "primitives" : [{ - "indices" : { - "bufferView" : "bufferViewWithIndices_id", - "byteOffset" : 0, - "count" : 1024, - "type" : "UNSIGNED_SHORT" - }, - "material" : "material_id", - "primitive" : "TRIANGLES", - "semantics" : { - "POSITION" : "attribute_id" - } - }] - } - }, - "version" : "0.1", - "profile" : "WebGL 1.0" -} \ No newline at end of file diff --git a/specification/examples/glTF/nodes.json b/specification/examples/glTF/nodes.json deleted file mode 100644 index 5940a740c1..0000000000 --- a/specification/examples/glTF/nodes.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "nodes" : { - "parent_id" : { - "children" : ["child_id"], - "matrix" : [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], - "meshes" : ["mesh_id"] - }, - "child_id" : { - "matrix" : [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], - "meshes" : ["anotherMesh_id"] - } - }, - "version" : "0.1", - "profile" : "WebGL 1.0" -} \ No newline at end of file diff --git a/specification/examples/glTF/shaders.json b/specification/examples/glTF/shaders.json deleted file mode 100644 index e89d01817e..0000000000 --- a/specification/examples/glTF/shaders.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "shaders" : { - "lambertVS_id" : { - "path" : "lambertVS.glsl" - }, - "lambertFS_id" : { - "path" : "lambertFS.glsl" - } - }, - "version" : "0.1", - "profile" : "WebGL 1.0" -} \ No newline at end of file diff --git a/specification/examples/glTF/techniques.json b/specification/examples/glTF/techniques.json deleted file mode 100644 index 2c0eb323d8..0000000000 --- a/specification/examples/glTF/techniques.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "techniques" : { - "technique_id" : { - "pass" : { - "program" : { - "attributes" : [{ - "semantic" : "POSITION", - "symbol" : "position", - "type" : "FLOAT_VEC3" - }], - "fragmentShader" : "fragmentShader_id", - "vertexShader" : "vertexShader_id" - } - } - } - }, - "version" : "0.1", - "profile" : "WebGL 1.0" -} \ No newline at end of file diff --git a/specification/examples/image/image.json b/specification/examples/image/image.json deleted file mode 100644 index f0e64b2b08..0000000000 --- a/specification/examples/image/image.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name" : "application-visible globally-unique name", - "path" : "example.png", - "generateMipmap" : false, - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} \ No newline at end of file diff --git a/specification/examples/images.json b/specification/examples/images.json new file mode 100644 index 0000000000..157978dd35 --- /dev/null +++ b/specification/examples/images.json @@ -0,0 +1,16 @@ +{ + "images" : { + "image_id" : { + "name": "user-defined image name", + "uri" : "image.png", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/indices/indices.json b/specification/examples/indices/indices.json deleted file mode 100644 index 65e105f80c..0000000000 --- a/specification/examples/indices/indices.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "bufferView" : "bufferViewWithIndices_id", - "byteOffset" : 0, - "count" : 1024, - "type" : "UNSIGNED_SHORT", - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} diff --git a/specification/examples/lights.json b/specification/examples/lights.json new file mode 100644 index 0000000000..466ce7e57c --- /dev/null +++ b/specification/examples/lights.json @@ -0,0 +1,120 @@ +{ + "lights" : { + "ambient_light_id": { + "ambient": { + "color": [ + 1.0, + 1.0, + 1.0 + ], + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "name": "user-defined name of ambient light", + "type": "ambient", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "directional_light_id": { + "directional": { + "color": [ + 1.0, + 1.0, + 1.0 + ], + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "name": "user-defined name of directional light", + "type": "directional", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "point_light_id": { + "name": "user-defined name of point light", + "point": { + "color": [ + 1.0, + 1.0, + 1.0 + ], + "constantAttenuation": 1.0, + "linearAttenuation": 0.5, + "quadraticAttenuation": 0.25, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "type": "point", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "spot_light_id": { + "name": "user-defined name of spot light", + "spot": { + "color": [ + 1.0, + 1.0, + 1.0 + ], + "constantAttenuation": 1.0, + "fallOffAngle": 40, + "fallOffExponent": 0.0, + "linearAttenuation": 0.5, + "quadraticAttenuation": 0.25, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "type": "spot", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/material/material.json b/specification/examples/material/material.json deleted file mode 100644 index b1629224b3..0000000000 --- a/specification/examples/material/material.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name" : "application-visible globally-unique name", - "parameters" : { - }, - "technique" : "technique_id", - "techniques" : { - "technique_id" : { - "pass" : { - "program" : { - "attributes" : [{ - "semantic" : "POSITION", - "symbol" : "position", - "type" : "FLOAT_VEC3" - }], - "fragmentShader" : "fragmentShader_id", - "vertexShader" : "vertexShader_id" - } - } - } - }, - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} diff --git a/specification/examples/materials.json b/specification/examples/materials.json new file mode 100644 index 0000000000..0ebf8e5c1e --- /dev/null +++ b/specification/examples/materials.json @@ -0,0 +1,36 @@ +{ + "materials" : { + "material_id": { + "instanceTechnique": { + "technique": "technique_id", + "values": { + "ambient": [ + 0, + 0, + 0, + 1 + ], + "diffuse": "texture_image_0", + "shininess": 38.4 + }, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "name": "user-defined material name", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/mesh/mesh.json b/specification/examples/mesh/mesh.json deleted file mode 100644 index 5f7bf42798..0000000000 --- a/specification/examples/mesh/mesh.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "attributes" : { - "attribute_id" : { - "bufferView" : "bufferViewWithVertices_id", - "byteOffset" : 0, - "byteStride" : 3, - "count" : 1024, - "type" : "FLOAT_VEC3", - "normalized" : false, - "max" : [-1.0, -1.0, -1.0], - "min" : [1.0, 1.0, 1.0] - } - }, - "name" : "application-visible globally-unique name", - "primitives" : [{ - "indices" : { - "bufferView" : "bufferViewWithIndices_id", - "byteOffset" : 0, - "count" : 1024, - "type" : "UNSIGNED_SHORT" - }, - "material" : "material_id", - "primitive" : "TRIANGLES", - "semantics" : { - "POSITION" : "attribute_id" - } - }], - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} diff --git a/specification/examples/meshAttribute/meshAttribute.json b/specification/examples/meshAttribute/meshAttribute.json deleted file mode 100644 index 7e8edb717b..0000000000 --- a/specification/examples/meshAttribute/meshAttribute.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "bufferView" : "bufferViewWithVertices_id", - "byteOffset" : 0, - "byteStride" : 3, - "count" : 1024, - "type" : "FLOAT_VEC3", - "normalized" : false, - "max" : [-1.0, -1.0, -1.0], - "min" : [1.0, 1.0, 1.0], - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} diff --git a/specification/examples/meshes.json b/specification/examples/meshes.json new file mode 100644 index 0000000000..dce2cef3ff --- /dev/null +++ b/specification/examples/meshes.json @@ -0,0 +1,35 @@ +{ + "meshes" : { + "mesh_id": { + "name": "user-defined name of mesh", + "primitives": [ + { + "attributes": { + "NORMAL": "accessor_id0", + "POSITION": "accessor_id1", + "TEXCOORD_0": "accessor_id2" + }, + "indices": "accessor_id3", + "material": "material_id", + "primitive": 4, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + ], + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/node/meshes.json b/specification/examples/node/meshes.json deleted file mode 100644 index 58d21537dd..0000000000 --- a/specification/examples/node/meshes.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "children" : ["child_id", "anotherChild_id"], - "matrix" : [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], - "meshes" : ["mesh_id"], - "name" : "application-visible globally-unique name", - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} \ No newline at end of file diff --git a/specification/examples/node/meshesLeaf.json b/specification/examples/node/meshesLeaf.json deleted file mode 100644 index 2c7706d2a8..0000000000 --- a/specification/examples/node/meshesLeaf.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "matrix" : [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], - "meshes" : ["mesh_id"] -} \ No newline at end of file diff --git a/specification/examples/nodes.json b/specification/examples/nodes.json new file mode 100644 index 0000000000..964f2ae5be --- /dev/null +++ b/specification/examples/nodes.json @@ -0,0 +1,72 @@ +{ + "nodes" : { + "meshes_node_id": { + "children": [], + "matrix": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ], + "meshes": [ + "mesh_id" + ], + "name": "user-defined name of meshes node", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "trs_node_id": { + "children": ["meshes_node_id"], + "meshes": [ + "mesh_id" + ], + "name": "user-defined name of trs node", + "rotation" : [ 1.0, 0.0, 0.0, 0.0 ], + "scale" : [ 1.0, 1.0, 1.0 ], + "translation" : [ 0.0, 0.0, 0.0 ] + }, + "camera_node_id": { + "camera": "camera_id", + "children": [], + "matrix": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ], + "name": "user-defined name of camera node" + }, + "light_node_id": { + "children": [], + "light": "light_id", + "matrix": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ], + "name": "user-defined name of light node" + }, + "skin_node_id": { + "children": [], + "instanceSkin": { + "skeletons": [ + "joint id in skin" + ], + "skin": "skin_id", + "sources": [ + "skin_mesh_id" + ], + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "matrix": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ], + "name": "user-defined name of skin node" + }, + "joint_node_id": { + "children": [], + "joint": "joint id", + "name": "user-defined name of joint node", + "rotation" : [ 1.0, 0.0, 0.0, 0.0 ], + "scale" : [ 1.0, 1.0, 1.0 ], + "translation" : [ 0.0, 0.0, 0.0 ] + } + } +} \ No newline at end of file diff --git a/specification/examples/orthographic/orthographic.json b/specification/examples/orthographic/orthographic.json deleted file mode 100644 index c212d2e93d..0000000000 --- a/specification/examples/orthographic/orthographic.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "xmag" : 0.5, - "ymag" : 0.5, - "zfar" : 1000, - "znear" : 1, - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} \ No newline at end of file diff --git a/specification/examples/parameters/parameters.json b/specification/examples/parameters/parameters.json deleted file mode 100644 index 16e06a7092..0000000000 --- a/specification/examples/parameters/parameters.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} diff --git a/specification/examples/pass/pass.json b/specification/examples/pass/pass.json deleted file mode 100644 index 171adcb130..0000000000 --- a/specification/examples/pass/pass.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "program" : { - "attributes" : [{ - "semantic" : "POSITION", - "symbol" : "position", - "type" : "FLOAT_VEC3" - }], - "fragmentShader" : "fragmentShader_id", - "vertexShader" : "vertexShader_id" - }, - "states" : { - "depthTestEnable" : true - }, - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} \ No newline at end of file diff --git a/specification/examples/perspective/perspective.json b/specification/examples/perspective/perspective.json deleted file mode 100644 index 9879e3edeb..0000000000 --- a/specification/examples/perspective/perspective.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "aspectRatio" : 1.77, - "yfov" : 0.7854, - "zfar" : 1000, - "znear" : 1, - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} \ No newline at end of file diff --git a/specification/examples/primitive/primitive.json b/specification/examples/primitive/primitive.json deleted file mode 100644 index 9880a42967..0000000000 --- a/specification/examples/primitive/primitive.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "indices" : { - "bufferView" : "bufferViewWithIndices_id", - "byteOffset" : 0, - "count" : 1024, - "type" : "UNSIGNED_SHORT" - }, - "material" : "material_id", - "primitive" : "TRIANGLES", - "semantics" : { - "POSITION" : "attribute_id", - "NORMAL" : "anotherAttribute_id" - }, - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} diff --git a/specification/examples/program/program.json b/specification/examples/program/program.json deleted file mode 100644 index 6de1d66e37..0000000000 --- a/specification/examples/program/program.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "attributes" : [{ - "semantic" : "POSITION", - "symbol" : "position", - "type" : "FLOAT_VEC3" - }], - "fragmentShader" : "fragmentShader_id", - "uniforms" : [], - "vertexShader" : "vertexShader_id", - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} diff --git a/specification/examples/programs.json b/specification/examples/programs.json new file mode 100644 index 0000000000..1a96d9f9ea --- /dev/null +++ b/specification/examples/programs.json @@ -0,0 +1,21 @@ +{ + "programs" : { + "program_id": { + "attributes": [ + "a_normal", + "a_position" + ], + "fragmentShader": "fs_id", + "name": "user-defined program name", + "vertexShader": "vs_id", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/samplers.json b/specification/examples/samplers.json new file mode 100644 index 0000000000..1d404e5663 --- /dev/null +++ b/specification/examples/samplers.json @@ -0,0 +1,19 @@ +{ + "samplers" : { + "sampler_id": { + "magFilter": 9729, + "minFilter": 9987, + "name": "user-defined sampler name", + "wrapS": 10497, + "wrapT": 10497, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/scenes.json b/specification/examples/scenes.json new file mode 100644 index 0000000000..fc5c8923cd --- /dev/null +++ b/specification/examples/scenes.json @@ -0,0 +1,21 @@ +{ + "scene" : "defaultScene", + "scenes" : { + "defaultScene": { + "name": "user-defined scene name", + "nodes": [ + "mesh_node_id", + "camera_node_id", + "light_node_id" + ], + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/semantics/semantics.json b/specification/examples/semantics/semantics.json deleted file mode 100644 index aaff17a610..0000000000 --- a/specification/examples/semantics/semantics.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "POSITION" : "positions", - "NORMAL" : "normals", - "TEXCOORD_0" : "uvLightmap", - "TEXCOORD_1" : "uvDiffuse", - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} diff --git a/specification/examples/shader/dataUri.json b/specification/examples/shader/dataUri.json deleted file mode 100644 index 693347350d..0000000000 --- a/specification/examples/shader/dataUri.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path" : "data:,void%20main()%7Bgl_FragColor%3Dvec4(1.0)%3B" -} \ No newline at end of file diff --git a/specification/examples/shader/shader.json b/specification/examples/shader/shader.json deleted file mode 100644 index 53791d9ef6..0000000000 --- a/specification/examples/shader/shader.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name" : "application-visible globally-unique name", - "path" : "vertexShader.glsl", - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} \ No newline at end of file diff --git a/specification/examples/shaders.json b/specification/examples/shaders.json new file mode 100644 index 0000000000..5a2615351b --- /dev/null +++ b/specification/examples/shaders.json @@ -0,0 +1,27 @@ +{ + "shaders" : { + "vs_id" : { + "name": "user-defined vertex shader name", + "uri" : "vertexshader.glsl", + "type": 35633, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "fs_id" : { + "name": "user-defined fragment shader name", + "uri" : "fragmentshader.glsl", + "type": 35632 + }, + "fs_data_uri_id" : { + "name": "user-defined fragment shader with a data uri name", + "uri" : "data:,void%20main()%7Bgl_FragColor%3Dvec4(1.0)%3B", + "type": 35632 + } + } +} \ No newline at end of file diff --git a/specification/examples/skins.json b/specification/examples/skins.json new file mode 100644 index 0000000000..58b9aca5ee --- /dev/null +++ b/specification/examples/skins.json @@ -0,0 +1,38 @@ +{ + "skins" : { + "skin_id": { + "bindShapeMatrix": [ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ], + "inverseBindMatrices": "accessor_id", + "joints": [ + "joint_id", + "another_joint_id" + ], + "name": "user-defined skin name", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/states/closedOpaqueObject.json b/specification/examples/states/closedOpaqueObject.json deleted file mode 100644 index d5bf490210..0000000000 --- a/specification/examples/states/closedOpaqueObject.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "cullFaceEnable" : true, - "depthTestEnable" : true -} \ No newline at end of file diff --git a/specification/examples/states/depthTest.json b/specification/examples/states/depthTest.json deleted file mode 100644 index e33edea599..0000000000 --- a/specification/examples/states/depthTest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "depthTestEnable" : true -} \ No newline at end of file diff --git a/specification/examples/states/states.json b/specification/examples/states/states.json deleted file mode 100644 index c8b52dc149..0000000000 --- a/specification/examples/states/states.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "blendEnable" : false, - "blendEquation" : "FUNC_ADD", - "blendEquationSeparate" : { - "rgb" : "FUNC_ADD", - "alpha" : "FUNC_ADD" - }, - "blendFunc" : { - "sfactor" : "ONE", - "dfactor" : "ZERO" - }, - "blendFuncSeparate" : { - "srcRGB" : "ONE", - "srcAlpha" : "ONE", - "dstRGB" : "ZERO", - "dstAlpha" : "ZERO" - }, - "colorMask" : { - "red" : true, - "green" : true, - "blue" : true, - "alpha" : true - }, - "cullFace" : "BACK", - "cullFaceEnable" : false, - "depthFunc" : "LESS", - "depthMask" : true, - "depthRange" : { - "zNear" : 0.0, - "zFar" : 1.0 - }, - "depthTestEnable" : false, - "ditherEnable" : false, - "frontFace" : "CCW", - "lineWidth" : 1.0, - "pointSize" : 1.0, - "polygonOffset" : { - "factor" : 0.0, - "units" : 0.0 - }, - "polygonOffsetFillEnable" : false, - "sampleAlphaToCoverageEnable" : false, - "sampleCoverage" : { - "value" : 1.0, - "invert" : false - }, - "sampleCoverageEnable" : false, - "scissor" : { - "x" : 0, - "y" : 0, - "width" : 0, - "height" : 0 - }, - "scissorTestEnable" : false, - "stencilFunc" : { - "func" : "ALWAYS", - "ref" : 0, - "mask" : 0 - }, - "stencilFuncSeparate" : { - "front" : "ALWAYS", - "back" : "ALWAYS", - "ref" : 0, - "mask" : 0 - }, - "stencilMask" : 0, - "stencilOp" : { - "fail" : "KEEP", - "zfail" : "KEEP", - "zpass" : "KEEP" - }, - "stencilOpSeparate" : { - "face" : "FRONT_AND_BACK", - "fail" : "KEEP", - "zfail" : "KEEP", - "zpass" : "KEEP" - }, - "stencilTestEnable" : false, - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} diff --git a/specification/examples/states/translucency.json b/specification/examples/states/translucency.json deleted file mode 100644 index 236ec95f62..0000000000 --- a/specification/examples/states/translucency.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "depthTestEnable" : true, - "depthMask" : false, - "blendEnable" : true, - "blendEquation" : "FUNC_ADD", - "blendFunc" : { - "sfactor" : "SRC_ALPHA", - "dfactor" : "ONE_MINUS_SRC_ALPHA" - } -} \ No newline at end of file diff --git a/specification/examples/technique/technique.json b/specification/examples/technique/technique.json deleted file mode 100644 index 9fcc9fde49..0000000000 --- a/specification/examples/technique/technique.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parameters" : { - }, - "pass" : { - "program" : { - "attributes" : [{ - "semantic" : "POSITION", - "symbol" : "position", - "type" : "FLOAT_VEC3" - }], - "fragmentShader" : "fragmentShader_id", - "vertexShader" : "vertexShader_id" - } - }, - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} diff --git a/specification/examples/techniques.json b/specification/examples/techniques.json new file mode 100644 index 0000000000..343d2ce3a7 --- /dev/null +++ b/specification/examples/techniques.json @@ -0,0 +1,189 @@ +{ + "techniques" : { + "technique_id" : { + "name": "user-defined technique name", + "parameters": { + "ambient": { + "type": 35666, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "diffuse": { + "type": 35678 + }, + "lightColor": { + "type": 35665, + "value": [ + 1, + 1, + 1 + ] + }, + "lightTransform": { + "node": "directional_light_node_id", + "type": 35676 + }, + "modelViewMatrix": { + "semantic": "MODELVIEW", + "type": 35676 + }, + "projectionMatrix": { + "semantic": "PROJECTION", + "type": 35676 + }, + "normalMatrix": { + "semantic": "MODELVIEWINVERSETRANSPOSE", + "type": 35675 + }, + + "position": { + "semantic": "POSITION", + "type": 35665 + }, + "normal": { + "semantic": "NORMAL", + "type": 35665 + }, + "texcoord": { + "semantic": "TEXCOORD_0", + "type": 35664 + }, + + "joint": { + "semantic": "JOINT", + "type": 35666 + }, + "jointMatrix": { + "semantic": "JOINTMATRIX", + "type": 35676 + }, + "weight": { + "semantic": "WEIGHT", + "type": 35666 + } + }, + "pass" : "pass_id", + "passes" : { + "pass_id" : { + "details": { + "commonProfile": { + "lightingModel": "Blinn", + "parameters": [ + "ambient", + "diffuse", + "lightColor", + "lightTransform", + "modelViewMatrix", + "projectionMatrix", + "normalMatrix" + ], + "texcoordBindings": { + "diffuse": "TEXCOORD_0" + }, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras": { + "doubleSided": false + } + }, + "type": "COLLADA-1.4.1/commonProfile", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "instanceProgram": { + "attributes": { + "a_position": "position", + "a_normal": "normal", + "a_texcoord0": "texcoord0", + "a_joint": "joint", + "a_jointMatrix": "jointMatrix", + "a_weight": "weight" + }, + "program": "program_id", + "uniforms": { + "u_ambient": "ambient", + "u_diffuse": "diffuse", + "u_lightColor": "lightColor", + "u_lightTransformMatrix": "lightTransform", + "u_modelViewMatrix": "modelViewMatrix", + "u_projectionMatrix": "projectionMatrix", + "u_normalMatrix": "normalMatrix" + }, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "states" : { + "enable" : [3042, 2884, 2929, 32823, 32926, 3089], + "functions" : { + "blendColor": [0.0, 0.0, 0.0, 0.0], + "blendEquationSeparate" : [32774, 32774], + "blendFuncSeparate" : [1, 1, 0, 0], + "colorMask" : [true, true, true, true], + "cullFace" : [1029], + "depthFunc" : [513], + "depthMask" : [true], + "depthRange" : [0.0, 1.0], + "frontFace" : [2305], + "lineWidth" : [1.0], + "polygonOffset" : [0.0, 0.0], + "scissor" : [0, 0, 0, 0], + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + }, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + }, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/textures.json b/specification/examples/textures.json new file mode 100644 index 0000000000..267693d165 --- /dev/null +++ b/specification/examples/textures.json @@ -0,0 +1,21 @@ +{ + "textures" : { + "texture_id": { + "format": 6408, + "internalFormat": 6408, + "name": "user-defined texture name", + "sampler": "sampler_id", + "source": "image_id", + "target": 3553, + "type": 5121, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } + } +} \ No newline at end of file diff --git a/specification/examples/uniform/uniform.json b/specification/examples/uniform/uniform.json deleted file mode 100644 index c9a002e746..0000000000 --- a/specification/examples/uniform/uniform.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "semantic" : "MODELVIEW", - "symbol" : "modelView", - "type" : "FLOAT_MAT4", - "extra" : { - "Application specific" : "The extra object can contain any properties." - } -} diff --git a/specification/extension.schema.json b/specification/extension.schema.json new file mode 100644 index 0000000000..a88d996134 --- /dev/null +++ b/specification/extension.schema.json @@ -0,0 +1,6 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "extension", + "type" : "object", + "description" : "Properties specific an extension." +} diff --git a/specification/extensions/geolocation/asset.schema.json b/specification/extensions/geolocation/asset.schema.json new file mode 100644 index 0000000000..2f4c38c124 --- /dev/null +++ b/specification/extensions/geolocation/asset.schema.json @@ -0,0 +1,11 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "asset", + "type" : "object", + "description" : "Adds geographicLocation property to glTF asset property for the geolocation extension.", + "properties" : { + "geographicLocation" : { + "$ref" : "geographicLocation.schema.json" + } + } +} diff --git a/specification/extensions/geolocation/example/example.json b/specification/extensions/geolocation/example/example.json new file mode 100644 index 0000000000..f332a40430 --- /dev/null +++ b/specification/extensions/geolocation/example/example.json @@ -0,0 +1,16 @@ +{ + "geographicLocation" : { + "longitude" : 0.0, + "latitude" : 0.0, + "altitude" : 20.0, + "altitudeMode" : "relativeToGround", + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." + } + } +} \ No newline at end of file diff --git a/specification/geographicLocation.schema.json b/specification/extensions/geolocation/geographicLocation.schema.json similarity index 85% rename from specification/geographicLocation.schema.json rename to specification/extensions/geolocation/geographicLocation.schema.json index e51675015e..f5b16a8213 100644 --- a/specification/geographicLocation.schema.json +++ b/specification/extensions/geolocation/geographicLocation.schema.json @@ -25,9 +25,15 @@ "enum" : ["absolute", "relativeToGround"], "default" : "relativeToGround" }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." + "extensions" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "../../extension.schema.json" + } + }, + "extras" : { + "$ref" : "../../extras.schema.json" } }, "additionalProperties" : false diff --git a/specification/extras.schema.json b/specification/extras.schema.json new file mode 100644 index 0000000000..0a989f0aab --- /dev/null +++ b/specification/extras.schema.json @@ -0,0 +1,6 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "extras", + "type" : "any", + "description" : "Optional application-specific data." +} diff --git a/specification/glTF.schema.json b/specification/glTF.schema.json index 0e695da944..d391e1e312 100644 --- a/specification/glTF.schema.json +++ b/specification/glTF.schema.json @@ -2,97 +2,167 @@ "$schema" : "http://json-schema.org/draft-03/schema", "title" : "glTF", "type" : "object", - "description" : "The glTF model.", + "description" : "Root glTF property.", + "extends" : { "$ref" : "glTFProperty.schema.json" }, "properties" : { + "allExtensions" : { + "type" : "array", + "description" : "Names of extensions used throughout model. WebGL: see getSupportedExtensions() and getExtension().", + "items" : { + "type" : "string" + }, + "uniqueItems" : true, + "default" : [] + }, + "accessors" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "accessor.schema.json" + }, + "default" : {} + }, + "animations" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "animation.schema.json" + }, + "default" : {} + }, "asset" : { - "$ref" : "asset.schema.json" + "extends" : { "$ref" : "asset.schema.json" }, + "description" : "Asset-management information.", + "default" : {} }, "buffers" : { - "description" : "The buffers used in this model.", "properties" : { }, "additionalProperties" : { "$ref" : "buffer.schema.json" - } + }, + "default" : {} }, "bufferViews" : { - "description" : "The buffer views used in this model.", "properties" : { }, "additionalProperties" : { "$ref" : "bufferView.schema.json" - } + }, + "default" : {} }, "cameras" : { - "description" : "The cameras available to this model.", "properties" : { }, "additionalProperties" : { "$ref" : "camera.schema.json" - } + }, + "default" : {} }, "images" : { - "description" : "The images used in this model.", "properties" : { }, "additionalProperties" : { "$ref" : "image.schema.json" - } + }, + "default" : {} + }, + "lights" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "light.schema.json" + }, + "default" : {} }, "materials" : { - "description" : "The materials used in this model.", "properties" : { }, "additionalProperties" : { "$ref" : "material.schema.json" - } + }, + "default" : {} }, "meshes" : { - "description" : "The meshes that make up this model.", "properties" : { }, "additionalProperties" : { "$ref" : "mesh.schema.json" - } + }, + "default" : {} }, "nodes" : { - "description" : "The nodes that make up this model.", "properties" : { }, "additionalProperties" : { "$ref" : "node.schema.json" - } + }, + "default" : {} + }, + "programs" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "program.schema.json" + }, + "default" : {} + }, + "samplers" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "sampler.schema.json" + }, + "default" : {} + }, + "scene" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the default scene." + }, + "scenes" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "scene.schema.json" + }, + "default" : {} }, "shaders" : { - "description" : "The shaders used in this model.", "properties" : { }, "additionalProperties" : { "$ref" : "shader.schema.json" - } + }, + "default" : {} + }, + "skins" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "skin.schema.json" + }, + "default" : {} }, "techniques" : { - "description" : "The techniques used in this model.", "properties" : { }, "additionalProperties" : { "$ref" : "technique.schema.json" - } - }, - "version" : { - "type" : "string", - "description" : "The glTF version.", - "required" : true - }, - "profile" : { - "type" : "string", - "description" : "The glTF profile used for this asset.", - "required" : true - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." + }, + "default" : {} + }, + "textures" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "texture.schema.json" + }, + "default" : {} } }, + "dependencies" : { + "scene" : "scenes", + "scenes" : "scene" + }, "additionalProperties" : false } diff --git a/specification/glTFChildOfRootProperty.schema.json b/specification/glTFChildOfRootProperty.schema.json new file mode 100644 index 0000000000..127d9d2c00 --- /dev/null +++ b/specification/glTFChildOfRootProperty.schema.json @@ -0,0 +1,12 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "Child of a glTF root property", + "type" : "object", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "name" : { + "type" : "string", + "description" : "The user-defined name of this object. This is not necessarily unique among objects in the parent property, e.g., accessors, buffers, etc." + } + } +} diff --git a/specification/glTFProperty.schema.json b/specification/glTFProperty.schema.json new file mode 100644 index 0000000000..19b02d3f65 --- /dev/null +++ b/specification/glTFProperty.schema.json @@ -0,0 +1,17 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "glTF property", + "type" : "object", + "properties" : { + "extensions" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "extension.schema.json" + } + }, + "extras" : { + "$ref" : "extras.schema.json" + } + } +} diff --git a/specification/glTFid.schema.json b/specification/glTFid.schema.json new file mode 100644 index 0000000000..90ebed733c --- /dev/null +++ b/specification/glTFid.schema.json @@ -0,0 +1,6 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "glTF id", + "type" : "string", + "minLength" : 1 +} diff --git a/specification/image.schema.json b/specification/image.schema.json index 1866a60d59..1cd7633027 100644 --- a/specification/image.schema.json +++ b/specification/image.schema.json @@ -2,26 +2,14 @@ "$schema" : "http://json-schema.org/draft-03/schema", "title" : "image", "type" : "object", - "description" : "An image.", + "description" : "Image data used to create a texture.", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, "properties" : { - "path" : { + "uri" : { "type" : "string", - "description" : "The URL of the image. Relative URLs are relative to the .json file that references the image. Instead of referencing an external image, the URL can also be a data URI.", + "description" : "The uri of the image. Relative paths are relative to the .json file. Instead of referencing an external file, the uri can also be a data-uri. WebGL 1.0.2 Profile: allows only .png and .jpg.", "format" : "uri", "required" : true - }, - "generateMipmap" : { - "type" : "boolean", - "description" : "generateMipmap()", - "default" : true - }, - "name" : { - "type" : "string", - "description" : "The application-visible globally-unique name of this node." - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." } }, "additionalProperties" : false diff --git a/specification/index.html b/specification/index.html index 6b78f11ba3..2cff8c3aa1 100644 --- a/specification/index.html +++ b/specification/index.html @@ -69,36 +69,11 @@

glTF Validator

-
@@ -109,44 +84,25 @@

glTF Validator

diff --git a/specification/indices.schema.json b/specification/indices.schema.json deleted file mode 100644 index 3c0aeaa29e..0000000000 --- a/specification/indices.schema.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "indices", - "type" : "object", - "description" : "drawElements()", - "properties" : { - "bufferView" : { - "type" : "string", - "description" : "The id (JSON property name) of the bufferView to reference for index data.", - "required" : true - }, - "byteOffset" : { - "type" : "number", - "description" : "The offset relative to the bufferView in bytes. Similar to drawElements indices (ES) / offset (WebGL) parameter.", - "minimum" : 0, - "required" : true - }, - "count" : { - "type" : "number", - "description" : "The number of indices referenced, not to be confused with the number of bytes. The drawElements count parameter.", - "minimum" : 0, - "required" : true - }, - "type" : { - "type" : "string", - "description" : "drawElements() type parameter. Corresponding typed array: Uint16Array.", - "enum" : ["UNSIGNED_SHORT"], - "required" : true - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." - } - }, - "additionalProperties" : false -} diff --git a/specification/light.schema.json b/specification/light.schema.json new file mode 100644 index 0000000000..e0dd5d9d38 --- /dev/null +++ b/specification/light.schema.json @@ -0,0 +1,32 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "light", + "type" : "object", + "description" : "An ambient, directional, point, or spot light.", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, + "properties" : { + "ambient" : { + "extends" : { "$ref" : "lightAmbient.schema.json" }, + "description" : "Ambient light source." + }, + "directional" : { + "extends" : { "$ref" : "lightDirectional.schema.json" }, + "description" : "Directional light source." + }, + "point" : { + "extends" : { "$ref" : "lightPoint.schema.json" }, + "description" : "Point light source." + }, + "spot" : { + "extends" : { "$ref" : "lightSpot.schema.json" }, + "description" : "Spot light source." + }, + "type" : { + "type" : "string", + "description" : "Specifies the light type.", + "enum" : ["ambient", "directional", "point", "spot"], + "required" : true + } + }, + "additionalProperties" : false +} diff --git a/specification/lightAmbient.schema.json b/specification/lightAmbient.schema.json new file mode 100644 index 0000000000..748fb5e39c --- /dev/null +++ b/specification/lightAmbient.schema.json @@ -0,0 +1,21 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "light/ambient", + "type" : "object", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "color" : { + "type" : "array", + "description" : "RGB color of the light source. Each element is floating-point between 0.0 and 1.0. Element 0 corresponds to R, 1 to G, and 2 to B.", + "items" : { + "type": "number", + "minimum" : 0.0, + "maximum" : 1.0 + }, + "minItems" : 3, + "maxItems" : 3, + "default" : [1.0, 1.0, 1.0] + } + }, + "additionalProperties" : false +} diff --git a/specification/lightDirectional.schema.json b/specification/lightDirectional.schema.json new file mode 100644 index 0000000000..7fbd5ee938 --- /dev/null +++ b/specification/lightDirectional.schema.json @@ -0,0 +1,21 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "light/directional", + "type" : "object", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "color" : { + "type" : "array", + "description" : "RGB color of the light source. Each element is floating-point between 0.0 and 1.0. Element 0 corresponds to R, 1 to G, and 2 to B.", + "items" : { + "type": "number", + "minimum" : 0.0, + "maximum" : 1.0 + }, + "minItems" : 3, + "maxItems" : 3, + "default" : [1.0, 1.0, 1.0] + } + }, + "additionalProperties" : false +} diff --git a/specification/lightPoint.schema.json b/specification/lightPoint.schema.json new file mode 100644 index 0000000000..6736dc9a86 --- /dev/null +++ b/specification/lightPoint.schema.json @@ -0,0 +1,36 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "light/point", + "type" : "object", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "color" : { + "type" : "array", + "description" : "RGB color of the light source. Each element is floating-point between 0.0 and 1.0. Element 0 corresponds to R, 1 to G, and 2 to B.", + "items" : { + "type": "number", + "minimum" : 0.0, + "maximum" : 1.0 + }, + "minItems" : 3, + "maxItems" : 3, + "default" : [1.0, 1.0, 1.0] + }, + "constantAttenuation" : { + "type" : "number", + "description" : "Constant attenuation factor.", + "default" : 1.0 + }, + "linearAttenuation" : { + "type" : "number", + "description" : "Linear attenuation factor.", + "default" : 0.0 + }, + "quadraticAttenuation" : { + "type" : "number", + "description" : "Quadratic attenuation factor.", + "default" : 0.0 + } + }, + "additionalProperties" : false +} diff --git a/specification/lightSpot.schema.json b/specification/lightSpot.schema.json new file mode 100644 index 0000000000..b8c1b9b76c --- /dev/null +++ b/specification/lightSpot.schema.json @@ -0,0 +1,46 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "light/spot", + "type" : "object", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "color" : { + "type" : "array", + "description" : "RGB color of the light source. Each element is floating-point between 0.0 and 1.0. Element 0 corresponds to R, 1 to G, and 2 to B.", + "items" : { + "type": "number", + "minimum" : 0.0, + "maximum" : 1.0 + }, + "minItems" : 3, + "maxItems" : 3, + "default" : [1.0, 1.0, 1.0] + }, + "constantAttenuation" : { + "type" : "number", + "description" : "Constant attenuation factor.", + "default" : 1.0 + }, + "fallOffAngle" : { + "type" : "number", + "description" : "Fall off angle.", + "default" : 3.14159265 + }, + "fallOffExponent" : { + "type" : "number", + "description" : "Fall off exponent.", + "default" : 0.0 + }, + "linearAttenuation" : { + "type" : "number", + "description" : "Linear attenuation factor.", + "default" : 0.0 + }, + "quadraticAttenuation" : { + "type" : "number", + "description" : "Quadratic attenuation factor.", + "default" : 0.0 + } + }, + "additionalProperties" : false +} diff --git a/specification/material.schema.json b/specification/material.schema.json index eb6dbb7480..63bd2d2323 100644 --- a/specification/material.schema.json +++ b/specification/material.schema.json @@ -2,32 +2,13 @@ "$schema" : "http://json-schema.org/draft-03/schema", "title" : "material", "type" : "object", - "description" : "TODO", - "properties": { - "name" : { - "type" : "string", - "description" : "The application-visible globally-unique name of this node." - }, - "parameters" : { - "$ref" : "parameters.schema.json" - }, - "technique" : { - "type" : "string", - "description" : "The id (JSON property name) of the default technique referenced by this material.", + "description" : "An instance of a technique with parameter value overrides.", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, + "properties": { + "instanceTechnique" : { + "extends" : { "$ref" : "materialInstanceTechnique.schema.json" }, + "description" : "An instance of a technique with parameter value overrides.", "required" : true - }, - "techniques" : { - "description" : "The techniques available to this material.", - "properties" : { - }, - "additionalProperties" : { - "$ref" : "technique.schema.json" - }, - "required" : true - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." } }, "additionalProperties" : false diff --git a/specification/materialInstanceTechnique.schema.json b/specification/materialInstanceTechnique.schema.json new file mode 100644 index 0000000000..0e6356fd75 --- /dev/null +++ b/specification/materialInstanceTechnique.schema.json @@ -0,0 +1,22 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "material/instanceTechnique", + "type" : "object", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties": { + "technique" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the technique.", + "required" : true + }, + "values" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "materialInstanceTechniqueValues.schema.json" + }, + "default" : {} + } + }, + "additionalProperties" : false +} diff --git a/specification/materialInstanceTechniqueValues.schema.json b/specification/materialInstanceTechniqueValues.schema.json new file mode 100644 index 0000000000..700c2f9d3a --- /dev/null +++ b/specification/materialInstanceTechniqueValues.schema.json @@ -0,0 +1,6 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "material/instanceTechnique/values", + "type" : ["number", "boolean", "string", { "$ref" : "arrayValues.schema.json" }], + "description" : "Parameter values that override the values in the technique with the same parameter name." +} diff --git a/specification/mesh.schema.json b/specification/mesh.schema.json index 8563275e2b..a7cdd37940 100644 --- a/specification/mesh.schema.json +++ b/specification/mesh.schema.json @@ -2,30 +2,16 @@ "$schema" : "http://json-schema.org/draft-03/schema", "title" : "mesh", "type" : "object", - "description" : "TODO", + "description" : "An array of primitives defining geometry and material.", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, "properties" : { - "attributes" : { - "description" : "TODO", - "properties" : { - }, - "additionalProperties" : { - "$ref" : "meshAttribute.schema.json" - } - }, - "name" : { - "type" : "string", - "description" : "The application-visible globally-unique name of this node." - }, "primitives" : { "type" : "array", - "description" : "Primitives that form the geometry in this mesh.", + "description" : "Primitives that define geometry and material.", "items" : { - "$ref" : "primitive.schema.json" - } - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." + "$ref" : "meshPrimitive.schema.json" + }, + "default" : [] } }, "additionalProperties" : false diff --git a/specification/meshAttribute.schema.json b/specification/meshAttribute.schema.json deleted file mode 100644 index c62f8cc62f..0000000000 --- a/specification/meshAttribute.schema.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "meshAttribute", - "type" : "object", - "description" : "compliant with vertexAttribPointer() API", - "properties" : { - "bufferView" : { - "type" : "string", - "description" : "The id (JSON property name) of the bufferView referenced by this attribute.", - "required" : true - }, - "byteOffset" : { - "type" : "number", - "description" : "The offset relative to the bufferView in bytes. Similar to vertexAttribPointer() pointer (ES) / offset (WebGL) parameter.", - "minimum" : 0, - "required" : true - }, - "byteStride" : { - "type" : "number", - "description" : "The stride, in bytes, between attributes referenced by this accessor. vertexAttribPointer() stride parameter.", - "minimum" : 0, - "maximum" : 255, - "required" : true - }, - "count" : { - "type" : "number", - "description" : "The number of attributes referenced by this accessor, not to be confused with the number of bytes or number of components.", - "minimum" : 0, - "required" : true - }, - "type" : { - "type" : "string", - "description" : "vertexAttribPointer() type and size parameters. Corresponding typed arrays: Int8Array, Uint8Array, Int16Array, Uint16Array, and Float32Array.", - "enum" : ["BYTE", "BYTE_VEC2", "BYTE_VEC3", "BYTE_VEC4", "UNSIGNED_BYTE", "UNSIGNED_BYTE_VEC2", "UNSIGNED_BYTE_VEC3", "UNSIGNED_BYTE_VEC4", "SHORT", "SHORT_VEC2", "SHORT_VEC3", "SHORT_VEC4", "UNSIGNED_SHORT", "UNSIGNED_SHORT_VEC2", "UNSIGNED_SHORT_VEC3", "UNSIGNED_SHORT_VEC4", "FLOAT", "FLOAT_VEC2", "FLOAT_VEC3", "FLOAT_VEC4$"], - "required" : true - }, - "normalized" : { - "type" : "boolean", - "description" : "vertexAttribPointer() normalized parameter.", - "default" : false - }, - "max" : { - "type" : "array", - "description" : "Maximum value of each component in this attribute.", - "items" : { - "type" : "number" - }, - "required" : true - }, - "min" : { - "type" : "array", - "description" : "Minimum value of each component in this attribute.", - "items" : { - "type" : "number" - }, - "required" : true - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." - } - }, - "additionalProperties" : false -} diff --git a/specification/meshPrimitive.schema.json b/specification/meshPrimitive.schema.json new file mode 100644 index 0000000000..4023b66c6c --- /dev/null +++ b/specification/meshPrimitive.schema.json @@ -0,0 +1,34 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "mesh/primitive", + "type" : "object", + "description" : "Geometry and material. WebGL: see drawElements() and drawArrays().", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "attributes" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "meshPrimitiveAttribute.schema.json" + }, + "default" : {} + }, + "indices" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the accessor that contains the indices.", + "required" : true + }, + "material" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the material to apply to this primitive when rendering.", + "required" : true + }, + "primitive" : { + "type" : "integer", + "description" : "The type of primitives to render. Allowed values are 0 (POINTS), 1 (LINES), 2 (LINE_LOOP), 3 (LINE_STRIP), 4 (TRIANGLES), 5 (TRIANGLE_STRIP), and 6 (TRIANGLE_FAN).", + "enum" : [0, 1, 2, 3, 4, 5, 6], + "default" : 4 + } + }, + "additionalProperties" : false +} diff --git a/specification/meshPrimitiveAttribute.schema.json b/specification/meshPrimitiveAttribute.schema.json new file mode 100644 index 0000000000..2aeef7ca0a --- /dev/null +++ b/specification/meshPrimitiveAttribute.schema.json @@ -0,0 +1,6 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "mesh/primitive/attribute", + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the accessor that contains the attribute." +} diff --git a/specification/node.schema.json b/specification/node.schema.json index d2a0b20e09..52b9a3e793 100644 --- a/specification/node.schema.json +++ b/specification/node.schema.json @@ -2,40 +2,81 @@ "$schema" : "http://json-schema.org/draft-03/schema", "title" : "node", "type" : "object", - "description" : "A node in the model's node hierarchy. Node can reference meshes, cameras, or lights.", + "description" : "A node in the node hierarchy. Nodes can reference meshes, cameras, lights, or skins.", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, "properties" : { + "camera" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the camera referenced by this node. A node will have either the camera, light, meshes, or instanceSkin property defined." + }, "children" : { "type" : "array", - "description" : "The node's children. Each string in the array must match an existing id (JSON property name) in this model's nodes. Children are affected by the node's matrix.", + "description" : "The ids (JSON property name) of this node's children.", "items" : { - "type" : "string" + "$ref" : "glTFid.schema.json" }, - "uniqueItems" : true + "uniqueItems" : true, + "default" : [] + }, + "instanceSkin" : { + "extends" : { "$ref" : "nodeInstanceSkin.schema.json" }, + "description" : "An instance of a skin." + }, + "jointName" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "Name used when this node is a joint in a skin. When this node is a skin, instanceSkin will also be defined." + }, + "light" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the light referenced by this node. A node will have either the camera, light, meshes, or instanceSkin property defined." }, "matrix" : { "type" : "array", - "description" : "A floating-point 4x4 transformation matrix stored in column-major order. It is directly usable by uniformMatrix4fv with transpose equal to false.", + "description" : "A floating-point 4x4 transformation matrix stored in column-major order. A node will have either a matrix property defined or any combination of rotation, scale, and translation properties defined. If none are provided, the transform is the identity. WebGL: see uniformMatrix4fv with the transpose parameter equal to false.", "items" : { "type": "number" }, "minItems" : 16, - "maxItems" : 16 + "maxItems" : 16, + "default" : [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, "meshes" : { "type" : "array", - "description" : "The meshes that are part of this node. Each string in the array must match an existing id (JSON property name) in this model's meshes. Multiple meshes are allowed so each can share the same transform matrix.", + "description" : "The ids (JSON property name) of the meshes in this node. Multiple meshes are allowed so each can share the same transform matrix. A node will have either the camera, light, meshes, or instanceSkin property defined.", "items" : { - "type" : "string" + "$ref" : "glTFid.schema.json" }, "uniqueItems" : true }, - "name" : { - "type" : "string", - "description" : "The application-visible globally-unique name of this node." + "rotation" : { + "type" : "array", + "description" : "The node's quaternion rotation. A node will have either a matrix property defined or any combination of rotation, scale, and translation properties defined. If none are provided, the transform is the identity.", + "items" : { + "type": "number" + }, + "minItems" : 4, + "maxItems" : 4, + "default" : [ 1.0, 0.0, 0.0, 0.0 ] + }, + "scale" : { + "type" : "array", + "description" : "The node's non-uniform scale. A node will have either a matrix property defined or any combination of rotation, scale, and translation properties defined. If none are provided, the transform is the identity.", + "items" : { + "type": "number" + }, + "minItems" : 3, + "maxItems" : 3, + "default" : [ 1.0, 1.0, 1.0 ] }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." + "translation" : { + "type" : "array", + "description" : "The node's translation. A node will have either a matrix property defined or any combination of rotation, scale, and translation properties defined. If none are provided, the transform is the identity.", + "items" : { + "type": "number" + }, + "minItems" : 3, + "maxItems" : 3, + "default" : [ 0.0, 0.0, 0.0 ] } }, "additionalProperties" : false diff --git a/specification/nodeInstanceSkin.schema.json b/specification/nodeInstanceSkin.schema.json new file mode 100644 index 0000000000..a84560cbf4 --- /dev/null +++ b/specification/nodeInstanceSkin.schema.json @@ -0,0 +1,32 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "node/instanceSkin", + "type" : "object", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties": { + "skeletons" : { + "type" : "array", + "description" : "Joint name (jointName property) of skeleton nodes.", + "items" : { + "$ref" : "glTFid.schema.json" + }, + "uniqueItems" : true, + "required" : true + }, + "skin" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the skin referenced by this node.", + "required" : true + }, + "meshes" : { + "type" : "array", + "description" : "The ids (JSON property names) of source meshes.", + "items" : { + "$ref" : "glTFid.schema.json" + }, + "uniqueItems" : true, + "required" : true + } + }, + "additionalProperties" : false +} diff --git a/specification/parameters.schema.json b/specification/parameters.schema.json deleted file mode 100644 index 084b891cec..0000000000 --- a/specification/parameters.schema.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "parameters", - "type" : "object", - "properties" : { - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." - } - }, - "additionalProperties" : false -} diff --git a/specification/pass.schema.json b/specification/pass.schema.json deleted file mode 100644 index 948d8c690d..0000000000 --- a/specification/pass.schema.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "pass", - "type" : "object", - "description" : "TODO", - "properties": { - "program" : { - "$ref" : "program.schema.json", - "required" : true - }, - "states" : { - "$ref" : "states.schema.json" - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." - } - }, - "additionalProperties" : false -} diff --git a/specification/primitive.schema.json b/specification/primitive.schema.json deleted file mode 100644 index 329ba5c162..0000000000 --- a/specification/primitive.schema.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "primitive", - "type" : "object", - "description" : "TODO", - "properties" : { - "indices" : { - "$ref" : "indices.schema.json", - "required" : true - }, - "material" : { - "type" : "string", - "description" : "Specifies the material to apply to this primitive when rendering.", - "required" : true - }, - "primitive" : { - "type" : "string", - "description" : "Specifies what kind of primitives to render.", - "enum" : ["POINTS", "LINE_STRIP", "LINE_LOOP", "LINES", "TRIANGLE_STRIP", "TRIANGLE_FAN", "TRIANGLES"], - "required" : true - }, - "semantics" : { - "$ref" : "semantics.schema.json", - "required" : true - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." - } - }, - "additionalProperties" : false -} diff --git a/specification/program.schema.json b/specification/program.schema.json index 7ae6223883..ea017e348c 100644 --- a/specification/program.schema.json +++ b/specification/program.schema.json @@ -2,37 +2,28 @@ "$schema" : "http://json-schema.org/draft-03/schema", "title" : "program", "type" : "object", - "description" : "TODO", + "description" : "A shader program. WebGL: see attachShader(), bindAttribLocation(), createProgram(), deleteProgram(), getProgramParameter(), getProgramInfoLog(), linkProgram(), useProgram(), and validateProgram().", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, "properties": { "attributes" : { "type" : "array", - "description" : "TODO", + "description" : "Names of GLSL vertex shader attributes. WebGL: see bindAttribLocation().", "items" : { - "$ref" : "attribute.schema.json" + "type" : "string", + "minLength" : "1", + "maxLength" : "256" }, - "minItems" : 1, - "required" : true + "default" : [] }, "fragmentShader" : { - "type" : "string", - "description" : "The id (JSON property name) of the fragment shader referenced by this program.", + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the fragment shader.", "required" : true }, - "uniforms" : { - "type" : "array", - "description" : "TODO", - "items" : { - "$ref" : "uniform.schema.json" - } - }, "vertexShader" : { - "type" : "string", - "description" : "The id (JSON property name) of the vertex shader referenced by this program.", + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the vertex shader.", "required" : true - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." } }, "additionalProperties" : false diff --git a/specification/sampler.schema.json b/specification/sampler.schema.json new file mode 100644 index 0000000000..fc46092e8a --- /dev/null +++ b/specification/sampler.schema.json @@ -0,0 +1,34 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "sampler", + "type" : "object", + "description" : "Texture sampler properties. WebGL: see texParameterf().", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, + "properties" : { + "magFilter": { + "type" : "integer", + "description" : "9728 (NEAREST) or 9729 (LINEAR). WebGL: see texParameterf() when pname is TEXTURE_MAG_FILTER.", + "enum" : [9728, 9729], + "default" : 9729 + }, + "minFilter": { + "type" : "integer", + "description" : "9728 (NEAREST), 9729 (LINEAR), 9984 (NEAREST_MIPMAP_NEAREST), 9985 (LINEAR_MIPMAP_NEAREST), 9986 (NEAREST_MIPMAP_LINEAR), or 9987 (LINEAR_MIPMAP_LINEAR). WebGL: see texParameterf() when pname is TEXTURE_MIN_FILTER.", + "enum" : [9728, 9729, 9984, 9985, 9986, 9987], + "default" : 9986 + }, + "wrapS": { + "type" : "integer", + "description" : "33071 (CLAMP_TO_EDGE), 33648 (MIRRORED_REPEAT), or 10497 (REPEAT). WebGL: see texParameterf() when pname is TEXTURE_WRAP_S.", + "enum" : [33071, 33648, 10497], + "default" : 10497 + }, + "wrapT": { + "type" : "integer", + "description" : "33071 (CLAMP_TO_EDGE), 33648 (MIRRORED_REPEAT), or 10497 (REPEAT). WebGL: see texParameterf() when pname is TEXTURE_WRAP_T.", + "enum" : [33071, 33648, 10497], + "default" : 10497 + } + }, + "additionalProperties" : false +} diff --git a/specification/scene.schema.json b/specification/scene.schema.json new file mode 100644 index 0000000000..0e5f2fe7fc --- /dev/null +++ b/specification/scene.schema.json @@ -0,0 +1,19 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "scene", + "type" : "object", + "description" : "The root nodes of the scene.", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, + "properties" : { + "nodes" : { + "type" : "array", + "description" : "The ids (JSON property names) for each root node.", + "items" : { + "$ref" : "glTFid.schema.json" + }, + "uniqueItems" : true, + "default" : [] + } + }, + "additionalProperties" : false +} diff --git a/specification/semantics.schema.json b/specification/semantics.schema.json deleted file mode 100644 index 11c94010f4..0000000000 --- a/specification/semantics.schema.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "semantics", - "type" : "object", - "description" : "TODO", - "properties" : { - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." - } - }, - "additionalProperties" : { - "type" : "string" - } -} diff --git a/specification/shader.schema.json b/specification/shader.schema.json index 416730e108..d2b70c7d17 100644 --- a/specification/shader.schema.json +++ b/specification/shader.schema.json @@ -2,21 +2,20 @@ "$schema" : "http://json-schema.org/draft-03/schema", "title" : "shader", "type" : "object", - "description" : "A vertex or fragment shader.", + "description" : "A vertex or fragment shader. WebGL: see createShader(), deleteShader(), shaderSource(), compileShader(), getShaderParameter(), and getShaderInfoLog().", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, "properties" : { - "name" : { + "uri" : { "type" : "string", - "description" : "The application-visible globally-unique name of this node." - }, - "path" : { - "type" : "string", - "description" : "The URL of the GLSL source. Relative URLs are relative to the .json file that references the shader. Instead of referencing an external shader, the URL can also be a text/plain data URI.", + "description" : "The uri of the GLSL source. Relative paths are relative to the .json file. Instead of referencing an external file, the uri can also be a data-uri.", "format" : "uri", "required" : true }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." + "type" : { + "type" : "integer", + "description" : "Specifies the shader stage. Allowed values are 35632 (FRAGMENT_SHADER) and 35633 (VERTEX_SHADER).", + "enum" : [35632, 35633], + "required" : true } }, "additionalProperties" : false diff --git a/specification/skin.schema.json b/specification/skin.schema.json new file mode 100644 index 0000000000..a111ae8dd0 --- /dev/null +++ b/specification/skin.schema.json @@ -0,0 +1,34 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "skin", + "type" : "object", + "description" : "Joints and matrices defining a skin.", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, + "properties" : { + "bindShapeMatrix" : { + "type" : "array", + "description" : "Floating-point 4x4 transformation matrix stored in column-major order.", + "items" : { + "type": "number" + }, + "minItems" : 16, + "maxItems" : 16, + "default" : [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] + }, + "inverseBindMatrices" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "Accessor id (JSON property name) containing the 4x4 inverse-bind matrices.", + "required" : true + }, + "jointNames" : { + "type" : "array", + "description" : "Joint names of the joints (nodes with a joint property) in this skin.", + "items" : { + "$ref" : "glTFid.schema.json" + }, + "uniqueItems" : true, + "required" : true + } + }, + "additionalProperties" : false +} diff --git a/specification/states.schema.json b/specification/states.schema.json deleted file mode 100644 index 02f81ab753..0000000000 --- a/specification/states.schema.json +++ /dev/null @@ -1,378 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "states", - "type" : "object", - "description" : "Contains all rendering states to set up for the parent pass.", - "properties" : { - "blendEnable" : { - "type" : "boolean", - "description" : "enable(BLEND) or disable(BLEND)", - "default" : false - }, - "blendEquation" : { - "type" : "string", - "description" : "blendEquation()", - "enum" : ["FUNC_ADD", "FUNC_SUBTRACT", "FUNC_REVERSE_SUBTRACT"], - "default" : "FUNC_ADD" - }, - "blendEquationSeparate" : { - "type" : "object", - "description" : "blendEquationSeparate()", - "properties" : { - "rgb" : { - "type" : "string", - "description" : "blendEquationSeparate()", - "enum" : ["FUNC_ADD", "FUNC_SUBTRACT", "FUNC_REVERSE_SUBTRACT"], - "default" : "FUNC_ADD" - }, - "alpha" : { - "type" : "string", - "description" : "blendEquationSeparate()", - "enum" : ["FUNC_ADD", "FUNC_SUBTRACT", "FUNC_REVERSE_SUBTRACT"], - "default" : "FUNC_ADD" - } - } - }, - "blendFunc" : { - "type" : "object", - "description" : "blendFunc()", - "properties" : { - "sfactor" : { - "type" : "string", - "description" : "blendFunc()", - "enum" : ["ZERO","ONE", "SRC_COLOR", "ONE_MINUS_SRC_COLOR", "DST_COLOR", "ONE_MINUS_DST_COLOR", "SRC_ALPHA", "ONE_MINUS_SRC_ALPHA", "DST_ALPHA", "ONE_MINUS_DST_ALPHA", "CONSTANT_COLOR", "ONE_MINUS_CONSTANT_COLOR", "CONSTANT_ALPHA", "ONE_MINUS_CONSTANT_ALPHA", "SRC_ALPHA_SATURATE"], - "default" : "ONE" - }, - "dfactor" : { - "type" : "string", - "description" : "blendFunc()", - "enum" : ["ZERO","ONE", "SRC_COLOR", "ONE_MINUS_SRC_COLOR", "DST_COLOR", "ONE_MINUS_DST_COLOR", "SRC_ALPHA", "ONE_MINUS_SRC_ALPHA", "DST_ALPHA", "ONE_MINUS_DST_ALPHA", "CONSTANT_COLOR", "ONE_MINUS_CONSTANT_COLOR", "CONSTANT_ALPHA", "ONE_MINUS_CONSTANT_ALPHA", "SRC_ALPHA_SATURATE"], - "default" : "ZERO" - } - } - }, - "blendFuncSeparate" : { - "type" : "object", - "description" : "blendFuncSeparate()", - "properties" : { - "srcRGB" : { - "type" : "string", - "description" : "blendFuncSeparate()", - "enum" : ["ZERO","ONE", "SRC_COLOR", "ONE_MINUS_SRC_COLOR", "DST_COLOR", "ONE_MINUS_DST_COLOR", "SRC_ALPHA", "ONE_MINUS_SRC_ALPHA", "DST_ALPHA", "ONE_MINUS_DST_ALPHA", "CONSTANT_COLOR", "ONE_MINUS_CONSTANT_COLOR", "CONSTANT_ALPHA", "ONE_MINUS_CONSTANT_ALPHA", "SRC_ALPHA_SATURATE"], - "default" : "ONE" - }, - "srcAlpha" : { - "type" : "string", - "description" : "blendFuncSeparate()", - "enum" : ["ZERO","ONE", "SRC_COLOR", "ONE_MINUS_SRC_COLOR", "DST_COLOR", "ONE_MINUS_DST_COLOR", "SRC_ALPHA", "ONE_MINUS_SRC_ALPHA", "DST_ALPHA", "ONE_MINUS_DST_ALPHA", "CONSTANT_COLOR", "ONE_MINUS_CONSTANT_COLOR", "CONSTANT_ALPHA", "ONE_MINUS_CONSTANT_ALPHA", "SRC_ALPHA_SATURATE"], - "default" : "ONE" - }, - "dstRGB" : { - "type" : "string", - "description" : "blendFuncSeparate()", - "enum" : ["ZERO","ONE", "SRC_COLOR", "ONE_MINUS_SRC_COLOR", "DST_COLOR", "ONE_MINUS_DST_COLOR", "SRC_ALPHA", "ONE_MINUS_SRC_ALPHA", "DST_ALPHA", "ONE_MINUS_DST_ALPHA", "CONSTANT_COLOR", "ONE_MINUS_CONSTANT_COLOR", "CONSTANT_ALPHA", "ONE_MINUS_CONSTANT_ALPHA", "SRC_ALPHA_SATURATE"], - "default" : "ZERO" - }, - "dstAlpha" : { - "type" : "string", - "description" : "blendFuncSeparate()", - "enum" : ["ZERO","ONE", "SRC_COLOR", "ONE_MINUS_SRC_COLOR", "DST_COLOR", "ONE_MINUS_DST_COLOR", "SRC_ALPHA", "ONE_MINUS_SRC_ALPHA", "DST_ALPHA", "ONE_MINUS_DST_ALPHA", "CONSTANT_COLOR", "ONE_MINUS_CONSTANT_COLOR", "CONSTANT_ALPHA", "ONE_MINUS_CONSTANT_ALPHA", "SRC_ALPHA_SATURATE"], - "default" : "ZERO" - } - } - }, - "colorMask" : { - "type" : "object", - "description" : "colorMask()", - "properties" : { - "red" : { - "type" : "boolean", - "description" : "colorMask()", - "default" : true - }, - "green" : { - "type" : "boolean", - "description" : "colorMask()", - "default" : true - }, - "blue" : { - "type" : "boolean", - "description" : "colorMask()", - "default" : true - }, - "alpha" : { - "type" : "boolean", - "description" : "colorMask()", - "default" : true - } - } - }, - "cullFace" : { - "type" : "string", - "description" : "cullFace()", - "enum" : ["FRONT", "BACK", "FRONT_AND_BACK"], - "default" : "BACK" - }, - "cullFaceEnable" : { - "type" : "boolean", - "description" : "enable(CULL_FACE) or disable(CULL_FACE)", - "default" : false - }, - "depthFunc" : { - "type" : "string", - "description" : "depthFunc()", - "enum" : ["NEVER", "LESS", "LEQUAL", "EQUAL", "GREATER", "NOTEQUAL", "GEQUAL", "ALWAYS"], - "default" : "LESS" - }, - "depthMask" : { - "type" : "boolean", - "description" : "depthMask()", - "default" : true - }, - "depthRange" : { - "type" : "object", - "description" : "depthRange()", - "properties" : { - "zNear" : { - "type" : "number", - "description" : "depthRange()", - "default" : 0.0, - "minimum" : 0.0, - "maximum" : 1.0 - }, - "zFar" : { - "type" : "number", - "description" : "depthRange()", - "default" : 1.0, - "minimum" : 0.0, - "maximum" : 1.0 - } - } - }, - "depthTestEnable" : { - "type" : "boolean", - "description" : "enable(DEPTH_TEST) or disable(DEPTH_TEST)", - "default" : false - }, - "ditherEnable" : { - "type" : "boolean", - "description" : "enable(DITHER) or disable(DITHER)", - "default" : false - }, - "frontFace" : { - "type" : "string", - "description" : "frontFace()", - "enum" : ["CW,", "CCW"], - "default" : "CCW" - }, - "lineWidth" : { - "type" : "number", - "description" : "lineWidth()", - "default" : 1.0, - "minimum" : 0.0, - "exclusiveMinimum" : true - }, - "pointSize" : { - "type" : "number", - "description" : "gl_PointSize" - }, - "polygonOffset" : { - "type" : "object", - "description" : "polygonOffset()", - "properties" : { - "factor" : { - "type" : "number", - "description" : "polygonOffset()", - "default" : 0.0 - }, - "units" : { - "type" : "number", - "description" : "polygonOffset()", - "default" : 0.0 - } - } - }, - "polygonOffsetFillEnable" : { - "type" : "boolean", - "description" : "enable(POLYGON_OFFSET_FILL) or disable(POLYGON_OFFSET_FILL)", - "default" : false - }, - "sampleAlphaToCoverageEnable" : { - "type" : "boolean", - "description" : "enable(SAMPLE_ALPHA_TO_COVERAGE) or disable(SAMPLE_ALPHA_TO_COVERAGE)", - "default" : false - }, - "sampleCoverage" : { - "type" : "object", - "description" : "sampleCoverage()", - "properties" : { - "value" : { - "type" : "number", - "description" : "sampleCoverage()", - "default" : 1.0, - "minimum" : 0.0, - "maximum" : 1.0 - }, - "invert" : { - "type" : "boolean", - "description" : "sampleCoverage()", - "default" : false - } - } - }, - "sampleCoverageEnable" : { - "type" : "boolean", - "description" : "enable(SAMPLE_COVERAGE) or disable(SAMPLE_COVERAGE)", - "default" : false - }, - "scissor" : { - "type" : "object", - "description" : "scissor()", - "properties" : { - "x" : { - "type" : "integer", - "description" : "scissor()", - "default" : 0 - }, - "y" : { - "type" : "integer", - "description" : "scissor()", - "default" : 0 - }, - "width" : { - "type" : "integer", - "description" : "scissor()", - "default" : 0 - }, - "height" : { - "type" : "integer", - "description" : "scissor()", - "default" : 0 - } - } - }, - "scissorTestEnable" : { - "type" : "boolean", - "description" : "enable(SCISSOR_TEST) or disable(SCISSOR_TEST)", - "default" : false - }, - "stencilFunc" : { - "type" : "object", - "description" : "stencilFunc()", - "properties" : { - "func" : { - "type" : "string", - "description" : "stencilFunc()", - "enum" : ["NEVER", "LESS", "LEQUAL", "EQUAL", "GREATER", "NOTEQUAL", "GEQUAL", "ALWAYS"], - "default" : "ALWAYS" - }, - "ref" : { - "type" : "integer", - "description" : "stencilFunc()", - "default" : 0, - "minimum" : 0 - }, - "mask" : { - "type" : "integer", - "description" : "stencilFunc(). The default is all ones." - } - } - }, - "stencilFuncSeparate" : { - "type" : "object", - "description" : "stencilFuncSeparate()", - "properties" : { - "front" : { - "type" : "string", - "description" : "stencilFuncSeparate()", - "enum" : ["NEVER", "LESS", "LEQUAL", "EQUAL", "GREATER", "NOTEQUAL", "GEQUAL", "ALWAYS"], - "default" : "ALWAYS" - }, - "back" : { - "type" : "string", - "description" : "stencilFuncSeparate()", - "enum" : ["NEVER", "LESS", "LEQUAL", "EQUAL", "GREATER", "NOTEQUAL", "GEQUAL", "ALWAYS"], - "default" : "ALWAYS" - }, - "ref" : { - "type" : "integer", - "description" : "stencilFuncSeparate()", - "default" : 0, - "minimum" : 0 - }, - "mask" : { - "type" : "integer", - "description" : "stencilFuncSeparate(). The default is all ones." - } - } - }, - "stencilMask" : { - "type" : "integer", - "description" : "stencilMask(). The default is all ones." - }, - "stencilOp" : { - "type" : "object", - "description" : "stencilOp()", - "properties" : { - "fail" : { - "type" : "string", - "description" : "stencilOp()", - "enum" : ["KEEP", "ZERO", "REPLACE", "INCR", "DECR", "INVERT", "INCR_WRAP", "DECR_WRAP"], - "default" : "KEEP" - }, - "zfail" : { - "type" : "string", - "description" : "stencilOp()", - "enum" : ["KEEP", "ZERO", "REPLACE", "INCR", "DECR", "INVERT", "INCR_WRAP", "DECR_WRAP"], - "default" : "KEEP" - }, - "zpass" : { - "type" : "string", - "description" : "stencilOp()", - "enum" : ["KEEP", "ZERO", "REPLACE", "INCR", "DECR", "INVERT", "INCR_WRAP", "DECR_WRAP"], - "default" : "KEEP" - } - } - }, - "stencilOpSeparate" : { - "type" : "object", - "description" : "stencilOpSeparate()", - "properties" : { - "face" : { - "type" : "string", - "description" : "stencilOpSeparate()", - "enum" : ["FRONT", "BACK", "FRONT_AND_BACK"], - "default" : "FRONT_AND_BACK" - }, - "fail" : { - "type" : "string", - "description" : "stencilOpSeparate()", - "enum" : ["KEEP", "ZERO", "REPLACE", "INCR", "DECR", "INVERT", "INCR_WRAP", "DECR_WRAP"], - "default" : "KEEP" - }, - "zfail" : { - "type" : "string", - "description" : "stencilOpSeparate()", - "enum" : ["KEEP", "ZERO", "REPLACE", "INCR", "DECR", "INVERT", "INCR_WRAP", "DECR_WRAP"], - "default" : "KEEP" - }, - "zpass" : { - "type" : "string", - "description" : "stencilOpSeparate()", - "enum" : ["KEEP", "ZERO", "REPLACE", "INCR", "DECR", "INVERT", "INCR_WRAP", "DECR_WRAP"], - "default" : "KEEP" - } - } - }, - "stencilTestEnable" : { - "type" : "boolean", - "description" : "enable(STENCIL_TEST) or disable(STENCIL_TEST)", - "default" : false - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." - } - }, - "additionalProperties" : false -} diff --git a/specification/technique.schema.json b/specification/technique.schema.json index bb80153c9c..4d4af0bbe2 100644 --- a/specification/technique.schema.json +++ b/specification/technique.schema.json @@ -2,18 +2,29 @@ "$schema" : "http://json-schema.org/draft-03/schema", "title" : "technique", "type" : "object", - "description" : "TODO", - "properties": { + "description" : "Specifies shading and its inputs.", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, + "properties": { "parameters" : { - "$ref" : "parameters.schema.json" + "properties" : { + }, + "additionalProperties" : { + "$ref" : "techniqueParameters.schema.json" + }, + "default" : {} }, "pass" : { - "$ref" : "pass.schema.json", + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the default pass to use.", "required" : true }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." + "passes" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "techniquePass.schema.json" + }, + "required" : true } }, "additionalProperties" : false diff --git a/specification/techniqueParameters.schema.json b/specification/techniqueParameters.schema.json new file mode 100644 index 0000000000..da57ee6ff7 --- /dev/null +++ b/specification/techniqueParameters.schema.json @@ -0,0 +1,33 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "technique/parameter", + "type" : "object", + "description" : "Uniform and attribute inputs to a technique.", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "count" : { + "type" : "integer", + "description" : "When defined, the parameter is an array of count elements of the specified type. values will be an array with length equal to sizeof(type) * count, where each sizeof(type) defines the value of one element. When undefined, the parameter is not an array.", + "minimum" : 1 + }, + "type" : { + "type" : "integer", + "description" : "WebGL 1.0.2 Profile: allowed values are 5120 (BYTE), 5121 (UNSIGNED_BYTE), 5122 (SHORT), 5123 (UNSIGNED_SHORT), 5124 (INT), 5125 (UNSIGNED_INT), 5126 (FLOAT), 35664 (FLOAT_VEC2), 35665 (FLOAT_VEC3), 35666 (FLOAT_VEC4), 35667 (INT_VEC2), 35668 (INT_VEC3), 35669 (INT_VEC4), 35670 (BOOL), 35671 (BOOL_VEC2), 35672 (BOOL_VEC3), 35673 (BOOL_VEC4), 35674 (FLOAT_MAT2), 35675 (FLOAT_MAT3), 35676 (FLOAT_MAT4), and 35678 (SAMPLER_2D).", + "enum" : [5120, 5121, 5122, 5123, 5124, 5125, 5126, 35664, 35665, 35666, 35667, 35668, 35669, 35670, 35671, 35672, 35673, 35674, 35675, 35676, 35678], + "required" : true + }, + "semantic" : { + "type" : "string", + "description" : "Uniform semantics include LOCAL (FLOAT_MAT4), MODEL (FLOAT_MAT4), VIEW (FLOAT_MAT4), PROJECTION (FLOAT_MAT4), MODELVIEW (FLOAT_MAT4), MODELVIEWPROJECTION (FLOAT_MAT4), MODELINVERSE (FLOAT_MAT4), VIEWINVERSE (FLOAT_MAT4), PROJECTIONINVERSE (FLOAT_MAT4), MODELVIEWINVERSE (FLOAT_MAT4), MODELVIEWPROJECTIONINVERSE (FLOAT_MAT4), MODELINVERSETRANSPOSE (FLOAT_MAT3), MODELVIEWINVERSETRANSPOSE (FLOAT_MAT3), VIEWPORT (FLOAT_MAT4). Attribute semantics include POSITION, NORMAL, TEXCOORD, COLOR, JOINT, JOINTMATRIX, and WEIGHT. Attribute semantics can be of the form [semantic]_[set_index], e.g, TEXCOORD_0, TEXCOORD_1, etc." + }, + "node" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the node whose transform is used as the parameter's value." + }, + "value" : { + "type" : ["number", "boolean", "string", { "$ref" : "arrayValues.schema.json" }], + "description" : "Material values, when specified, override this." + } + }, + "additionalProperties" : false +} diff --git a/specification/techniquePass.schema.json b/specification/techniquePass.schema.json new file mode 100644 index 0000000000..6e6ddbd4df --- /dev/null +++ b/specification/techniquePass.schema.json @@ -0,0 +1,24 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "technique/pass", + "type" : "object", + "description" : "The shader program and render states for a rendering pass.", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties": { + "details" : { + "extends" : { "$ref" : "techniquePassDetails.schema.json" }, + "description" : "Information to reconstruct a shader program." + }, + "instanceProgram" : { + "extends" : { "$ref" : "techniquePassInstanceProgram.schema.json" }, + "description" : "Shader program and attribute and uniform inputs.", + "required" : true + }, + "states" : { + "extends" : { "$ref" : "techniquePassStates.schema.json" }, + "description" : "Fixed-function rendering states.", + "default" : {} + } + }, + "additionalProperties" : false +} diff --git a/specification/techniquePassDetails.schema.json b/specification/techniquePassDetails.schema.json new file mode 100644 index 0000000000..4e33663483 --- /dev/null +++ b/specification/techniquePassDetails.schema.json @@ -0,0 +1,17 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "technique/pass/details", + "type" : "object", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "commonProfile" : { + "$ref" : "techniquePassDetailsCommonProfile.schema.json" + }, + "type" : { + "type" : "string", + "description" : "TODO", + "required" : true + } + }, + "additionalProperties" : false +} diff --git a/specification/techniquePassDetailsCommonProfile.schema.json b/specification/techniquePassDetailsCommonProfile.schema.json new file mode 100644 index 0000000000..18a108ca97 --- /dev/null +++ b/specification/techniquePassDetailsCommonProfile.schema.json @@ -0,0 +1,30 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "technique/pass/details/commonProfile", + "type" : "object", + "description" : "TODO", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "lightingModel" : { + "type" : "string", + "description" : "TODO", + "required" : true + }, + "parameters" : { + "type" : "array", + "description" : "TODO", + "items" : { + "type" : "string", + "minLength" : 1 + } + }, + "texcoordBindings" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "techniquePassDetailsCommonProfileTexcoordBindings.schema.json" + } + } + }, + "additionalProperties" : false +} diff --git a/specification/techniquePassDetailsCommonProfileTexcoordBindings.schema.json b/specification/techniquePassDetailsCommonProfileTexcoordBindings.schema.json new file mode 100644 index 0000000000..ffdf16c7c3 --- /dev/null +++ b/specification/techniquePassDetailsCommonProfileTexcoordBindings.schema.json @@ -0,0 +1,6 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "technique/pass/details/commonProfile/texcoordBindings", + "type" : "string", + "description" : "TODO" +} diff --git a/specification/techniquePassInstanceProgram.schema.json b/specification/techniquePassInstanceProgram.schema.json new file mode 100644 index 0000000000..1215330ff4 --- /dev/null +++ b/specification/techniquePassInstanceProgram.schema.json @@ -0,0 +1,30 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "technique/pass/instanceProgram", + "type" : "object", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "attributes" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "techniquePassInstanceProgramAttribute.schema.json" + }, + "default" : {} + }, + "program" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "Specifies the program id (property name).", + "required" : true + }, + "uniforms" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "techniquePassInstanceProgramUniform.schema.json" + }, + "default" : {} + } + }, + "additionalProperties" : false +} diff --git a/specification/techniquePassInstanceProgramAttribute.schema.json b/specification/techniquePassInstanceProgramAttribute.schema.json new file mode 100644 index 0000000000..b591582cb6 --- /dev/null +++ b/specification/techniquePassInstanceProgramAttribute.schema.json @@ -0,0 +1,6 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "technique/pass/instanceProgram/attribute", + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "Maps GLSL attribute names to technique parameter ids." +} diff --git a/specification/techniquePassInstanceProgramUniform.schema.json b/specification/techniquePassInstanceProgramUniform.schema.json new file mode 100644 index 0000000000..580862a370 --- /dev/null +++ b/specification/techniquePassInstanceProgramUniform.schema.json @@ -0,0 +1,6 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "technique/pass/instanceProgram/uniform", + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "Maps GLSL uniform names to technique parameter ids." +} diff --git a/specification/techniquePassStates.schema.json b/specification/techniquePassStates.schema.json new file mode 100644 index 0000000000..38a94f252e --- /dev/null +++ b/specification/techniquePassStates.schema.json @@ -0,0 +1,155 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "states", + "type" : "object", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "enable" : { + "type" : "array", + "description" : "WebGL states to enable. Valid values are (3042) BLEND, (2884) CULL_FACE, (2929) DEPTH_TEST, (32823) POLYGON_OFFSET_FILL, (32926) SAMPLE_ALPHA_TO_COVERAGE, and (3089) SCISSOR_TEST.", + "items" : { + "type": "integer" + }, + "uniqueItems" : true, + "default" : [] + }, + "functions" : { + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "states functions", + "type" : "object", + "description" : "Arguments for state functions.", + "extends" : { "$ref" : "glTFProperty.schema.json" }, + "properties" : { + "blendColor" : { + "type" : "array", + "description" : "Floating-point values passed to blendColor(). [red, green, blue, alpha]", + "items" : { + "type" : "number" + }, + "minItems" : 4, + "maxItems" : 4, + "default" : [0.0, 0.0, 0.0, 0.0] + }, + "blendEquationSeparate" : { + "type" : "array", + "description" : "Integer values passed to blendEquationSeparate(). [rgb, alpha]. Valid values are (32774) FUNC_ADD, (32778) FUNC_SUBTRACT, and (32779) FUNC_REVERSE_SUBTRACT.", + "items" : { + "type" : "number", + "enum" : [32774, 32778, 32779] + }, + "minItems" : 2, + "maxItems" : 2, + "default" : [32774, 32774] + }, + "blendFuncSeparate" : { + "type" : "array", + "description" : "Integer values passed to blendFuncSeparate(). [srcRGB, srcAlpha, dstRGB, dstAlpha]. Valid values are (0) ZERO, (1) ONE, (768) SRC_COLOR, (769) ONE_MINUS_SRC_COLOR, (774) DST_COLOR, (775) ONE_MINUS_DST_COLOR, (770) SRC_ALPHA, (771) ONE_MINUS_SRC_ALPHA, (772) DST_ALPHA, (773) ONE_MINUS_DST_ALPHA, (32769) CONSTANT_COLOR, (32770) ONE_MINUS_CONSTANT_COLOR, (32771) CONSTANT_ALPHA, (32772) ONE_MINUS_CONSTANT_ALPHA, and (776) SRC_ALPHA_SATURATE.", + "items" : { + "type" : "number", + "enum" : [0, 1, 768, 769, 774, 775, 770, 771, 772, 773, 32769, 32770, 32771, 32772, 776] + }, + "minItems" : 4, + "maxItems" : 4, + "default" : [1, 1, 0, 0] + }, + "colorMask" : { + "type" : "array", + "description" : "Boolean values passed to colorMask(). [red, green, blue, alpha].", + "items" : { + "type" : "boolean" + }, + "minItems" : 4, + "maxItems" : 4, + "default" : [true, true, true, true] + }, + "cullFace" : { + "type" : "array", + "description" : "Integer value passed to cullFace(). Valid values are (1028) FRONT, (1029) BACK, and (1032) FRONT_AND_BACK.", + "items" : { + "type" : "integer", + "enum" : [1028, 1029, 1032] + }, + "minItems" : 1, + "maxItems" : 1, + "default" : [1029] + }, + "depthFunc" : { + "type" : "array", + "description" : "Integer values passed to depthFunc(). Valid values are (512) NEVER, (513) LESS, (515) LEQUAL, (514) EQUAL, (516) GREATER, (517) NOTEQUAL, (518) GEQUAL, and (519) ALWAYS.", + "items" : { + "type" : "integer", + "enum" : [512, 513, 515, 514, 516, 517, 518, 519] + }, + "minItems" : 1, + "maxItems" : 1, + "default" : [513] + }, + "depthMask" : { + "type" : "array", + "description" : "Boolean value passed to depthMask().", + "items" : { + "type" : "boolean" + }, + "minItems" : 1, + "maxItems" : 1, + "default" : [true] + }, + "depthRange" : { + "type" : "array", + "description" : "Floating-point values passed to depthRange(). [zNear, zFar]", + "items" : { + "type" : "number" + }, + "minItems" : 2, + "maxItems" : 2, + "default" : [0.0, 1.0] + }, + "frontFace" : { + "type" : "array", + "description" : "Integer value passed to frontFace(). Valid values are (2304) CW and (2305) CCW.", + "items" : { + "type" : "integer", + "enum" : [2304, 2305] + }, + "minItems" : 1, + "maxItems" : 1, + "default" : [2305] + }, + "lineWidth" : { + "type" : "array", + "description" : "Floating-point value passed to lineWidth().", + "items" : { + "type" : "number", + "minimum" : 0.0, + "exclusiveMinimum" : true + }, + "minItems" : 1, + "maxItems" : 1, + "default" : [1.0] + }, + "polygonOffset" : { + "type" : "array", + "description" : "Floating-point value passed to polygonOffset(). [factor, units]", + "items" : { + "type" : "number" + }, + "minItems" : 2, + "maxItems" : 2, + "default" : [0.0, 0.0] + }, + "scissor" : { + "type" : "array", + "description" : "Floating-point value passed to scissor(). [x, y, width, height]. The defaults is the dimensions of the canvas when the WebGL context is created. TODO: width and height must be > 0.0, items should be an array below.", + "items" : { + "type" : "number" + }, + "minItems" : 4, + "maxItems" : 4, + "default" : [0.0, 0.0, 0.0, 0.0] + } + }, + "additionalProperties" : false + } + }, + "additionalProperties" : false +} diff --git a/specification/texture.schema.json b/specification/texture.schema.json new file mode 100644 index 0000000000..17e10a08ac --- /dev/null +++ b/specification/texture.schema.json @@ -0,0 +1,44 @@ +{ + "$schema" : "http://json-schema.org/draft-03/schema", + "title" : "texture", + "type" : "object", + "description" : "A texture and its sampler. WebGL: see createTexture(), deleteTexture(), bindTexture(), texImage2D(), and texParameterf().", + "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, + "properties" : { + "format": { + "type" : "integer", + "description" : "6406 (ALPHA), 6407 (RGB), 6408 (RGBA), 6409 (LUMINANCE), and 6410 (LUMINANCE_ALPHA). WebGL: see texImage2D() format parameter.", + "enum" : [6406, 6407, 6408, 6409, 6410], + "default" : 6408 + }, + "internalFormat": { + "type" : "integer", + "description" : "6406 (ALPHA), 6407 (RGB), 6408 (RGBA), 6409 (LUMINANCE), and 6410 (LUMINANCE_ALPHA). Defaults to same value as format. WebGL: see internalFormat() format parameter.", + "enum" : [6406, 6407, 6408, 6409, 6410], + "default" : 6408 + }, + "sampler" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the sampler used by this texture.", + "required" : true + }, + "source" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the image used by this texture.", + "required" : true + }, + "target": { + "type" : "integer", + "description" : "3553 (TEXTURE_2D). WebGL: see bindTexture().", + "enum" : [3553], + "default" : 3553 + }, + "type": { + "type" : "integer", + "description" : "5121 (UNSIGNED_BYTE), 33635 (UNSIGNED_SHORT_5_6_5), 32819 (UNSIGNED_SHORT_4_4_4_4), and 32820 (UNSIGNED_SHORT_5_5_5_1). WebGL: see texImage2D() type property.", + "enum" : [5121, 33635, 32819, 32820], + "default" : 5121 + } + }, + "additionalProperties" : false +} diff --git a/specification/uniform.schema.json b/specification/uniform.schema.json deleted file mode 100644 index 1455afa125..0000000000 --- a/specification/uniform.schema.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "uniform", - "type" : "object", - "description" : "TODO", - "properties": { - "semantic" : { - "type" : "string", - "description" : "TODO" - }, - "symbol" : { - "type" : "string", - "description" : "TODO", - "required" : true - }, - "type" : { - "type" : "string", - "description" : "TODO", - "enum" : ["INT", "INT_VEC2", "INT_VEC3", "INTT_VEC4", "FLOAT", "FLOAT_VEC2", "FLOAT_VEC3", "FLOAT_VEC4", "FLOAT_MAT2", "FLOAT_MAT3", "FLOAT_MAT4", "BOOL", "BOOL_VEC2", "BOOL_VEC3", "BOOL_VEC4"], - "required" : true - }, - "extra" : { - "type" : "any", - "description" : "Optional application-specific data." - } - }, - "additionalProperties" : false -} diff --git a/specification/validator/main.js b/specification/validator/main.js index 24a968dea9..56a5c7c834 100644 --- a/specification/validator/main.js +++ b/specification/validator/main.js @@ -89,27 +89,20 @@ var qp = getQueryParameters(); - // Show schema and json to validate if provided as query parameters - if (typeof qp.schema !== 'undefined') { - schemaTextElement.innerHTML = getText(qp.schema); - } + // Show json to validate if provided as query parameters if (typeof qp.json !== 'undefined') { jsonTextElement.innerHTML = getText(qp.json); } // Schema and JSON uri shown in the validation output. - var schemaUri = defaultValue(qp.schema, document.getElementById('schemaUri').value); + var schemaUri = document.getElementById('schemaUri').value; var jsonUri = defaultValue(qp.json, document.getElementById('jsonUri').value); + schemaTextElement.innerHTML = getText(schemaUri); + schemaUriElement.addEventListener('change', function(event) { schemaUri = schemaUriElement.value; - - if (schemaUriElement.value !== '---') { - schemaTextElement.value = getText(schemaUriElement.value); - } else { - schemaTextElement.value = ''; - } - + schemaTextElement.value = getText(schemaUriElement.value); clearReport(); }); schemaUriElement.addEventListener('focus', function(event) {