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

Clarification for only using feature IDs #40

Merged
17 changes: 16 additions & 1 deletion extensions/2.0/Vendor/EXT_mesh_features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,22 @@ Each feature ID definition may include only a single source, so the following ar
- `featureId.offset` and `featureId.repeat` (for a Feature ID Attribute)
- `featureId.index` (for a Feature ID Texture)

Every `propertyTables` index must have an associated `featureIds` definition, but feature IDs may be defined without a property table. The `propertyTables` entry at index `i` corresponds to the `featureIds` entry at the same index. As a result, the length of the `featureIds` array must be greater than or equal to the length of the `propertyTables` array. Each (`featureId`, `propertyTable`) pair must be unique, but individual feature IDs and property tables may be repeated within a primitive or node.
Feature IDs may be assigned to primitives or nodes, but do not have to be associated with a property table. This is useful when the feature IDs are supposed to be resolved externally by an application.
Copy link

Choose a reason for hiding this comment

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

I think this could be worded a little clearly, and I think we can add another use case (using feature IDs for styling.)

Here's one possible wording:

Suggested change
Feature IDs may be assigned to primitives or nodes, but do not have to be associated with a property table. This is useful when the feature IDs are supposed to be resolved externally by an application.
Feature IDs may be assigned to primitives or nodes without being associated with a property table. This is useful when an application retrieves properties from an external resource (e.g. a database or REST API). This can also be used for identifying features in a mesh for styling in an application, even if no properties are stored.

Copy link

Choose a reason for hiding this comment

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

oh another thing, sets of feature IDs may be stored in primitives or nodes in the schema, but conceptually feature IDs themselves are only ever assigned to vertices, GPU instances or texels. it would be good to read through this section and make sure we're consistent with our wording.

Copy link

Choose a reason for hiding this comment

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

hm... in thinking about this some more, "sets" of feature IDs could get a little ambiguous, as all the FEATURE_ID_n semantics together could also be referred to as a "set of feature IDs"...

When in doubt, it might be better to be explicit and say "featureIds entries" or something like that?


> **Example:** A minimal example for assigning feature IDs to a mesh primitive, using an implicit vertex attribute: The default value for the `offset` is 0, and the value for `repeat` is 3. This means that the vertices will receive the feature IDs `[0, 0, 0, 1, 1, 1, 2, 2, 2, ...]`, causing the vertices of each triangle to receive the same feature ID.
>
> ```jsonc
> // Primitive:
> "extensions": {
> "EXT_mesh_features": {
> "featureIds": [
> { "repeat": 3 }
> ]
> }
> }
> ```

When feature IDs are associated with property tables, then every `propertyTables` index must have an associated `featureIds` definition. The `propertyTables` entry at index `i` corresponds to the `featureIds` entry at the same index. As a result, the length of the `featureIds` array must be greater than or equal to the length of the `propertyTables` array. Each (`featureId`, `propertyTable`) pair must be unique, but individual feature IDs and property tables may be repeated within a primitive or node.

Empty feature IDs (e.g. `{}`) are disallowed — a feature ID must explicitly set at least one property.

Expand Down