{"action":"created","issue":{"url":"https://api.github.com/repos/KhronosGroup/glTF/issues/899","repository_url":"https://api.github.com/repos/KhronosGroup/glTF","labels_url":"https://api.github.com/repos/KhronosGroup/glTF/issues/899/labels{/name}","comments_url":"https://api.github.com/repos/KhronosGroup/glTF/issues/899/comments","events_url":"https://api.github.com/repos/KhronosGroup/glTF/issues/899/events","html_url":"https://github.com/KhronosGroup/glTF/pull/899","id":220073224,"number":899,"title":"Add versioning info","user":{"login":"sbtron","id":967499,"avatar_url":"https://avatars3.githubusercontent.com/u/967499?v=3","gravatar_id":"","url":"https://api.github.com/users/sbtron","html_url":"https://github.com/sbtron","followers_url":"https://api.github.com/users/sbtron/followers","following_url":"https://api.github.com/users/sbtron/following{/other_user}","gists_url":"https://api.github.com/users/sbtron/gists{/gist_id}","starred_url":"https://api.github.com/users/sbtron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbtron/subscriptions","organizations_url":"https://api.github.com/users/sbtron/orgs","repos_url":"https://api.github.com/users/sbtron/repos","events_url":"https://api.github.com/users/sbtron/events{/privacy}","received_events_url":"https://api.github.com/users/sbtron/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-07T00:30:55Z","updated_at":"2017-04-08T00:01:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/KhronosGroup/glTF/pulls/899","html_url":"https://github.com/KhronosGroup/glTF/pull/899","diff_url":"https://github.com/KhronosGroup/glTF/pull/899.diff","patch_url":"https://github.com/KhronosGroup/glTF/pull/899.patch"},"body":"Added explanation of how we envision glTF will version with backwards and forwards compatibility in the 2.x timeframe. \r\n\r\nhttps://github.com/sbtron/glTF/tree/Versioning/specification/2.0#versioning \r\n\r\nUpdated schema to allow for forwards compatibility\r\n- additionalProperties:false is removed so that future versions can add additional properties and a 2.0 loader can still validate a 2.x file using schema.\r\n- All enums now use anyOf with an additional generic type object to allow for additional enums in future versions. This also addresses #891\r\n- Added optional minVersion property to allow asset authors to opt out of forwards compat and require a minimum supported version (similar to extensionsRequired concept).  "},"comment":{"url":"https://api.github.com/repos/KhronosGroup/glTF/issues/comments/292678720","html_url":"https://github.com/KhronosGroup/glTF/pull/899#issuecomment-292678720","issue_url":"https://api.github.com/repos/KhronosGroup/glTF/issues/899","id":292678720,"user":{"login":"sbtron","id":967499,"avatar_url":"https://avatars3.githubusercontent.com/u/967499?v=3","gravatar_id":"","url":"https://api.github.com/users/sbtron","html_url":"https://github.com/sbtron","followers_url":"https://api.github.com/users/sbtron/followers","following_url":"https://api.github.com/users/sbtron/following{/other_user}","gists_url":"https://api.github.com/users/sbtron/gists{/gist_id}","starred_url":"https://api.github.com/users/sbtron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbtron/subscriptions","organizations_url":"https://api.github.com/users/sbtron/orgs","repos_url":"https://api.github.com/users/sbtron/repos","events_url":"https://api.github.com/users/sbtron/events{/privacy}","received_events_url":"https://api.github.com/users/sbtron/received_events","type":"User","site_admin":false},"created_at":"2017-04-08T00:01:37Z","updated_at":"2017-04-08T00:01:37Z","body":"The working group has been discussing this. Pasting it here so everyone can read. The examples are speculations of features that could be added in future versions and are only meant to show potential approaches of adding them.\r\n\r\nTo support forwards compatibility, whenever a new feature is added the spec needs to allow for the following requirements: \r\n\r\n1. Only specifying old the feature set (no new features used)\r\n2. Specifying the new feature but allowing for a fallback \r\n   a. The fallback could be allowing older parsers to completely ignore the feature.\r\n   b. If the new feature is not supported then use the old feature. \r\n3. Allowing authors to require that a runtime supports a new feature in order to load the asset \r\n\r\nRequirement 1. is essentially backwards compatibility- you cannot change existing behavior in a spec update. \r\n\r\nFor requirement 2.a a glTF 2.0 parser should still be able to read a 2.1 file and completely ignore any new features.\r\n\r\nFor example say glTF 2.1 adds lighting capability by: \r\n* Adding a new light node at root\r\n* Added a new light property under the nodes property\r\n\r\n(This is a completely made up example to show how this will work) \r\n```\r\n\"lights\": [\r\n    \"directional\" : {\r\n        \"color\": [ 1, 1, 1 ]\r\n    },\r\n],\r\n\"nodes\": [\r\n    {\r\n        \"children\": [ ],\r\n        \"light\": 0,\r\n    }\r\n]\r\n```\r\nA 2.0 parser can ignore any additional properties it finds whereas a 2.1 parser can correctly interpret those additional parameters. \r\n\r\nFor requirement 2.b any new features are ignored but a fall back behavior to 2.0 should exist.\r\nFor example say Draco Mesh compression is added to core glTF 2.1. To stay compatible with 2.0 clients, the compressed mesh should be provided along with the uncompressed mesh to allow for a fallback. \r\n(Example only, not meant to be exact) \r\n```\r\n\"primitives\": [\r\n    {\r\n        \"attributes\": {\r\n            \"POSITION\": 11,\r\n            \"NORMAL\": 12,\r\n            \"TEXCOORD_0\": 13\r\n        },\r\n        \"indices\": 10,\r\n        \"mode\": 4,\r\n        \"draco_mesh\": {\r\n            \"bufferView\": 5,\r\n            \"indexCount\": 1000,\r\n            \"vertexCount\": 500,\r\n            \"attributes\": [ \"POSITION\", \"NORMAL\", \"TEXCOORD_0\" ],\r\n            \"version\": \"0.9.1\"\r\n        }\r\n    }\r\n]\r\n```\r\nA 2.1 client can read and understand the “draco_mesh” element. A 2.0 client can simply ignore it and use the uncompressed geometry.\r\n\r\nRequirement 3. will technically break forwards compatibility, but asset creators may want to choose to explicitly opt out of compatibility and require a specific version.  The draco mesh compression is a good example where someone could choose to require a minimum version. For a client-server type of scenario where a JSON file points to the bin files, you can have both the compressed mesh and uncompressed mesh and a client can just download the one it understands. However, for a self contained binary glTF file scenario, you may only want to keep the compressed version since the whole point was to reduce the file size. In this scenario an author could choose to explicitly require a minimum version of 2.1. The JSON for such a file must still contain the required elements so that it validates, but it could just point to an empty geometry which will never gets used. \r\n\r\nRequirements 2.a and 2.b are satisfied by allowing additional properties in all nodes of the JSON.\r\nRequirement 3. is satisfied by adding a minVersion property to the asset node.\r\n\r\nEnums provide an interesting challenge and example below show how to update them in a forwards compatible manner : \r\nImagine `SPLINE` interpolation is added in glTF 2.1 (its actually part of 2.0 but just using it as an example). Say SPLINE is added such that you can specify a fallback to Linear interpolation.\r\nTo do this in a forwards compatible way a new `additionalSamplers` property will need to be added under the channels node. \r\n \r\n```\r\n\"samplers\" : [\r\n    {\r\n        \"input\": 2,\r\n        \"interpolation\": \"LINEAR\",\r\n        \"output\": 3\r\n    },\r\n    {\r\n        \"input\": 4,\r\n        \"interpolation\": \"SPLINE\",\r\n        \"output\": 5\r\n    }\r\n], \"channels\" : [\r\n    {\r\n        \"additionalSamplers\": [ 1 ],\r\n        \"sampler\": 0,\r\n        \"target\": {\r\n            \"node\": 0,\r\n            \"path\": \"rotation\"\r\n        }\r\n    }\r\n]\r\n```\r\nOnly a client that understands glTF 2.1 will understand the additionalsamplers property and will read the sampler which uses spline interpolation. Older samplers should simply ignore the additionalSamplers property and read the 2.0 sampler property to use linear interpolation."}}
{"actor":{"display_login":"sbtron"}}