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 @@