Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Jul 8, 2018
1 parent d8ea050 commit b061080
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 16 deletions.
105 changes: 91 additions & 14 deletions extensions/3DTILES_draco_point_compression/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
## Contents

* [Overview](#overview)
* [Point Cloud schema updates](#point-cloud-schema-updates)
* [Point Cloud tile format updates](#point-cloud-tile-format-updates)
* [Feature Table](#feature-table)
* [Batch Table](#batch-table)
* [Notes](#notes)
* [Resources](#resources)
* [Property reference](#property-reference)

## Overview

Expand All @@ -21,7 +22,7 @@ Draco compresses common properties such as position, color, and normal, as well

This extension is based on [Draco bitstream version 2.2](https://google.github.io/draco/spec/), which is normative and included in scope.

## Point Cloud schema updates
## Point Cloud tile format updates

### Feature Table

Expand Down Expand Up @@ -59,13 +60,14 @@ Below is an example of a Feature Table with the Draco extension set:

#### properties

`properties` defines the properties stored in the compressed data. In the example above, positions, RGB colors, and batch IDs are compressed.
`properties` defines the Feature Table properties stored in the compressed data. In the example above, positions, RGB colors, and batch IDs are compressed.

Each property defined in the extension must correspond to a semantic already defined in the Feature Table JSON.
When a semantic is compressed its `byteOffset` property is ignored and may be set to zero. Its `componentType`, if present,
defines the component type of the uncompressed data.

Each property is associated with a unique ID. This ID is used by the Draco decoder to get the property data from the compressed data.
Each property is associated with a unique ID. This ID is used to identify the property within the compressed data.
No two properties in the Feature Table and Batch Table may use the same ID.

Allowed properties are `"POSITION"`, `"RGBA"`, `"RGB"`, `"NORMAL"`, and `"BATCH_ID"`.

Expand All @@ -75,7 +77,11 @@ The `byteOffset` property specifies a zero-based offset relative to the start of

#### byteLength

The `byteLength` property specifies the length of the compressed data.
The `byteLength` property specifies the length, in bytes, of the compressed data.

#### Schema updates

See [Property reference](#reference-3dtiles_draco_point_compression-feature-table-extension) for the `3DTILES_draco_point_compression` Feature Table schema reference. The full JSON schema can be found in [3DTILES_draco_point_compression.featureTable.schema.json](schema/3DTILES_draco_point_compression.featureTable.schema.json).

### Batch Table

Expand Down Expand Up @@ -108,29 +114,100 @@ Below is an example of a Batch Table with the Draco extension set:

#### properties

`properties` defines additional properties stored in the compressed data. In the example above, intensity and classification are compressed.
`properties` defines additional Batch Table properties stored in the compressed data. In the example above, intensity and classification are compressed.

Each property defined in the extension must correspond to a property name already defined in the Batch Table JSON.
When a property is compressed its `byteOffset` property is ignored and may be set to zero. Its `componentType` and `type` properties
define the component type and type, respectively, of the uncompressed data.

Each property is associated with a unique ID. This ID is also unique among properties in the Feature Table extension.
Each property is associated with a unique ID. This ID is used to identify the property within the compressed data.
No two properties in the Feature Table and Batch Table may use the same ID.

`byteOffset` and `byteLength` are not defined in the Batch Table extension; all compressed data is stored in the Feature Table binary.

#### Schema updates

See [Property reference](#reference-3dtiles_draco_point_compression-batch-table-extension) for the `3DTILES_draco_point_compression` Batch Table schema reference. The full JSON schema can be found in [3DTILES_draco_point_compression.batchTable.schema.json](schema/3DTILES_draco_point_compression.batchTable.schema.json).

### Notes

If some properties are compressed and others are not, the Draco encoder must apply the `POINT_CLOUD_SEQUENTIAL_ENCODING` encoding method.
This ensures that Draco preserves the original ordering of point data.

> **Implementation Note:** For best results when using Draco, all properties in the Feature Table and Batch Table should be Draco compressed, in which
case `POINT_CLOUD_SEQUENTIAL_ENCODING` should not be applied.

JSON schema definitions can be found in
* [3DTILES_draco_point_compression.featureTable.schema.json](./schema/3DTILES_draco_point_compression.featureTable.schema.json)
* [3DTILES_draco_point_compression.batchTable.schema.json](./schema/3DTILES_draco_point_compression.batchTable.schema.json)
> **Implementation Note:** Draco may reorder point data to achieve better compression and smaller file sizes.
For best results, all properties in the Feature Table and Batch Table should be Draco compressed, in which
case `POINT_CLOUD_SEQUENTIAL_ENCODING` should not be applied.

### Resources
## Resources
_This section is non-normative._

* [Draco Open Source Library](https://github.com/google/draco)
* [Cesium Draco Decoder Implementation](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Workers/decodeDraco.js)

## Property reference

* [`3DTILES_draco_point_compression Feature Table extension`](#reference-3dtiles_draco_point_compression-feature-table-extension)
* [`3DTILES_draco_point_compression Batch Table extension`](#reference-3dtiles_draco_point_compression-batch-table-extension)

---------------------------------------
<a name="reference-3dtiles_draco_point_compression-feature-table-extension"></a>
## 3DTILES_draco_point_compression Feature Table extension

Specifies the compressed Feature Table properties and the location of the compressed data in the Feature Table binary.

**Properties**

| |Type|Description|Required|
|---|----|-----------|--------|
|**properties**|`object`|Defines the properties stored in the compressed data. Each property is associated with a unique ID. This ID is used to identify the property within the compressed data. No two properties in the Feature Table and Batch Table may use the same ID.| :white_check_mark: Yes|
|**byteOffset**|`number`|A zero-based offset relative to the start of the Feature Table binary at which the compressed data starts.| :white_check_mark: Yes|
|**byteLength**|`number`|The length, in bytes, of the compressed data.| :white_check_mark: Yes|

Additional properties are not allowed.

### properties :white_check_mark:

Defines the properties stored in the compressed data. Each property is associated with a unique ID. This ID is used to identify the property within
the compressed data. No two properties in the Feature Table and Batch Table may use the same ID.

* **Type**: `object`
* **Required**: Yes
* **Type of each property**: `number`

### byteOffset :white_check_mark:

A zero-based offset relative to the start of the Feature Table binary at which the compressed data starts.

* **Type**: `number`
* **Required**: Yes
* **Minimum**: ` >= 0`

### byteLength :white_check_mark:

The length, in bytes, of the compressed data.

* **Type**: `number`
* **Required**: Yes
* **Minimum**: ` >= 0`

---------------------------------------
<a name="reference-3dtiles_draco_point_compression-batch-table-extension"></a>
## 3DTILES_draco_point_compression Batch Table extension

Specifies the compressed Batch Table properties.

**Properties**

| |Type|Description|Required|
|---|----|-----------|--------|
|**properties**|`object`|Defines the properties stored in the compressed data. Each property is associated with a unique ID. This ID is used to identify the property within the compressed data. No two properties in the Feature Table and Batch Table may use the same ID.| :white_check_mark: Yes|

Additional properties are not allowed.

### properties :white_check_mark:

Defines the properties stored in the compressed data. Each property is associated with a unique ID. This ID is used to identify the property within the compressed data. No two properties in the Feature Table and Batch Table may use the same ID.

* **Type**: `object`
* **Required**: Yes
* **Type of each property**: `number`
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"id" : "3DTILES_draco_point_compression.batchTable.schema.json",
"title": "3DTILES_draco_point_compression Batch Table extension",
"type": "object",
"description" : "Specifies the compressed Batch Table properties.",
"properties": {
"properties": {
"type": "object",
"description": "Defines the properties stored in the compressed data. Each property is associated with a unique ID. This ID is used to identify the property within the compressed data. No two properties in the Feature Table and Batch Table may use the same ID.",
"minProperties": 1,
"additionalProperties": {
"type": "number",
"minimum": 0
}
}
},
"required": ["properties"]
"required": ["properties"],
"additionalProperties" : false
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"id" : "3DTILES_draco_point_compression.featureTable.schema.json",
"title": "3DTILES_draco_point_compression Feature Table extension",
"type": "object",
"description" : "Specifies the compressed Feature Table properties and the location of the compressed data in the Feature Table binary.",
"properties": {
"properties": {
"type": "object",
"description": "Defines the properties stored in the compressed data. Each property is associated with a unique ID. This ID is used to identify the property within the compressed data. No two properties in the Feature Table and Batch Table may use the same ID.",
"minProperties": 1,
"additionalProperties": {
"type": "number",
Expand All @@ -13,12 +16,15 @@
},
"byteOffset": {
"type": "number",
"description": "A zero-based offset relative to the start of the Feature Table binary at which the compressed data starts.",
"minimum": 0
},
"byteLength": {
"type": "number",
"description": "The length, in bytes, of the compressed data.",
"minimum": 0
}
},
"required": ["properties", "byteOffset", "byteLength"]
"required": ["properties", "byteOffset", "byteLength"],
"additionalProperties" : false
}

0 comments on commit b061080

Please sign in to comment.