-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Disambiguation of attribute semantic names #2111
Comments
Excellent question. I think it's a case where the spirit and the letter of the spec have slightly diverged. The underscore attributes are akin to |
Disclosure: I'm an 'Independent Contributor' for the Khronos Group, and been involved in the development of glTF extensions as part of my freelancing work, for a company that is also a Khronos member. I do not endorse or promote these extensions in my role as a Khronos contributor. They are only examples of cases where the question about the 'Disambiguation of attribute semantic names' is relevant. But the question refers to the glTF specification in general, and is not specific for these extensions. Two extensions are currently proposed (as pull requests) that make heavy use of glTF attributes for storing 'binary data':
|
Triggered by a comment in another issue: This could become increasingly important. Without any rule or resolution here, there will be extensions and clients that implement them, with little room for changing the attribute names after the extension was published/merged. So this should be resolved rather sooner than later. The question still is: How will it be resolved? I could hardly think of any sensible solution, except for prefixing the semantics with the extension name - we simply do not have any uniqueness guarantees beyond that name. So while it's probably fine to refer to the names as Details:
Some discussion points:
I did start a more elaborate description of the extension development process (quite a while ago now), and information about how this issue is resolved could fit into the Technical/Naming section. |
@javagl : Do you have a idea for where a naming "committee" would reside. I can envision several different kinds of structures. I think one with the most transparency and least overhead would be best, but I am not sure how to measure either criteria at this time. |
First of all, the validator is never an authority. It's just a tool that could be changed at any time.
Reviewing this area again, it's not that obvious. The base spec:
So it's clear that extensions can define new attributes not starting with an underscore. Besides, it would be easy to use that starting underscore character to differentiate between attributes with a well-defined meaning and restricted to specific accessor formats and out-of-scope attributes not intended for interoperability. For example, an app currently may use an attribute named So I propose leaving the attributes that start with an underscore for app-specific purposes only. To disambiguate cases where one extension name is a substring of another extension name, a delimiter is needed between the extension name and the attribute name. Something like
Yes. There are several ways of handling this:
All these options are within the scope of extensions and do not need any extra spec support. |
That answers my question from the first post:
But that the aspect of the names for extension-defined attributes is not made explicit (enough)
Yes, an attribute name (I'm starting to wonder whether the attribute names should have been more constrained right from the beginning. We could have attribute names like I don't have a strong preference for the "shared attributes" issue right now. But both introducing a new extension and establishing a dependency from one extension to the other sound like they could involve some undesired connection and overhead. So maybe the third option can be fleshed out a bit more, or maybe there can be a solution that only establishes a special naming scheme for this (probably rare) case. |
Yes, this should be clarified in the base spec.
FWIW, a string is just a sequence of Unicode code points that could be seen as arbitrary integers. As long as the delimitation between extension and attribute names is well defined, actual substrings are not very important from the specification point of view (this surely does not mean that such names should include SQL commands).
I wouldn't call it undesired given that both of those hypothetical extensions intend to refer to the same attribute semantic. |
The (Meshes) Overview section of the specification says
Some questions are not sufficiently answered by this.
The first question is very vague and hard to answer specifically: What constitutes "application-specific"?
A broader, more specific, and somewhat crucial question is: Is it possible to disambiguate custom attribute names in extensions?
For example, there could be two extensions that both define a generic attribute name like
_ID
or_VALUE
. The name clash would prevent the extensions to be used at the same time. A seemingly simple and straightforward solution would be to require the attribute names to be prefixed with the extension name. Something like"_EXT_foo_bar_ID"
looks a bit odd, but is as unambiguous as it gets. In any case: Only requiring the undescore prefix may not be sufficient (also because there is no way to sensibly figure out which extension might already use which attribute names).A question that is somewhat tangential, but brought up this one (via CesiumGS/3d-tiles#611 ): Can extensions define custom attributes without the
_
underscore?Based on my understanding, the answer to this is no: The validator dedicatedly checks for the semantics that are defined in the core spec, and only skips the ones that start with an undescore, via the
checkAttributeSemanticName
function, causing aMESH_PRIMITIVE_INVALID_ATTRIBUTE
error for all unknown attribute names that do not start with an underscore. But I wanted to ask for a confirmation here: Is it correct that such attribute names would be considered as invalid even when the support for the extension was added to the validator?The text was updated successfully, but these errors were encountered: