-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Tightening indexed attribute semantics #1023
Comments
Suggest, that index has to start with 0 (no 1, 2, 3) and no "gaps" (no 0, 1, 3, 4) are allowed. |
The description of However, I'll have to think about where this actually matters in the implementation. In the end, these are just strings. I assume that this aims at preventing implementations from doing short-sighted things like
which may overlook a |
So, |
There could be a corner case with undefined Both primitives use the same {
"materials": [
{
"pbrMetallicRoughness": {
"baseColorTexture": {
"index": 0,
"texCoord": 0
}
},
"occlusionTexture": {
"index": 1,
"texCoord": 1
}
}
],
"meshes": [
{
"primitives": [
{
"attributes": {
"POSITION": 0,
"TEXCOORD_0": 1,
"TEXCOORD_1": 2
},
"material": 0
},
{
"attributes": {
"POSITION": 3,
"COLOR_0": 4,
"TEXCOORD_1": 5
},
"material": 0
}
]
}
]
} |
In my opinion, the above glTF is invalid:
If a material is assigned to a primitive, it is expected, that all parameters are used and finally the visual output is as expected. In my opinion it should not be allowed, that material parameters are discarded, just because the primitive does not have the required parameters. Any exporter has to take care of this. I have done this by hand but I think this is the way an exporter should solve this:
|
No objections. |
Seems reasonable to me. |
Discussed on a 3D Formats call.
@lexaknyazev volunteered to make this explicit in this spec and to update the validator. |
From meshes:
Atm, spec doesn't require indexed semantic to start with
0
. This leads to couple tricky cases:TEXCOORD_1
be declared withoutTEXCOORD_0
?JOINTS_1
.TEXCOORD_1
andTEXCOORD_2
(let's say that material's texture info uses matching indices)?Spec has a table with valid semantic names that start with
0
, but it's not as strict as it should be, imho.Also, we should add that
JOINTS
andWEIGHTS
semantics must be both present or both absent.CC @pjcozzi @bghgary @UX3D-nopper @javagl
The text was updated successfully, but these errors were encountered: