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

Edit pass over the 3D Tiles Next extensions #62

Merged
merged 2 commits into from
Mar 15, 2022

Conversation

lilleyse
Copy link

@lilleyse lilleyse commented Mar 13, 2022

@lilleyse lilleyse force-pushed the 3d-tiles-next-edits branch from d2c0b36 to 0412a6e Compare March 13, 2022 21:18
Comment on lines +22 to +24
## Optional vs. Required

This extension is optional, meaning it should be placed in the `extensionsUsed` list, but not in the `extensionsRequired` list.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the Optional vs. Required section sooner in the document

Comment on lines +68 to +112
A feature ID set may also include the following properties:

This extension is optional, meaning it should be placed in the `extensionsUsed` list, but not in the `extensionsRequired` list.
* `nullFeatureId`: a value that indicates that a certain instance is not considered to be an identifiable object
* `label`: an alphanumeric string used to identify feature ID sets across different glTF nodes
* `propertyTable`: the index of a property table in the [`EXT_structural_metadata`](../EXT_structural_metadata/) extension

> **Example:** A more complex example with two feature ID sets. The first feature ID set groups instanced trees into forests. The tree with feature ID `2` matches the `nullFeatureId` and therefore does not belong to a forest feature. The second feature ID set (feature ID values not shown) is defined implicitly based on instance index, and identifies individual trees. Each feature ID set refers to a property table that contains metadata about the features.
>
> ![Feature ID by instance](figures/trees.png)
>
> ```jsonc
> {
> "nodes": [
> {
> "mesh": 0,
> "extensions": {
> "EXT_mesh_gpu_instancing": {
> "attributes": {
> "TRANSLATION": 0,
> "ROTATION": 1,
> "SCALE": 2,
> "_FEATURE_ID_0": 3
> },
> },
> "EXT_instance_features": {
> "featureIds": [
> {
> "nullFeatureId": 2,
> "featureCount": 2,
> "attribute": 0,
> "propertyTable": 0,
> "label": "Forests"
> },
> {
> "featureCount": 9,
> "propertyTable": 1,
> "label": "Trees"
> }
> ]
> }
> }
> }
> ]
> }
> ```
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a second example to show other concepts like grouping instances into features and defining implicit feature IDs

Comment on lines -177 to +183
> "propertyTable": 1
> "propertyTable": 1,
> "label": "classification"
> },
> {
> "featureCount": 2,
> "attribute": 0,
> "propertyTable": 0
> "propertyTable": 0,
> "label": "components"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The is a better example to add label to since it has two feature ID sets

@@ -89,8 +89,7 @@ Per-vertex feature IDs can be used to identify individual objects that have been
> "EXT_mesh_features": {
> "featureIds": [{
> "featureCount": 2,
> "attribute": 0,
> "label": "buildings"
> "attribute": 0
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the text from the feature-id-by-attribute diagram above, partly for aesthetic reasons, but also because its redundant with the text above.

Before After
2 1

@@ -75,7 +74,7 @@ A schema may be embedded in the extension directly or referenced externally with
> "extensions": {
> "EXT_structural_metadata": {
> "schema": {
> "id": "schema-001",
> "id": "schema_001",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that you mention this: The current form does not allow the "usual representation" of a https://de.wikipedia.org/wiki/Globally_Unique_Identifier - should - be allowed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm good point. Nor would it support guids with a number as the first character. This could be problematic.

The reason for the limited character set is to allow IDs to be valid identifiers in GLSL, C, C++. If we support hyphens we might as well support full unicode. Engines that generate code based on the IDs - like custom shaders in CesiumJS - would need a translation step. We have something like that already for unicode batch table properties in CesiumJS: CesiumGS/cesium#8785.

Should we drop the alphanumeric requirement for IDs?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@javagl maybe we should move this discussion to a new issue so that it doesn't hold up this PR?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this to CesiumGS/3d-tiles#672

@@ -218,12 +217,12 @@ Enum values are defined as entries in the `enum.values` array. Duplicate names o
The classes defined in the schema are templates describing the data types and meanings of properties. An instance of such a metadata class is referred to as a _metadata entity_, and can be created from a set of values that conform to the structure of the class. This extension defines different ways of storing large amounts of property values inside a glTF asset, in compact binary forms:

- **Property Tables** store property values as parallel arrays in a column-based binary layout, using standard glTF buffer views. These tables can be accessed with a row index, and allow associating complex, structured metadata with arbitrary types with entities of a glTF asset on different levels of granularity.
- **Property Attributes** are a way of storing metadata as vertex attributes, using standard glTF accessors. They can be used to associate certain forms of metadata with vertices of a mesh primitive.
- **Property Attributes** associate vertex attributes of a mesh primitive with a particular metadata class.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a slightly clearer definition of what property attributes do

Comment on lines -224 to +225
The following sections describe these storage formats in more detail.
Each storage type refers to a metadata class, and contains a dictionary of `properties`. Each of these properties corresponds to one property of the metadata class and defines how the actual property data is stored. These property storage definitions may override the [`minimum` and `maximum` values](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#minimum-and-maximum-values) and the [`offset` and `scale`](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#offset-and-scale) from the property definition in the class, to account for the actual range of values that is stored for each property.

Each storage type refers to a metadata class, and contains a dictionary of `properties`. Each of these properties corresponds to one property of the metadata class. Each of these properties define the way how the actual property data is stored. These property storage definitions allow to override the [`minimum` and `maximum` values](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#minimum-and-maximum-values) and the [`offset` and `scale`](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#offset-and-scale) from the property definition in the class, to account for the actual range of values that is stored for each property.
The following sections describe these storage formats in more detail.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swapped these two paragraphs

Comment on lines +504 to +505
> uint32 rawBits = byte0 | (byte1 << 8) | (byte2 << 16) | (byte3 << 24);
> float32 value = uintBitsToFloat(rawBits);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conceptually the same, but maybe clearer as a uint


Each storage type refers to a metadata class, and contains a dictionary of `properties`. Each of these properties corresponds to one property of the metadata class. Each of these properties define the way how the actual property data is stored. These property storage definitions allow to override the [`minimum` and `maximum` values](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#minimum-and-maximum-values) and the [`offset` and `scale`](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#offset-and-scale) from the property definition in the class, to account for the actual range of values that is stored for each property.
The following sections describe these storage formats in more detail.

### Property Tables
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the text from the property table diagram since it is redundant with the section above.

@lilleyse lilleyse requested a review from javagl March 13, 2022 21:28
Copy link

@javagl javagl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look fine for me, just one inlined comment.

@javagl javagl merged commit 094af35 into 3d-tiles-next Mar 15, 2022
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

Successfully merging this pull request may close these issues.

2 participants