KhronosGroup / KhronosGroup/glTF-Validator
Allow for extension-defined attribute names
- Dominant language
- Dart
- Stars
- 470
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Description
Right now, the validator is checking [whether an attribute name starts with `_` (underscore)](https://github.com/KhronosGroup/glTF-Validator/blob/434283be08a668a8fb4e437145630ddbf93b0686/lib/src/base/mesh.dart#L186) and performs a strict validation of the "known" attribute names if this is not the case. In the future, attribute names can also be prefixed with an extension name. The specification update is still pending via https://github.com/KhronosGroup/glTF/pull/2514 . But there already is an extension that uses the _new_ semantics structure (and it is currently declared as "Release Candidate"), namely, `KHR_gaussian_splatting`.
The following is a supposedly valid asset that is using this extension (in _embedded_ representation):
```json
{
"extensionsUsed" : [ "KHR_gaussian_splatting" ],
"accessors" : [ {
"bufferView" : 0,
"byteOffset" : 0,
"componentType" : 5126,
"count" : 8,
"type" : "VEC3",
"max" : [ 100.0, 100.0, 100.0 ],
"min" : [ 0.0, 0.0, 0.0 ]
}, {
"bufferView" : 0,
"byteOffset" : 128,
"componentType" : 5126,
"count" : 8,
"type" : "VEC3",
"max" : [ 1.0, 1.0, 1.0 ],
"min" : [ 1.0, 1.0, 1.0 ]
}, {
"bufferView" : 0,
"byteOffset" : 256,
"componentType" : 5126,
"count" : 8,
"type" : "VEC4",
"max" : [ 0.0, 0.0, 0.0, 1.0 ],
"min" : [ 0.0, 0.0, 0.0, 1.0 ]
}, {
"bufferView" : 0,
"byteOffset" : 384,
"componentType" : 5126,
"count" : 8,
"type" : "SCALAR",
"max" : [ 20.0 ],
"min" : [ 20.0 ]
}, {
"bufferView" : 0,
"byteOffset" : 512,
"componentType" : 5126,
"count" : 8,
"type" : "VEC3",
"max" : [ 1.7724539, 1.7724539, 1.7724539 ],
"min" : [ 1.7724539, 1.7724539, 1.7724539 ]
} ],
"asset" : {
"generator" : "JglTF from https://github.com/javagl/JglTF",
"version" : "2.0"
},
"buffers" : [ {
"uri" : "data:application/gltf-buffer;base64,AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADIQgAAAAAAAAAAAADIQgAAAAAAAAAAAAAAAAAAyEIAAMhCAAAAAAAAyEIAAAAAAAAAAAAAAAAAAMhCAAAAAAAAyEIAAAAAAADIQgAAyEIAAAAAAAAAAAAAyEIAAMhCAADIQgAAAAAAAIA/AACAPwAAgD8AAAAAAACAPwAAgD8AAIA/AAAAAAAAgD8AAIA/AACAPwAAAAAAAIA/AACAPwAAgD8AAAAAAACAPwAAgD8AAIA/AAAAAAAAgD8AAIA/AACAPwAAAAAAAIA/AACAPwAAgD8AAAAAAACAPwAAgD8AAIA/AAAAAAAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AACgQQAAAAAAAAAAAAAAAAAAoEEAAAAAAAAAAAAAAAAAAKBBAAAAAAAAAAAAAAAAAACgQQAAAAAAAAAAAAAAAAAAoEEAAAAAAAAAAAAAAAAAAKBBAAAAAAAAAAAAAAAAAACgQQAAAAAAAAAAAAAAAAAAoEEAAAAAAAAAAAAAAADF3+I/xd/iP8Xf4j8AAAAAxd/iP8Xf4j/F3+I/AAAAAMXf4j/F3+I/xd/iPwAAAADF3+I/xd/iP8Xf4j8AAAAAxd/iP8Xf4j/F3+I/AAAAAMXf4j/F3+I/xd/iPwAAAADF3+I/xd/iP8Xf4j8AAAAAxd/iP8Xf4j/F3+I/AAAAAA==",
"byteLength" : 640
} ],
"bufferViews" : [ {
"buffer" : 0,
"byteOffset" : 0,
"byteLength" : 640,
"byteStride" : 16,
"target" : 34962
} ],
"meshes" : [ {
"primitives" : [ {
"extensions" : {
"KHR_gaussian_splatting" : {
"kernel" : "ellipse",
"colorSpace" : "BT.709-sRGB",
"sortingMethod" : "cameraDistance",
"projection" : "perspective"
}
},
"attributes" : {
"POSITION" : 0,
"KHR_gaussian_splatting:SCALE" : 1,
"KHR_gaussian_splatting:ROTATION" : 2,
"KHR_gaussian_splatting:OPACITY" : 3,
"KHR_gaussian_splatting:SH_DEGREE_0_COEF_0" : 4
},
"mode" : 0
} ]
} ],
"nodes" : [ {
"mesh" : 0
} ],
"scene" : 0,
"scenes" : [ {
"nodes" : [ 0 ]
} ]
}
```
It is currently generating multiple **errors** of the form
```
{
"code": "MESH_PRIMITIVE_INVALID_ATTRIBUTE",
"message": "Invalid attribute name.",
"severity": 0,
"pointer": "/meshes/0/primitives/0/attributes/KHR_gaussian_splatting:SCALE"
},
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in lib/src/base/mesh.dart at the attribute-name check linked in the issue, then reproduce the embedded KHR_gaussian_splatting asset shown here. Verify that extension-prefixed attributes are accepted without producing MESH_PRIMITIVE_INVALID_ATTRIBUTE errors, while existing attribute validation remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- testing-qa, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100