-
Notifications
You must be signed in to change notification settings - Fork 156
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
glTF extension validation #280
Conversation
The current state should largely cover the validation of It validates the constraints that are established on the JSON level and the specification text. It also performs some validation of "binary" data, insofar that for feature ID attributes and textures, it obtains the set of feature ID values, and checks whether they match the declared Note that the current state does not yet have any specs. I locally have a list of glTF assets, where the names already give a hint about the features that are checked:
(further ones may still be added). The specs for the tileset-level validation currently have the pattern
I'll try to achieve a same pattern for the glTF tests, by essentially wrapping the glTF assets (files) into a tileset object at runtime. (The point is that I don't want to create "dummy" Some rather internal notes/TODOs:
The last one may have to be discussed separately. |
The last commits should largely cover the validation of the I have opened a PR at CesiumGS/3d-tiles-tools#70 that contains minor changes to the There are some TODOs related to that, mainly revolving around one issue that has to be sorted out: Right now, the validation can work on |
The last commits covered most of the The latter is... a bit of a mess right now, and I intend to clean that up. For the property textures and property attributes (and for the binary property tables, FWIW), the validation follows the same pattern:
This is currently implemented as hundreds of structurally similar, complex, repetitive lines in the The difficulties for simplifying that are revolving around...
The latter refers to the fact that, for example, a mismatch of the given
But I'm currently trying to create messages that clearly and specifically say what exactly is wrong. A current example is
The attribute name and mesh/primitive indices have to be carried along, but this "context" is different for each type of metadata source. There are some obvious and simple cleanups for the current state, but I'll look for further possibilities for implementing this "nicely". Another open point is that of the specs. The |
The last commits addressed the issue of the repetitive code for the validation of metadata values against the The summary is:
To keep track of this: Some issue have been discovered in the validator during this PR.
|
The last commit added the validations that are specific to the combination of both extensions,
EDIT: The following originally talked about "matching" values. This is not what the validation should do. Edited to be more precise: There is one (minor) issue to be sorted out: Currently, the validator assumes that the
(to be confirmed) Apart from that, this PR could largely be ready for review, but before it can be merged, it will be necessary to merge the PR for CesiumGS/3d-tiles-tools#70 and publish the new tools version (right now, the |
- removed obsolete TODOs - addressed minor open TODOs - minor TSDoc fixes - minor fixes for typos in validation messages
I did a "proofreading"/cleanup pass
There are some cleanups that I'd still like to do. For example: The current state of the validator code (as a whole) often uses the |
It should be possible to validate the
EXT_mesh_features
andEXT_structural_metadata
extensions.These are glTF extensions, and thus, somewhat unrelated to 3D Tiles. One could make a case for implementing the validation in the glTF-Validator. But after internal considerations, the first implementation will happen in the 3d-tiles-validator.
(Reasons for that are, roughly: The extensions are relatively complex. They are not ratified. The glTF-Validator is using a different language. It is not clear whether the validation can be implemented in the glTF-Validator without considerable refactorings. The 3d-tiles-validator already contains much of the infrastructure for validating 3D Metadata. This particularly refers to the binary representation of metadata - and the 3D Metadata is supposed to be structurally the same (or at least very similar) for 3D Tiles and glTF after all...)
This PR is currently a DRAFT. There are some details to be sorted out, but also some higher-level considerations. The following it therefore only a short summary of things that have to be addressed:
In the current state (a first draft), there is just a
GltfExtensionValidators
class that is called at the end of theGltfValidator
, and calls the actual extension validators (which is only a first draft of anExtMeshFeaturesValidator
right now).The 3D Tiles validator already offers a mechanism for "extension validators". But this only refers to 3D Tiles extensions (for example, for validating the
3DTILES_bounding_volume_S2
extension). It operates on theRootProperty
type. But this only defines theextras/extensions
. This type, however, is structurally equal to thegltfProperty
. So ... some of this infrastructure could actually be used for generalizing the glTF extension validation...3d-tiles-tools
with thestructure
classes.There are no types for the glTF structures (i.e. there is no
Accessor
orMesh
type). So all the validation functions have to operate onany
for now. Some minor tweaks will be necessary in the3d-tiles-tools
. These are tracked in CesiumGS/3d-tiles-tools#70The current state (which is a first DRAFT) contains first test cases for
EXT_mesh_features
validation. Running theGltfExtensionValidators
directly on some of the first spec files generates reports like this;