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

First Round of 3D Tiles 1.0 updates #301

Merged
merged 45 commits into from
May 9, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0e22b00
0.0 to 1.0
lilleyse Jun 20, 2017
7cc26a8
Add link to OneSky blog post
pjcozzi Apr 17, 2018
5a62d6f
Merge pull request #300 from AnalyticalGraphicsInc/pjcozzi-patch-1
pjcozzi Apr 17, 2018
59247c4
3D Tiles 1.0 updates
ggetz Apr 17, 2018
101e8a5
copyedit 1
slchow Apr 21, 2018
12d2583
copyedit 2
slchow Apr 21, 2018
7c9d494
figures
slchow Apr 21, 2018
90b53dd
copyedit
slchow Apr 21, 2018
86d05ae
RegExp
slchow Apr 23, 2018
d68fb03
Response to Gabby's comments
slchow Apr 23, 2018
77c87f8
regExp()
ggetz Apr 23, 2018
192a632
Tweaks
lilleyse Apr 23, 2018
9e7dfc7
Merge branch 'master' into copyedit
slchow Apr 24, 2018
5586e25
Sean corrections
slchow Apr 24, 2018
5117393
capitalization
slchow Apr 24, 2018
7169305
Other edits
lilleyse Apr 24, 2018
ba91831
Merge pull request #302 from slchow/copyedit
lilleyse Apr 25, 2018
899b3a3
Merge branch 'master' into tileset.json-edits
ggetz Apr 25, 2018
d3fce88
Spec clarification edits
ggetz Apr 26, 2018
026d7dd
Address CRS, padding, boundingVolumes, geometric error
ggetz May 3, 2018
0f190b1
Move Batch Table hierarchy to an extension
ggetz May 3, 2018
d5c5491
Update schemas
ggetz May 3, 2018
f0e031b
Tweak wording in local coordinate systems
lilleyse May 7, 2018
469a860
Small tweaks
lilleyse May 7, 2018
af25031
Update to 3DTILES_ prefix, updated contributors, fixed figures
ggetz May 7, 2018
4615dcb
Merge branch 'tileset.json-edits' into hierarchy-extension
ggetz May 7, 2018
83f0144
Random edits
lilleyse May 7, 2018
13d6f78
Twwak image, fix link
ggetz May 7, 2018
c3f7c96
Merge pull request #305 from AnalyticalGraphicsInc/hierarchy-extension
lilleyse May 7, 2018
1143bfa
Edits
ggetz May 7, 2018
7b9ae34
Update bounding volume images
ggetz May 7, 2018
e204c9b
Add Refinement section, url->uri, edits, cleanup
ggetz May 8, 2018
082ec85
Misc updates
lilleyse May 8, 2018
fd74204
Stray url to uri
lilleyse May 8, 2018
c02ba37
Other fixes
lilleyse May 8, 2018
ef40a6e
Tweaks to coordinate system and i3dm glb section
lilleyse May 9, 2018
4f6fc68
Fix sentence
lilleyse May 9, 2018
c954b2b
Updated figures
ggetz May 9, 2018
36dde46
Combine crs paragraphs, use some of the original wording, not complet…
lilleyse May 9, 2018
5ba688c
Formatting fix
ggetz May 9, 2018
384e749
Tweaked CRS
ggetz May 9, 2018
98854ad
Merge branch 'tileset.json-edits' into version-upgrade
ggetz May 9, 2018
f5bffdd
Merge pull request #234 from AnalyticalGraphicsInc/version-upgrade
ggetz May 9, 2018
4bc6f90
Add acknowledgements
ggetz May 9, 2018
6dce1a4
Edits
lilleyse May 9, 2018
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
119 changes: 82 additions & 37 deletions README.md

Large diffs are not rendered by default.

22 changes: 8 additions & 14 deletions Styling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ Contents:

## Overview

3D Tiles styles provide concise declarative styling of tileset features. A style defines expressions to evaluate a feature's `color` (RGB and translucency) and `show` properties, often based on the feature's properties stored in the tile's batch table.
3D Tiles styles provide concise declarative styling of tileset. A style defines expressions to evaluate a feature's `color` (RGB and translucency) and `show` properties, often based on the feature's properties or class as stored in the tile's [Batch Table](../BatchTable/README.md).

Styles are defined with JSON and expressions written in a small subset of JavaScript augmented for styling. Additionally the styling language provides a set of built-in functions to support common math operations.
While a style may be created for and reference properties of a tileset, a style is independent of a tileset, such that any style can be applied to any tileset.

Styles are defined with JSON and expressions written in the styling expression syntax specified below, a small subset of JavaScript augmented for styling. Additionally the styling language provides a set of built-in functions to support common math operations.

## Examples

Expand Down Expand Up @@ -1340,19 +1342,11 @@ For example:
}
```

#### Point Cloud Shader Styling

**TODO : add note about GLSL implementations requires strict type comparisons among other things: https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/140**

## File Extension

TBA

## MIME Type

_TBA, [#60](https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/60)_
> Implementation Note: Point cloud styling engines may often use a shader (GLSL) implementation, however some features of the expression language are not possible in pure a GLSL implementation. Features that must account for these inconsistencies include evaluation of `isNan` and `isFinite` (GLSL 2.0+ supports `isnan` and `isinf` for these functions respectively); the types `null` and `undefined`; strings, including accessing object properties (`color()['r']`) and batch table values; regular expressions; arrays of lengths other than 2, 3, or 4; mismatched type comparisons (`float` to `bool`); and handling of "index out of bounds" errors.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to have a bulleted list within a quoted section? That might be easier to read.


`application/json`
## File Extensions and MIME Types

* Tileset styles use the `.json` extension and the `application/json` mime type.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same note as before where the extension is not required.


## Acknowledgments

Expand Down
27 changes: 16 additions & 11 deletions TileFormats/Batched3DModel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ If `featureTableJSONByteLength` equals zero, the tile does not need to be render

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
> Implementation Note: 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.

Expand All @@ -64,18 +64,19 @@ 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. |
| `RTC_CENTER` | `float32[3]` | A 3-component array of numbers defining the center position when instance positions are defined relative-to-center. | :red_circle: No. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Drop the word instance since it is specific to i3dm.


## 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](../../Styling/README.md) 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.

## 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.
Batched 3D Model uses [glTF 2.0](https://github.com/KhronosGroup/glTF/tree/master/specification/2.0) to embed model data.

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 [binary glTF](https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#binary-gltf-layout) 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.

Expand Down Expand Up @@ -119,16 +120,20 @@ The vertex shader can be modified at runtime to use `a_batchId` to access indivi

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

The gltf snipped above is still based on 1.0 techniques/shaders. For 2.0 all that's required is a primitive contains a _BATCHID attribute.


Although not strictly required, clients may find the glTF [CESIUM_RTC](https://github.com/KhronosGroup/glTF/tree/master/extensions/1.0/Vendor/CESIUM_RTC) extension useful for high-precision rendering.
### Coordinate Reference System (CRS)

## File Extension
Vertex positions are defined according to a right-handed coordinate system where Y-axis is up. [glTF Coordinate System and Units](https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#coordinate-system-and-units)

`.b3dm`
Vertex positions may be defined relative-to-center for high-precision rendering [1]. If defined, `RTC_CENTER` specifies the center position and all vertex positions are treated as relative to this value.
Copy link
Contributor

Choose a reason for hiding this comment

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

Here it should be noted that RTC_CENTER is z-up whereas vertex positions are y-up.

In general I think our coordinate system messaging is still not quite there... still need to think about the clearest way possible to describe it.


The file extension is optional. Valid implementations ignore it and identify a content's format by the `magic` field in its header.
> Implementation Note: Clients may also use the glTF [CESIUM_RTC](https://github.com/KhronosGroup/glTF/tree/master/extensions/1.0/Vendor/CESIUM_RTC) extension and define points relative to center.
Copy link
Contributor

Choose a reason for hiding this comment

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

We are phasing away from this extension, so I wouldn't include this note.


## File Extension and MIME Type

## MIME Type
Batched 3D Model tiles use the `.b3dm` extension and `application/octet-stream` MIME type.

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

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

`application/octet-stream`
1. [Precisions, Precisions](http://blogs.agi.com/insight3d/index.php/2008/09/03/precisions-precisions/)
10 changes: 2 additions & 8 deletions TileFormats/Composite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,12 @@ 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 and MIME Type

`.cmpt`
Composite tiles use the `.cmpt` extension and `application/octet-stream` MIME type.

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

## MIME Type

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

`application/octet-stream`

## Acknowledgments

* [Christopher Mitchell, Ph.D.](https://github.com/KermMartian)
Expand Down
19 changes: 8 additions & 11 deletions TileFormats/Instanced3DModel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ The `z` vector would map onto a `forward` vector, but it is omitted because it w

If `NORMAL_UP` and `NORMAL_RIGHT` are not defined for an instance, its orientation may be stored as oct-encoded normals in `NORMAL_UP_OCT32P` and `NORMAL_RIGHT_OCT32P`.
These define `up` and `right` using the oct-encoding described in
[*A Survey of Efficient Representations of Independent Unit Vectors* by Cigolle et al.](http://jcgt.org/published/0003/02/01/).
An implementation for encoding and decoding these unit vectors can be found in Cesium's
[*A Survey of Efficient Representations of Independent Unit Vectors* by Cigolle et al.](http://jcgt.org/published/0003/02/01/). Oct-encoded values are stored in unsigned, unnormalized range ([0, 65535] or [0, 255]) and then converted to a signed normalized range ([-1.0, 1.0]) at runtime.

> An implementation for encoding and decoding these unit vectors can be found in Cesium's
[AttributeCompression](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/AttributeCompression.js)
module.

Expand Down Expand Up @@ -228,7 +229,9 @@ See the [Batch Table](../BatchTable/README.md) reference for more information.

The glTF asset to be instanced is stored after the feature table and batch table.

[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. Instanced 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. Instanced 3D Models uses [glTF 2.0](https://github.com/KhronosGroup/glTF/tree/master/specification/2.0) to embed model data.

The [binary glTF](https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#binary-gltf-layout) 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.

`header.gltfFormat` determines the format of the glTF field. When it is `0`, the glTF field is

Expand All @@ -242,18 +245,12 @@ In either case, `header.gltfByteLength` contains the length of the glTF field in

If the glTF asset is embedded, it 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.

## File Extension
## File Extension and MIME Type

`.i3dm`
Instanced 3D modela tiles use the `.i3dm` extension and `application/octet-stream` MIME type.
Copy link
Contributor

Choose a reason for hiding this comment

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

Instanced 3D modela -> Instanced 3D Model


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

## MIME Type

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

`application/octet-stream`

## Resources

1. [*A Survey of Efficient Representations of Independent Unit Vectors* by Cigolle et al.](http://jcgt.org/published/0003/02/01/)
Expand Down
14 changes: 5 additions & 9 deletions TileFormats/PointCloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ Per-point normals are an optional property that can help improve the visual qual
The normals will be transformed using the inverse transpose of the tileset transform.

#### Oct-encoded Normal Vectors
Oct-encoding is described in [*A Survey of Efficient Representations of Independent Unit Vectors* by Cigolle et al.](http://jcgt.org/published/0003/02/01/). An implementation for encoding and decoding these unit vectors can be found in Cesium's
Oct-encoding is described in [*A Survey of Efficient Representations of Independent Unit Vectors* by Cigolle et al.](http://jcgt.org/published/0003/02/01/). Oct-encoded values are stored in unsigned, unnormalized range ([0, 65535] or [0, 255]) and then converted to a signed normalized range ([-1.0, 1.0]) at runtime.

Copy link
Contributor

Choose a reason for hiding this comment

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

A few tweaks for this line

  • pnts only uses oct16 encoding so only the [0, 255] range needs to be mentioned
  • Minor wording

Oct-encoded values are stored in unsigned, unnormalized range [0, 255] and then mapped to a signed normalized range [-1.0, 1.0] at runtime.

Copy link
Contributor

Choose a reason for hiding this comment

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

A similar explanation needs to be added i3dm in the Oct-encoded Normal Vectors section but using the range [0, 65535].

> An implementation for encoding and decoding these unit vectors can be found in Cesium's
[AttributeCompression](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/AttributeCompression.js)
module.

Expand Down Expand Up @@ -294,18 +296,12 @@ If the `BATCH_ID` semantic is not defined, then the batch table stores per-point

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

## File Extension
## File Extension and MIME Type

`.pnts`
Point cloud tiles use the `.pnts` extension and `application/octet-stream` MIME type.

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

## MIME Type

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

`application/octet-stream`

## Resources

1. [*A Survey of Efficient Representations of Independent Unit Vectors* by Cigolle et al.](http://jcgt.org/published/0003/02/01/)
Expand Down
6 changes: 6 additions & 0 deletions schema/asset.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
"description" : "Specifies the up-axis of glTF models.",
"enum" : ["X", "Y", "Z"],
"default" : "Y"
},
"extensions" : {
"$ref": "extension.schema.json"
},
"extras" : {
"$ref": "extras.schema.json"
}
},
"required" : ["version"],
Expand Down
6 changes: 6 additions & 0 deletions schema/b3dm.featureTable.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
"properties" : {
"BATCH_LENGTH" : {
"$ref" : "featureTable.schema.json#/definitions/globalPropertyScalar"
},
"extensions" : {
"$ref": "extension.schema.json"
},
"extras" : {
"$ref": "extras.schema.json"
}
},
"required" : ["BATCH_LENGTH"],
Expand Down
12 changes: 12 additions & 0 deletions schema/batchTable.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"properties" : {
"HIERARCHY" : {
"$ref" : "#/definitions/hierarchy"
},
"extensions" : {
"$ref": "extension.schema.json"
},
"extras" : {
"$ref": "extras.schema.json"
}
},
"additionalProperties" : {
Expand Down Expand Up @@ -101,6 +107,12 @@
},
"parentIds" : {
"$ref" : "#/definitions/integerProperty"
},
"extensions" : {
"$ref": "extension.schema.json"
},
"extras" : {
"$ref": "extras.schema.json"
}
},
"required" : ["classes", "instancesLength", "classIds"]
Expand Down
11 changes: 11 additions & 0 deletions schema/extension.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Extension",
"type": "object",
"description": "Dictionary object with extension-specific objects.",
"properties": {
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Change to "properties": {},

"additionalProperties": {
"type": "object"
}
}
5 changes: 5 additions & 0 deletions schema/extras.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Extras",
"description": "Application-specific data."
}
6 changes: 6 additions & 0 deletions schema/i3dm.featureTable.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
},
"QUANTIZED_VOLUME_SCALE": {
"$ref" : "featureTable.schema.json#/definitions/globalPropertyCartesian3"
},
"extensions" : {
"$ref": "extension.schema.json"
},
"extras" : {
"$ref": "extras.schema.json"
}
},
"anyOf" : [{
Expand Down
6 changes: 6 additions & 0 deletions schema/pnts.featureTable.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
},
"BATCH_LENGTH" : {
"$ref" : "featureTable.schema.json#/definitions/globalPropertyScalar"
},
"extensions" : {
"$ref": "extension.schema.json"
},
"extras" : {
"$ref": "extras.schema.json"
}
},
"anyOf" : [{
Expand Down
6 changes: 6 additions & 0 deletions schema/properties.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"minimum" : {
"type" : "number",
"description" : "The minimum value of this property of all the features in the tileset."
},
"extensions" : {
"$ref": "extension.schema.json"
},
"extras" : {
"$ref": "extras.schema.json"
}
},
"required" : ["maximum", "minimum"],
Expand Down
6 changes: 6 additions & 0 deletions schema/tile.content.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"url" : {
"type" : "string",
"description" : "A string that points to the tile's contents with an absolute or relative url. When the url is relative, it is relative to the referring tileset.json. The file extension of content.url defines the tile format. The core 3D Tiles spec supports the following tile formats: Batched 3D Model (*.b3dm), Instanced 3D Model (*.i3dm), Composite (*.cmpt), and 3D Tiles TileSet (*.json)"
},
"extensions" : {
"$ref": "extension.schema.json"
},
"extras" : {
"$ref": "extras.schema.json"
}
},
"required" : ["url"],
Expand Down
6 changes: 6 additions & 0 deletions schema/tile.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
"$ref" : "tile.schema.json"
},
"uniqueItems" : true
},
"extensions" : {
"$ref": "extension.schema.json"
},
"extras" : {
"$ref": "extras.schema.json"
}
},
"required" : ["boundingVolume", "geometricError"],
Expand Down
6 changes: 6 additions & 0 deletions schema/tileset.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
"root" : {
"description" : "The root node.",
"$ref" : "tile.schema.json"
},
"extensions" : {
"$ref": "extension.schema.json"
},
"extras" : {
"$ref": "extras.schema.json"
}
},
"required" : ["asset", "geometricError", "root"],
Expand Down