{"action":"created","issue":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/3d-tiles/issues/23","labels_url":"https://api.github.com/repos/AnalyticalGraphicsInc/3d-tiles/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/3d-tiles/issues/23/comments","events_url":"https://api.github.com/repos/AnalyticalGraphicsInc/3d-tiles/issues/23/events","html_url":"https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/23","id":109140198,"number":23,"title":"Instanced 3D Model and Composite Tile Formats","user":{"login":"pjcozzi","id":782098,"avatar_url":"https://avatars.githubusercontent.com/u/782098?v=3","gravatar_id":"","url":"https://api.github.com/users/pjcozzi","html_url":"https://github.com/pjcozzi","followers_url":"https://api.github.com/users/pjcozzi/followers","following_url":"https://api.github.com/users/pjcozzi/following{/other_user}","gists_url":"https://api.github.com/users/pjcozzi/gists{/gist_id}","starred_url":"https://api.github.com/users/pjcozzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjcozzi/subscriptions","organizations_url":"https://api.github.com/users/pjcozzi/orgs","repos_url":"https://api.github.com/users/pjcozzi/repos","events_url":"https://api.github.com/users/pjcozzi/events{/privacy}","received_events_url":"https://api.github.com/users/pjcozzi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-09-30T17:25:00Z","updated_at":"2015-11-05T15:57:14Z","closed_at":null,"body":"First, see the original notes for [Instanced 3D Model](https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/Instanced3DModel/README.md) and [Composite](https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/Composite/README.md) tile formats. To help design the Instanced 3D Model tile format, see the [Batched 3D Model](https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/b3dm/README.md) tile format.\r\n\r\nWe now have significant work towards instancing in Cesium.  See https://github.com/AnalyticalGraphicsInc/cesium/pull/3049.\r\n\r\nHere's some initial thoughts:\r\n\r\n## Instanced 3D Model\r\n\r\n```\r\nHeader\r\n------\r\nmagic            // uchar[4], \"i3dm\"\r\nversion          // uint32,   1\r\nbatchTableLength // uint32,   can be zero, length of the batch table in bytes\r\nglTFLength       // uint32,   length of glTF section (after the Batch Table) in bytes\r\nglTFFormat       // uint32,   0 = url, 1 = embedded binary glTF\r\ninstancesLength  // uint32,   number of instances, NOT number of bytes, can be zero I guess\r\n\r\nBatch Table\r\n-----------\r\n// Same as Batched 3D Model.  Optional.\r\n\r\nglTF\r\n----\r\n// UTF-8 string or binary blob depending on Header.glTFFormat\r\n// Length in bytes is Header.glTFLength\r\n\r\nInstances\r\n---------\r\nThere are Header.instancesLength of these:\r\n* x, y, z    // doubles in WGS84 coordinates\r\n* x, y, z, w // doubles in WGS84 coordinates (quaternion)\r\n* batchId    // uint32, index into batchTable, zero when Header.batchTableLength === 0\r\n```\r\n\r\n* [ ] We can significantly optimize the size of each `instance` field, e.g., positions can be quantized relative to the bounding volume (see [EXT_quantized_attributes](https://github.com/mlimper/glTF/tree/spec-1.0/extensions/MultiVendor/EXT_quantized_attributes)).  Rotation could also be optional (part of the batchTable) and default to Y up (glTF default) in a local frame for the instance's position.  Rotation could use fewer fields.  RTC.   Delta encoding... SOA vs. AOS...  Look into point cloud compression...\r\n* [ ] Should `instance.batchId` be omitted when `header.batchTableLength === 0`.  This will complicate the client, but save memory; however, the case it saves memory for is probably rare in practice.\r\n* [ ] Throughout 3D Tiles, should `batchTable` be renamed?  Something like `propertyTable`, `metadataTable`, etc.  We can also decide this later as we define more tile formats.  Consistent terminology is important.\r\n* [ ] Throughout 3D Tiles, should the `batchTable` work more like glTF buffer/bufferView/accessor to avoid arrays of numbers?\r\n\r\n## Composite\r\n\r\nIn order to have different models instanced in the same tile (or more generally, combine any number of tiles, even tiles of different formats), we can use a Composite tile format.\r\n\r\nPerhaps:\r\n```\r\nHeader\r\n------\r\nmagic            // uchar[4], \"cmpt\"\r\nversion          // uint32,   1\r\ntilesLength      // Number of tiles\r\n\r\nTiles\r\n----\r\n// header.tilesLength (potentially heterogeneous) tiles\r\n```\r\n\r\n* [x] To make this easier to parse on the client, each tile's header could include its total length in bytes or the Composite can contain an array of lengths.  I think we want to store it in each tile so other binary streams containing tiles can be easily parsed."},"comment":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/3d-tiles/issues/comments/154101631","html_url":"https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/23#issuecomment-154101631","issue_url":"https://api.github.com/repos/AnalyticalGraphicsInc/3d-tiles/issues/23","id":154101631,"user":{"login":"pjcozzi","id":782098,"avatar_url":"https://avatars.githubusercontent.com/u/782098?v=3","gravatar_id":"","url":"https://api.github.com/users/pjcozzi","html_url":"https://github.com/pjcozzi","followers_url":"https://api.github.com/users/pjcozzi/followers","following_url":"https://api.github.com/users/pjcozzi/following{/other_user}","gists_url":"https://api.github.com/users/pjcozzi/gists{/gist_id}","starred_url":"https://api.github.com/users/pjcozzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjcozzi/subscriptions","organizations_url":"https://api.github.com/users/pjcozzi/orgs","repos_url":"https://api.github.com/users/pjcozzi/repos","events_url":"https://api.github.com/users/pjcozzi/events{/privacy}","received_events_url":"https://api.github.com/users/pjcozzi/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T15:57:13Z","updated_at":"2015-11-05T15:57:13Z","body":">  glTF can be embedded binary or a url. Should Batched3DModel also allow both for consistency? Should Instanced3DModel only allow a url?\r\n\r\nDiscussed offline with @lilleyse.  No changes here.  b3dm embeds binary glTF since it is unlikely that tiles would reuse the same model; i3dm has the uri option to share models across tiles and the embed option for a single tile use case."}}