Implicit tiling: availableLevels

In implicit tiling there is a property ‘availableLevels’, what’s the purpose of this property?
For example: 3d-tiles-samples/tileset.json at main · CesiumGS/3d-tiles-samples · GitHub

I can set any value or remove the property, but I don’t observe any change in behaviour of the viewer (I’m using CesiumJS 1.95)

From a quick glance at the CesiumJS source code, this indeed seems to be a ‘write only’ property in the current implementation. Its value is assigned from the input JSON, but apparently, it’s never used.

However, the high-level answer is that it is an important piece of information that may be used by other implementations, or via future optimizations in the current implementation of CesiumJS: One feature of the implicit tilesets is that they allow a form of ‘random access’ – namely, to (more or less directly) access certain tiles in a large implicit tree, solely based on their global coordinates.

In a dedicated implementation of this, there could be something like the early bailout based on the availableLevels as shown in this pseudocode:

class ImplicitTileset {
  constructor() {
    ...
    this.availableLevels = ... // Fetched from the input JSON
  }

  Tile getTile(level, x, y, z) {
    
    if (level >= this.availableLevels) {
      return undefined; // Your princess is in another castle...
    }
    
    // Now you don't have to...
    // - compute the 'subtree' that contains the given global coordinates
    // - compute the local coordinates within this subtree
    // - check the tile availability for these local coordinates
    // - load the tile and return it
  }
}

Maybe someone can give more specific insights about why the availableLevels is not used right now, or where it might be used. This might be because CesiumJS does not (yet!) have a dedicated implementation of this sort of ‘random access’, but that’s a gut feeling for now.

1 Like