CesiumGS / 3d-tiles

Specification for streaming massive heterogeneous 3D geospatial datasets :earth_americas:
2.1k stars 466 forks source link

Figure out scope of summary statistics #573

Open lilleyse opened 2 years ago

lilleyse commented 2 years ago

3DTILES_metadata and EXT_mesh_features added support for metadata at multiple granularities. Summary statistics about the metadata are stored in the statistics object, which includes things like min/max for numeric properties or the number of enum occurrences - information that a client can use to populate a UI before fetching tile content.

While we have a first cut for statistics we'd like to get more feedback on design and use cases.

lilleyse commented 2 years ago

CC https://github.com/CesiumGS/3d-tiles/issues/529 for handling mixed-length array properties

donmccurdy commented 2 years ago

In its current form the statistics specification is very flexible and very unopinionated. For purposes of portability between applications, perhaps it is a bit too unopinionated — if it isn't clear what the statistics mean and how they're computed, applications cannot rely on statistics from unknown sources.

A few possible examples of that tension:

(1) The specification is clear that MATN properties use component-wise statistics, but is there any use for that information? It might be better to disallow MATN statistics initially, in case there's a more useful definition we could provide later, like:

function avg(matrices: mat4[0]): mat4 {
  const [t0, r0, s0] = decompose(matrices[0]);
  const [t1, r1, s1] = decompose(matrices[1]);
  ...
  return compose(avg(t0, t1, ...), avg(r0, r1, ...), avg(s0, s1, ...));
}

(2) Classes have unique IDs, and we specify that a tileset may declare classes it does not use, as a hint to the client that tiles or GLB content might make use of those classes. Supposing that is the case, is there any relationship between statistics declared at the tileset, tile, and GLB1 level? Do those statistics need to match exactly, or would statistics have increasing specificity similar to bounding volumes?

1 We did not include statistics EXT_mesh_features, partly to avoid further ambiguities with statistics on Property Textures, but I have been assuming those statistics would eventually return, e.g. as EXT_mesh_features_statistics.