Skip to content

Latest commit

 

History

History
69 lines (41 loc) · 3.13 KB

README.md

File metadata and controls

69 lines (41 loc) · 3.13 KB

Composite

Contributors

Overview

The Composite tile format enables concatenating tiles of different formats into one tile.

3D Tiles and the Composite tile allow flexibility for streaming heterogeneous datasets. For example, buildings and trees could be stored either in two separate Batched 3D Model and Instanced 3D Model tiles or, using a Composite tile, the tiles can be combined.

Supporting heterogeneous datasets with both inter-tile (separate tiles of different formats that are in the same tileset) and intra-tile (different tile formats that are in the same Composite tile) options allows conversion tools to make trade-offs between number of requests, optimal type-specific subdivision, and how visible/hidden layers are streamed.

A Composite is a binary blob in little endian accessed in JavaScript as an ArrayBuffer.

Layout

Figure 1: Composite layout (dashes indicate optional fields).

Header

The 16-byte header section contains the following fields:

Field name Data type Description
magic 4-byte ANSI string "cmpt". This can be used to identify the arraybuffer as a Composite tile.
version uint32 The version of the Composite format. It is currently 1.
byteLength uint32 The length of the entire Composite tile, including this header and each inner tile, in bytes.
tilesLength uint32 The number of tiles in the Composite.

TODO: code example reading header

Inner Tiles

Inner tile fields are stored tightly packed immediately following the header section. No additional header is added on top of the tiles' preexisting headers (eg, b3dm or i3dm headers). However, the following information describes general characteristics of the existing contents of relevant files' headers to explain common information which a composite tile reader might exploit to find the boundaries of the inner tiles.

  • Each tile starts with a 4-byte ANSI string, magic, that can be used to determine the tile format for further parsing. See the main 3D Tiles spec for a list of tile formats. Composite tiles can contain Composite tiles.
  • Each tile's header contains a uint32 byteLength, which defines the length of the inner tile, including its header, in bytes. This can be used to traverse the inner tiles.
  • For any tile format's version 1, the first 12-bytes of all tiles is the following fields:
Field name Data type Description
magic uchar[4] Indicates the tile format
version uint32 1
byteLength uint32 Length, in bytes, of the entire tile.

Refer to the spec for each tile format for more details.

File Extension

.cmpt

MIME Type

TODO, #60

application/octet-stream

Acknowledgments

Resources

  1. Python packcmpt tool in gltf2glb toolset