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

Store property tables separately in subtree JSON #10177

Merged
merged 3 commits into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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 CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- Added support for subtree metadata. [#10093](https://github.com/CesiumGS/cesium/pull/10093)
- Updated implicit tiling availability to match the latest schema. [#10107](https://github.com/CesiumGS/cesium/pull/10107)
- Added support for content metadata in tilesets with implicit tiling. [#10123](https://github.com/CesiumGS/cesium/pull/10123)
- Implicit tile metadata is now stored in `tileMetadata` in the subtree JSON, rather than the `3DTILES_metadata` extension. [#10163] (https://github.com/CesiumGS/cesium/pull/10163)
- Implicit tile and content metadata is now stored in the `propertyTables` array in the subtree JSON. `tileMetadata` and `contentMetadata` are an index and array of indices respectively that point to the corresponding property tables. This eliminates the need for the `3DTILES_metadata` extension. [#10177](https://github.com/CesiumGS/cesium/pull/10177)
- Split `EXT_mesh_features` into `EXT_mesh_features`, `EXT_instance_features`, `EXT_structural_metadata` [#10199](https://github.com/CesiumGS/cesium/pull/10119)
- `EXT_mesh_features`:
- Updated feature ID parsing to match the latest schema [#10087](https://github.com/CesiumGS/cesium/pull/10087)
Expand Down
21 changes: 15 additions & 6 deletions Source/Scene/ImplicitSubtree.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,23 @@ function initialize(subtree, json, subtreeView, implicitTileset) {
let tilePropertyTableJson;
if (hasExtension(subtreeJson, "3DTILES_metadata")) {
tilePropertyTableJson = subtreeJson.extensions["3DTILES_metadata"];
} else {
tilePropertyTableJson = subtreeJson.tileMetadata;
} else if (defined(subtreeJson.tileMetadata)) {
const propertyTableIndex = subtreeJson.tileMetadata;
tilePropertyTableJson = subtreeJson.propertyTables[propertyTableIndex];
}

const contentPropertyTableJsons = defaultValue(
subtreeJson.contentMetadata,
[]
);
const contentPropertyTableJsons = [];
if (defined(subtreeJson.contentMetadata)) {
const length = subtreeJson.contentMetadata.length;
for (let i = 0; i < length; i++) {
const propertyTableIndex = subtreeJson.contentMetadata[i];
contentPropertyTableJsons.push(
subtreeJson.propertyTables[propertyTableIndex]
);
}
}

// TODO: FIGURE OUT FAILURE IN IMPLICIT SUBTREE SPEC
j9liu marked this conversation as resolved.
Show resolved Hide resolved

let metadata;
const schema = implicitTileset.metadataSchema;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@
"childSubtreeAvailability": {
"constant": 0
},
"tileMetadata": {
"class": "tile",
"properties": {
"contentBounds": {
"values": 0
"propertyTables": [
{
"class": "tile",
"properties": {
"contentBounds": {
"values": 0
}
}
}
}
],
"tileMetadata": 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,21 @@
"childSubtreeAvailability": {
"constant": 0
},
"tileMetadata": {
"class": "tile",
"properties": {
"minimumHeight": {
"values": 0
},
"maximumHeight": {
"values": 1
},
"boundingRegion": {
"values": 2
"propertyTables": [
{
"class": "tile",
"properties": {
"minimumHeight": {
"values": 0
},
"maximumHeight": {
"values": 1
},
"boundingRegion": {
"values": 2
}
}
}
}
],
"tileMetadata": 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@
"childSubtreeAvailability": {
"constant": 0
},
"tileMetadata": {
"class": "tile",
"properties": {
"minimumHeight": {
"values": 0
},
"maximumHeight": {
"values": 1
"propertyTables": [
{
"class": "tile",
"properties": {
"minimumHeight": {
"values": 0
},
"maximumHeight": {
"values": 1
}
}
}
}
],
"tileMetadata": 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"childSubtreeAvailability": {
"constant": 0
},
"contentMetadata": [
"propertyTables" : [
{
"class": "building",
"properties": {
Expand All @@ -60,6 +60,9 @@
}
}
],
"contentMetadata": [
0
],
"extensions": {
"3DTILES_metadata": {
"class": "tile",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"childSubtreeAvailability": {
"constant": 0
},
"contentMetadata": [
"propertyTables": [
{
"class": "building",
"properties": {
Expand All @@ -58,17 +58,19 @@
"values": 4
}
}
}
],
"tileMetadata": {
"class": "tile",
"properties": {
"quadrant": {
"values": 1
},
"color": {
"values": 2
},
{
"class": "tile",
"properties": {
"quadrant": {
"values": 1
},
"color": {
"values": 2
}
}
}
}
],
"contentMetadata": [0],
"tileMetadata": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@
"childSubtreeAvailability": {
"constant": 0
},
"tileMetadata": {
"class": "tile",
"properties": {
"geometricError": {
"values": 0
"propertyTables": [
{
"class": "tile",
"properties": {
"geometricError": {
"values": 0
}
}
}
}
],
"tileMetadata": 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"buffers": [
{
"byteLength": 8,
"uri": "availability.bin"
"uri": "../availability.bin"
}
],
"bufferViews": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"buffers": [
{
"byteLength": 8,
"uri": "../availability.bin"
}
],
"bufferViews": [
{
"buffer": 0,
"byteOffset": 0,
"byteLength": 1
}
],
"tileAvailability": {
"constant": 1
},
"childSubtreeAvailability": {
"constant": 0
},
"contentAvailability": [
{
"constant": 1
},
{
"bitstream": 0
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"subtreeLevels": 2,
"availableLevels": 2,
"subtrees": {
"uri": "subtrees/{level}.{x}.{y}.json"
"uri": "subtrees/1.0/{level}.{x}.{y}.json"
}
},
"3DTILES_multiple_contents": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
"asset": {
"version": "1.1"
},
"extensionsUsed": [
"3DTILES_multiple_contents"
],
"extensionsRequired": [
"3DTILES_multiple_contents"
],
"schema": {
"classes": {
"layer": {
Expand Down Expand Up @@ -56,23 +50,19 @@
"subtreeLevels": 2,
"availableLevels": 2,
"subtrees": {
"uri": "subtrees/{level}.{x}.{y}.json"
"uri": "subtrees/1.1/{level}.{x}.{y}.json"
}
},
"extensions": {
"3DTILES_multiple_contents": {
"content": [
{
"uri": "ground/{level}/{x}/{y}.b3dm",
"group": "ground"
},
{
"uri": "sky/{level}/{x}/{y}.b3dm",
"group": "sky"
}
]
"contents": [
{
"uri": "ground/{level}/{x}/{y}.b3dm",
"group": "ground"
},
{
"uri": "sky/{level}/{x}/{y}.b3dm",
"group": "sky"
}
},
],
"geometricError": 70,
"refine": "ADD"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,21 @@
"childSubtreeAvailability": {
"constant": 0
},
"tileMetadata": {
"class": "tile",
"properties": {
"minimumHeight": {
"values": 0
},
"maximumHeight": {
"values": 1
},
"boundingRegion": {
"values": 2
"propertyTables": [
{
"class": "tile",
"properties": {
"minimumHeight": {
"values": 0
},
"maximumHeight": {
"values": 1
},
"boundingRegion": {
"values": 2
}
}
}
}
],
"tileMetadata": 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,21 @@
"childSubtreeAvailability": {
"constant": 0
},
"tileMetadata": {
"class": "tile",
"properties": {
"minimumHeight": {
"values": 0
},
"maximumHeight": {
"values": 1
},
"boundingSphere": {
"values": 2
"propertyTables": [
{
"class": "tile",
"properties": {
"minimumHeight": {
"values": 0
},
"maximumHeight": {
"values": 1
},
"boundingSphere": {
"values": 2
}
}
}
}
],
"tileMetadata": 0
}
Loading