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

Update and extend the implicit tiling examples #512

Closed
javagl opened this issue Oct 18, 2021 · 3 comments
Closed

Update and extend the implicit tiling examples #512

javagl opened this issue Oct 18, 2021 · 3 comments
Assignees

Comments

@javagl
Copy link
Contributor

javagl commented Oct 18, 2021

There are currently three examples for implicit tiling data sets. One of them is https://github.com/CesiumGS/3d-tiles/tree/3d-tiles-next/extensions/3DTILES_implicit_tiling/examples/sparseOctree

The tileset JSON says "subtreeLevels": 2.

The section https://github.com/CesiumGS/3d-tiles/tree/3d-tiles-next/extensions/3DTILES_implicit_tiling#availability-bitstream-lengths says that the length of the tile availability bitstream is

(N^subtreeLevels - 1)/(N - 1)

For N=8 and subtreeLevels=2, this should yield 9.

The section also says that

lengthBytes = ceil(lengthBits / 8), which would be 2, in this case.

But the tileAvailability of the JSON of subtree 0/0/0/0.subtree refers to bufferView: 0, which is said to have "byteLength": 1:

{
  "buffers" : [ {
    "byteLength" : 9
  } ],
  "bufferViews" : [ {
    "buffer" : 0,
    "byteOffset" : 0,
    "byteLength" : 1
  }, {
    "buffer" : 0,
    "byteOffset" : 1,
    "byteLength" : 8
  } ],
  "tileAvailability" : {
    "bufferView" : 0
  },
  "childSubtreeAvailability" : {
    "bufferView" : 1
  },
  "contentAvailability" : {
    "bufferView" : 0
  }
}

The same applies to the basicExample.


The examples should be updated to be valid, and extended to show different configurations, like sparse- and dense quadtrees and octrees with different heights and subtree-heights.

Preferably, the examples should be documented extensively, including information that can otherwise only be derived from actually reading the subtree files and interpreting the data correctly. This means that the JSON part that is contained in the subtree files should be part of the documentation, and the binary parts (i.e. the availability info) should be documented in a form that might say, for example,

The availability bytes are 0xCAFEBEEF, which is the bit pattern 01101010111101...

so that implementors can easily verify that their interpretation of the data is correct.


(Rumours say that such examples could go into https://github.com/CesiumGS/3d-tiles-samples at some point, but making sure that the ones that are currently here are valid would be the first step, if these new examples are not created with a completely new mechanism...)

@ptrgags
Copy link
Contributor

ptrgags commented Oct 26, 2021

Note that there are more tilesets used for unit testing in CesiumJS: https://github.com/CesiumGS/cesium/tree/main/Specs/Data/Cesium3DTiles/Implicit

We'll have to check through them to see if any of them need updating.

@ptrgags
Copy link
Contributor

ptrgags commented Nov 1, 2021

For lack of a better place to put this, here's another implicit tiling example that would be good to make into a real tileset and put in 3d-tiles-samples -- this is an example of making a double-headed quadtree for global-scale tilesets.

{
  "asset": {
    "version": "1.0"
  },
  "geometricError": 8000,
  "extensionsUsed": [
    "3DTILES_implicit_tiling"
  ],
  "extensionsRequired": [
    "3DTILES_implicit_tiling"
  ],
  "root": {
    "boundingVolume": {
      "region": [-3.14159265359, -1.57079632679, 3.14159265359, 1.57079632679, 0, 1000]
    },
    "refine": "REPLACE",
    "geometricError": 4000,
    "children": [
      {
        "boundingVolume": {
          "region": [-3.14159265359, -1.57079632679, 0, 1.57079632679, 0, 1000]
        },
        "content": {
          "uri": "content/western-hemisphere/{level}/{x}/{y}.b3dm"
        },
        "geometricError": 2000,
        "extensions": {
          "3DTILES_implicit_tiling": {
            "subdivisionScheme": "QUADTREE",
            "maximumLevel": 20,
            "subtrees": {
              "uri": "subtrees/eastern-hemisphere/{level}/{x}/{y}.subtree"
            },
            "subtreeLevels": 7
          }
        }
      },
      {
        "boundingVolume": {
          "region": [0, -1.57079632679, 3.14159265359, 1.57079632679, 0, 1000]
        },
        "content": {
          "uri": "content/eastern-hemisphere/{level}/{x}/{y}.b3dm"
        },
        "geometricError": 2000,
        "extensions": {
          "3DTILES_implicit_tiling": {
            "subdivisionScheme": "QUADTREE",
            "maximumLevel": 20,
            "subtrees": {
              "uri": "subtrees/eastern-hemisphere/{level}/{x}/{y}.subtree"
            },
            "subtreeLevels": 7
          }
        }
      }
    ]
  }
}

@ptrgags
Copy link
Contributor

ptrgags commented Nov 15, 2021

This has been mostly addressed in https://github.com/CesiumGS/3d-tiles-samples, and #562 has any further details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants