-
Notifications
You must be signed in to change notification settings - Fork 470
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
Changes from 1 commit
0e22b00
7cc26a8
5a62d6f
59247c4
101e8a5
12d2583
7c9d494
90b53dd
86d05ae
d68fb03
77c87f8
192a632
9e7dfc7
5586e25
5117393
7169305
ba91831
899b3a3
d3fce88
026d7dd
0f190b1
d5c5491
f0e031b
469a860
af25031
4615dcb
83f0144
13d6f78
c3f7c96
1143bfa
7b9ae34
e204c9b
082ec85
fd74204
c02ba37
ef40a6e
4f6fc68
c954b2b
36dde46
5ba688c
384e749
98854ad
f5bffdd
4bc6f90
6dce1a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
@@ -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. | ||
|
||
`application/json` | ||
## File Extensions and MIME Types | ||
|
||
* Tileset styles use the `.json` extension and the `application/json` mime type. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same note as before where the extension is not required. |
||
|
||
## Acknowledgments | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
||
|
@@ -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. | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop the word |
||
|
||
## 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. | ||
|
||
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
||
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here it should be noted that 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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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/) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
||
|
@@ -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 | ||
|
||
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
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/) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A few tweaks for this line
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A similar explanation needs to be added |
||
> 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. | ||
|
||
|
@@ -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/) | ||
|
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": { | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change to |
||
"additionalProperties": { | ||
"type": "object" | ||
} | ||
} |
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." | ||
} |
There was a problem hiding this comment.
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.