CesiumGS / cdb-to-3dtiles

Convert CDB to 3D Tiles
Apache License 2.0
76 stars 28 forks source link

3D Tiles Next improvements #28

Open lilleyse opened 4 years ago

lilleyse commented 4 years ago

Brainstorming some improvements that 3D Tiles Next might bring to CDB to 3D Tiles

ErixenCruz commented 3 years ago

The plan is to first create an implicit tileset writer that parses the CDB directory structure to get the contents and metadata template URIs needed to write the root tileset JSON. which looks something like this:

---
"root": {
    "refine": "ADD",
    "geometricError": 16384.0,
    "boundingVolume": {
      "region": [-1.707, 0.543, -1.706, 0.544, 203.895, 253.113]
    },
    "extensions": {
      "3DTILES_implicit_tiling": {
        "extensions": {
          "3DTILES_tile_contents": {
            "content": [
              {
                "uri": "buildings/{level}/{x}/{y}.b3dm",
                "extensions": {
                  "3DTILES_metadata": {
                    "layer": "buildings"
                  }
                }
              },
              {
                "uri": "trees/{level}/{x}/{y}.i3dm",
                "extensions": {
                  "3DTILES_metadata": {
                    "layer": "trees"
                  }
                }
              }
            ]    
          }
        },
        "maximumLevel": 16,
        "subdivisionScheme": "QUADTREE",
        "subtreeLevels": 10,
        "subtrees": {
          "uri": "subtrees/{level}/{x}/{y}.subtree"
        }
      }
    }
  }

This new tileset writer will likely be in TileFormatIO.cpp, since that is where the explicit writer is.

Then, we can start creating the availability buffers for the subtrees. This has already been done in the UTIC terrain tiler here. I'm not sure how much of that applies to use with CDB, but it is a starting point. I will read it more thoroughly when it comes time to implement availability. We will follow the combined subtree JSON and availability buffers binary file described here.

lilleyse commented 3 years ago

One thing to be careful about for implicit tiling is the CDB tiling scheme. The world is split into GeoCells, and within each GeoCell levels [-10, -1] add progressively more detail but only levels [0, N] subdivide as a quadtree. Therefore level 0 CDB tiles would have the implicit extension on them but everything else before that would be part of the explicit tileset.