Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copyedit #302

Merged
merged 11 commits into from
Apr 25, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ As we add more tile formats, 3D Tiles needs to stay consistent.
## Terminology

* Tiles are composed of `sections` such as `header` and `body`. Sections are composed of `fields` such as `magic` and `version`.
* "Feature" - indicates one model in a batch of models (b3dm), one instance in a collection of instances (i3dm), one point in a point cloud (pnts), one polygon in a vector tile (vctr), etc.
* "Feature" - indicates one model in a batch of models (`b3dm`), one instance in a collection of instances (`i3dm`), one point in a point cloud (`pnts`), one polygon in a vector tile (`vctr`), etc.

## Fields

Expand Down
113 changes: 56 additions & 57 deletions README.md

Large diffs are not rendered by default.

129 changes: 60 additions & 69 deletions Styling/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Styling/schema/style.colorExpression.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"id" : "style.colorExpression.schema.json",
"title" : "color expression",
"type" : "string",
"description" : "3D Tiles style expression that evaluates to a Color."
"description" : "3D Tiles style expression that evaluates to a color."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a type, Color, so it should still be capitalized I think.

}
4 changes: 2 additions & 2 deletions Styling/schema/style.condition.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id" : "style.condition.schema.json",
"title" : "condition",
"type" : "object",
"description" : "A series of conditions evaluated in order like a series of if...else statements that result in an expression being evaluated.",
"description" : "A series of conditions evaluated in order, like a series of if...else statements that result in an expression being evaluated.",
"properties" : {
"conditions" : {
"type" : "array",
Expand All @@ -17,7 +17,7 @@
"minItems" : 2,
"maxItems" : 2
},
"description" : "A series of boolean conditions evaluated in order. For the first one that evaluates to true, its value, the 'result', (which is also an expression) is evaluated and returned. Result expressions must all be the same type. If no condition evaluates to true, the result is `undefined`. When conditions is `undefined`, `null`, or an empty object, the result is `undefined`."
"description" : "A series of boolean conditions evaluated in order. For the first one that evaluates to true, its value, the 'result' (which is also an expression), is evaluated and returned. Result expressions must all be the same type. If no condition evaluates to true, the result is `undefined`. When conditions are `undefined`, `null`, or an empty object, the result is `undefined`."
}
},
"additionalProperties" : false
Expand Down
111 changes: 51 additions & 60 deletions TileFormats/BatchTable/README.md

Large diffs are not rendered by default.

58 changes: 35 additions & 23 deletions TileFormats/Batched3DModel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,31 @@
* Tom Fili, [@CesiumFili](https://twitter.com/CesiumFili)
* Sean Lilley, [@lilleyse](https://github.com/lilleyse)

## Contents

* [Overview](#overview)
* [Layout](#layout)
* [Header](#header)
* [Feature table](#feature-table)
* [Semantics](#semantics)
* [Feature semantics](#feature-semantics)
* [Global semantics](#global-semantics)
* [Batch table](#batch-table)
* [Binary glTF](#binary-gltf)
* [File extension](#file-extension)
* [MIME type](#mime-type)

## Overview

_Batched 3D Model_ allows offline batching of heterogeneous 3D models, such as different buildings in a city, for efficient streaming to a web client for rendering and interaction. Efficiency comes from transferring multiple models in a single request and rendering them in the least number of WebGL draw calls necessary. Using the core 3D Tiles spec language, each model is a _feature_.
_Batched 3D model_ allows offline batching of heterogeneous 3D models, such as different buildings in a city, for efficient streaming to a web client for rendering and interaction. Efficiency comes from transferring multiple models in a single request and rendering them in the least number of WebGL draw calls necessary. Using the core 3D Tiles spec language, each model is a _feature_.

Per-model properties, such as IDs, enable individual models to be identified and updated at runtime, e.g., show/hide, highlight color, etc. Properties may be used, for example, to query a web service to access metadata, such as passing a building's ID to get its address. Or a property might be referenced on-the-fly for changing a model's appearance, e.g., changing highlight color based on a property value.
Per-model properties, such as IDs, enable individual models to be identified and updated at runtime, e.g., show/hide, highlight color, etc. Properties may be used, for example, to query a web service to access metadata, such as passing a building's ID to get its address. Or a property might be referenced on the fly for changing a model's appearance, e.g., changing highlight color based on a property value.

Batched 3D Model, or just the _batch_, is a binary blob in little endian accessed in JavaScript as an `ArrayBuffer`.
Batched 3D model, or just the _batch_, is a binary blob in little endian accessed in JavaScript as an `ArrayBuffer`.

## Layout

A tile is composed of two sections: a header immediately followed by a body.

**Figure 1**: Batched 3D Model layout (dashes indicate optional fields).
A tile is composed of two sections: a header immediately followed by a body. The following figure shows the batched 3D model layout (dashes indicate optional fields):

![](figures/layout.png)

Expand All @@ -28,8 +40,8 @@ The 28-byte header contains the following fields:

|Field name|Data type|Description|
|----------|---------|-----------|
| `magic` | 4-byte ANSI string | `"b3dm"`. This can be used to identify the arraybuffer as a Batched 3D Model tile. |
| `version` | `uint32` | The version of the Batched 3D Model format. It is currently `1`. |
| `magic` | 4-byte ANSI string | `"b3dm"`. This can be used to identify the arraybuffer as a batched 3D model tile. |
| `version` | `uint32` | The version of the batched 3D model format. It is currently `1`. |
| `byteLength` | `uint32` | The length of the entire tile, including the header, in bytes. |
| `featureTableJSONByteLength` | `uint32` | The length of the feature table JSON section in bytes. Zero indicates there is no feature table. |
| `featureTableBinaryByteLength` | `uint32` | The length of the feature table binary section in bytes. If `featureTableJSONByteLength` is zero, this will also be zero. |
Expand All @@ -38,54 +50,54 @@ The 28-byte header contains the following fields:

If `featureTableJSONByteLength` equals zero, the tile does not need to be rendered.

The body section immediately follows the header section, and is composed of three fields: `Feature Table`, `Batch Table` and `Binary glTF`.
The body section immediately follows the header section, and is composed of three fields: `Feature Table`, `Batch Table`, and `Binary glTF`.

Code for reading the header can be found in
[Batched3DModelTileContent](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Batched3DModel3DTileContent.js)
in the Cesium implementation of 3D Tiles.

## Feature Table
## Feature table

Contains values for `b3dm` semantics.
More information is available in the [Feature Table specification](../FeatureTable/README.md).
More information is available in the [feature table specification](../FeatureTable/README.md).

The `b3dm` Feature Table JSON Schema is defined in [b3dm.featureTable.schema.json](../../schema/b3dm.featureTable.schema.json).
The `b3dm` feature table JSON schema is defined in [b3dm.featureTable.schema.json](../../schema/b3dm.featureTable.schema.json).

### Semantics

#### Feature Semantics
#### Feature semantics

There are currently no per-feature semantics.

#### Global Semantics
#### Global semantics

These semantics define global properties for all features.

| Semantic | Data Type | Description | Required |
| --- | --- | --- | --- |
| `BATCH_LENGTH` | `uint32` | The number of distinguishable models, also called features, in the batch. If the Binary glTF does not have a `batchId` attribute, this field _must_ be `0`. | :white_check_mark: Yes. |

## Batch Table
## Batch table

The _Batch Table_ contains per-model application-specific metadata, indexable by `batchId`, that can be used for declarative styling and application-specific use cases such as populating a UI or issuing a REST API request. In the Binary glTF section, each vertex has an numeric `batchId` attribute in the integer range `[0, number of models in the batch - 1]`. The `batchId` indicates the model to which the vertex belongs. This allows models to be batched together and still be identifiable.
The _batch table_ contains per-model application-specific metadata, indexable by `batchId`, that can be used for declarative styling and application-specific use cases such as populating a UI or issuing a REST API request. In the binary glTF section, each vertex has an numeric `batchId` attribute in the integer range `[0, number of models in the batch - 1]`. The `batchId` indicates the model to which the vertex belongs. This allows models to be batched together and still be identifiable.

See the [Batch Table](../BatchTable/README.md) reference for more information.
See the [batch table](../BatchTable/README.md) reference for more information.

## Binary glTF

[glTF](https://www.khronos.org/gltf) is the runtime asset format for WebGL. [Binary glTF](https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_binary_glTF) is an extension defining a binary container for glTF. Batched 3D Model uses glTF 1.0 with the [KHR_binary_glTF](https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_binary_glTF) extension.
[glTF](https://www.khronos.org/gltf) is the runtime asset format for WebGL. [Binary glTF](https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_binary_glTF) is an extension defining a binary container for glTF. Batched 3D model uses glTF 1.0 with the [KHR_binary_glTF](https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_binary_glTF) extension.

The binary glTF immediately follows the feature table and batch table. It may embed all of its geometry, texture, and animations, or it may refer to external sources for some or all of these data.

The glTF asset must be 8-byte aligned so that glTF's byte-alignment guarantees are met. This can be done by padding the Feature Table or Batch Table if they are present.
The glTF asset must be 8-byte aligned so that glTF's byte-alignment guarantees are met. This can be done by padding the feature table or batch table if they are present.

As described above, each vertex has a `batchId` attribute indicating the model to which it belongs. For example, vertices for a batch with three models may look like this:
```
batchId: [0, 0, 0, ..., 1, 1, 1, ..., 2, 2, 2, ...]
position: [xyz, xyz, xyz, ..., xyz, xyz, xyz, ..., xyz, xyz, xyz, ...]
normal: [xyz, xyz, xyz, ..., xyz, xyz, xyz, ..., xyz, xyz, xyz, ...]
```
Vertices do not need to be ordered by `batchId` so the following is also OK:
Vertices do not need to be ordered by `batchId`, so the following is also OK:
```
batchId: [0, 1, 2, ..., 2, 1, 0, ..., 1, 2, 0, ...]
position: [xyz, xyz, xyz, ..., xyz, xyz, xyz, ..., xyz, xyz, xyz, ...]
Expand Down Expand Up @@ -117,17 +129,17 @@ attribute float a_batchId;

The vertex shader can be modified at runtime to use `a_batchId` to access individual models in the batch, e.g., to change their color.

When a Batch Table is present or the `BATCH_LENGTH` property is greater than `0`, the `batchId` attribute (with the parameter semantic `_BATCHID`) is required; otherwise, it is not.
When a batch table is present or the `BATCH_LENGTH` property is greater than `0`, the `batchId` attribute (with the parameter semantic `_BATCHID`) is required; otherwise, it is not.

Although not strictly required, clients may find the glTF [CESIUM_RTC](https://github.com/KhronosGroup/glTF/blob/new-extensions/extensions/CESIUM_RTC/README.md) extension useful for high-precision rendering.

## File Extension
## File extension

`.b3dm`

The file extension is optional. Valid implementations ignore it and identify a content's format by the `magic` field in its header.

## MIME Type
## MIME type

_TODO, [#60](https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/60)_

Expand Down
41 changes: 26 additions & 15 deletions TileFormats/Composite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,30 @@
* Sean Lilley, [@lilleyse](https://github.com/lilleyse)
* Patrick Cozzi, [@pjcozzi](https://twitter.com/pjcozzi)

## Contents

* [Overview](#overview)
* [Layout](#layout)
* [Header](#header)
* [Inner tiles](#inner-tiles)
* [File extension](#file-extension)
* [MIME type](#mime-type)
* [Acknowledgments](#acknowledgments)
* [Resources](#resources)

## Overview

The _Composite_ tile format enables concatenating tiles of different formats into one tile.
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.
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.
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`.
A composite is a binary blob in little endian accessed in JavaScript as an `ArrayBuffer`.

## Layout

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

![](figures/layout.png)

Expand All @@ -27,20 +38,20 @@ 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. |
| `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 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.
Inner tile fields are stored tightly packed immediately following the header section. No additional header is added on top of the tiles' preexisting headers, e.g., b3dm or i3dm headers. However, the following information describes general characteristics of the existing contents of relevant files' headers to explain common information that 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](../../README.md) for a list of tile formats. Composite tiles can contain Composite 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](../../README.md) 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:
* For any tile format's version 1, the first 12 bytes of all tiles is the following fields:

|Field name|Data type|Description|
|----------|---------|-----------|
Expand All @@ -50,13 +61,13 @@ Inner tile fields are stored tightly packed immediately following the header sec

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

## File Extension
## File extension

`.cmpt`

The file extension is optional. Valid implementations ignore it and identify a content's format by the `magic` field in its header.

## MIME Type
## MIME type

_TODO, [#60](https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/60)_

Expand Down
Loading