Skip to content

QuantizedMeshPlugin stops requesting tiles above level 10 when metadataAvailability is set #1436

@code-soldier

Description

@code-soldier

Question

I believe there is an issue in QuantizedMeshPlugin related to how metadataAvailability is handled.
Tiles above level 10 are never requested, even though the terrain supports higher LODs.
I tracked the problem down to the following logic in the source code:

// src\three\plugins\QuantizedMeshPlugin.js

// Calculates whether the given tile should have metadata availability
function getTileHasMetadata( tile, layer ) {

  const level = tile[ TILE_LEVEL ];
  const metadataAvailability = getMetadataAvailability( layer );
  const maxLevel = getMaxLevel( layer );

  return level < maxLevel &&
         metadataAvailability !== -1 &&
         ( level % metadataAvailability ) === 0;
}

In my case, layer.json looks like this:

{
  "maxzoom": 19,
  "metadataAvailability": 10
}

Because metadataAvailability is 10, tiles at level 10 are treated as having metadata.
As a result, tile[TILE_AVAILABLE] is not set for level 10 tiles, and no child tiles are created, so subdivision stops at level 10.

However, the same terrain tiles render correctly up to level 19 in Cesium

Supplemental Data

Library Version

0.4.19

Three.js Version

r180

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions