-
Notifications
You must be signed in to change notification settings - Fork 474
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
Adds 3DTILES_binary_buffers extension #415
Closed
Closed
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
60bcc55
Adds preliminary design for 3DTILES_binary_buffers
8031e2a
Adds example
a937cf1
Adds property reference
sanjeetsuhag 578f57b
Fixes property description for element type and component type to cor…
sanjeetsuhag d2e143f
Minor fixes
a7a0f3f
Adds byte boundary note for BIT component type
f1f27f7
Adds data alignment section, adds NONUNIFORM element type for storage…
sanjeetsuhag File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
# 3DTILES_binary_buffers | ||
|
||
## Overview | ||
|
||
This extension to 3D Tiles enables storage of binary data in external buffers. | ||
|
||
## Properties Reference | ||
|
||
--------------------------------------- | ||
### 3DTILES_binary_buffers.bufferViews | ||
|
||
`bufferViews` provide a typed view into a `buffer`. | ||
|
||
**Properties** | ||
|
||
| |Type|Description|Required| | ||
|---|----|-----------|--------| | ||
|**buffer**|`integer`|The index of the buffer.|☑️ Yes| | ||
|**byteOffset**|`integer`|The offset relative to the start of the buffer in bytes.|☑️ Yes| | ||
|**byteLength**|`integer`|The length of the bufferView in bytes.| ☑️ Yes| | ||
|**elementCount**|`integer`|The number of elements in the buffer view.| ☑️ Yes| | ||
|**elementByteOffsetsBufferView**|`integer`|The index of the bufferView containing byte offsets for each element. Must be defined for the STRING type.|No| | ||
|**elementType**|`string`|Specifies if the attribute is a scalar, vector, matrix or string.|No, default is `SCALAR`.| | ||
|**componentType**|`string`|The datatype of components in the attribute.|☑️ Yes| | ||
|
||
|
||
#### Element Types | ||
|
||
| Element Type | No. of components | | ||
|:------------:|:-----------------:| | ||
| SCALAR | 1 | | ||
| STRING | 1 | | ||
sanjeetsuhag marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| VEC2 | 2 | | ||
| VEC3 | 3 | | ||
| VEC4 | 4 | | ||
| MAT2 | 4 | | ||
| MAT3 | 9 | | ||
| MAT4 | 16 | | ||
|
||
*Note: The `STRING` element type only stores UTF-8 encoded strings.* | ||
|
||
#### Component Types | ||
|
||
| Component | Size (bits) | | ||
|:---------:|:------------:| | ||
| BIT | 1 | | ||
| BYTE | 8 | | ||
| UNSIGNED_BYTE | 8 | | ||
| SHORT | 16 | | ||
| UNSIGNED_SHORT | 16 | | ||
| HALF_FLOAT | 16 | | ||
| INT | 32 | | ||
| UNSIGNED_INT | 32 | | ||
| FLOAT | 32 | | ||
| DOUBLE | 64 | | ||
|
||
|
||
--------------------------------------- | ||
### 3DTILES_binary_buffers.buffers | ||
A buffer points to a blob data. | ||
|
||
**Properties** | ||
|
||
| |Type|Description|Required| | ||
|---|----|-----------|--------| | ||
|**uri**|`string`|The uri of the buffer.| ☑️ Yes| | ||
|**byteLength**|`integer`|The total byte length of the buffer view.| ☑️ Yes| | ||
sanjeetsuhag marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Examples | ||
|
||
### 3DTILES_implicit_tiling and 3DTILES_tile_metadata | ||
|
||
```json | ||
{ | ||
"asset": { | ||
"version": "2.0.0-alpha.0" | ||
sanjeetsuhag marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
"extensions": { | ||
"3DTILES_implicit_tiling": { | ||
"tilingScheme": "quadtree", | ||
"subdivision": { | ||
"completeLevels": 2, | ||
"bufferView": 0 | ||
}, | ||
"content": { | ||
"levelOffset": 2, | ||
"levelOffsetFill": 0, | ||
"bufferView": 1 | ||
}, | ||
"metadata": { | ||
"levelOffset": 2, | ||
"levelOffsetFill": 0, | ||
"bufferView": 1 | ||
sanjeetsuhag marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
}, | ||
"3DTILES_tile_metadata": { | ||
"properties": { | ||
"surfaceArea": { | ||
"semantic": "_SURFACE_AREA", | ||
"bufferView": 2 | ||
}, | ||
"tileId": { | ||
"semantic": "_TILE_ID", | ||
"bufferView": 3 | ||
} | ||
} | ||
}, | ||
"3DTILES_binary_buffers": { | ||
"bufferViews": [ | ||
{ | ||
"elementType": "VEC2", | ||
"componentType": "BIT", | ||
"byteOffset": 0, | ||
"byteLength": 2, | ||
"buffer": 0 | ||
}, | ||
{ | ||
"elementType": "SCALAR", | ||
"componentType": "BIT", | ||
"byteOffset": 2, | ||
"byteLength": 4, | ||
"buffer": 0 | ||
}, | ||
{ | ||
"elementType": "SCALAR", | ||
"componentType": "FLOAT", | ||
"byteOffset": 0, | ||
"byteLength": 32, | ||
"buffer": 1 | ||
}, | ||
{ | ||
"elementType": "STRING", | ||
"byteOffset": 32, | ||
"byteLength": 64, | ||
"elementByteOffsetsBufferView": 5, | ||
sanjeetsuhag marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"buffer": 2 | ||
}, | ||
{ | ||
"elementType": "SCALAR", | ||
"componentType": "UNSIGNED_INT", | ||
"byteOffset": 0, | ||
"byteLength": 32, | ||
"buffer": 2 | ||
} | ||
], | ||
"buffer": [ | ||
sanjeetsuhag marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
"uri": "implicit.bin", | ||
"byteLength": 6 | ||
}, | ||
{ | ||
"uri": "metadata_surface_area.bin", | ||
"byteLength": 32 | ||
}, | ||
{ | ||
"uri": "metadata_tile_id.bin", | ||
"byteLength": 96 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
|
||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can
elementByteOffsetBufferView
be used for properties containing arbitrary sized chunks of binary data? What would be theelementType
in that case?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.
Sorry, duplicate comment to #415 (comment). I thought github lost this one.
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.
Yes, a
NONUNIFORM
element type will be introduced in next draft to meet the requirements forEXT_3dtiles_feature_metadata
.