CesiumGS / 3d-tiles-validator

Validator for 3D Tiles :vertical_traffic_light:
https://cesium.com
Apache License 2.0
427 stars 156 forks source link

glTF extension support? #292

Closed bertt closed 10 months ago

bertt commented 11 months ago

Hi,

I'm trying to validate a glTF with EXT_structural_metadata/EXT_mesh_gpu_instancing/EXT_instance_features but the validation tool says those extensions are not supported.

$ git clone https://github.com/CesiumGS/3d-tiles-validator
$ cd 3d-tiles-validator
$ npm run build
$ npx ts-node src/main.ts --tileContentFile specs/data/gltfExtensions/instanceFeatures/ValidInstanceFeatures.gltf

Result:

 "issues": [
    {
      "type": "CONTENT_VALIDATION_INFO",
      "path": "ValidInstanceFeatures.gltf",
      "message": "Content ValidInstanceFeatures.gltf caused validation infos",
      "severity": "INFO",
      "causes": [
        {
          "type": "CONTENT_VALIDATION_INFO",
          "path": "/extensionsUsed/0",
          "message": "Cannot validate an extension as it is not supported by the validator: 'EXT_structural_metadata'.",
          "severity": "INFO"
        },
        {
          "type": "CONTENT_VALIDATION_INFO",
          "path": "/extensionsUsed/1",
          "message": "Cannot validate an extension as it is not supported by the validator: 'EXT_mesh_gpu_instancing'.",
          "severity": "INFO"
        },
        {
          "type": "CONTENT_VALIDATION_INFO",
          "path": "/extensionsUsed/2",
          "message": "Cannot validate an extension as it is not supported by the validator: 'EXT_instance_features'.",
          "severity": "INFO"
        },

How can I validate glTF with those extensions?

javagl commented 10 months ago

These messages are part of the output of the glTF-Validator.

Internally, the glTF-Validator is called on each tile content. The messages that are generated by the glTF-Validator are (translated into the structure for the 3d-tiles-validator and) listed as possible 'causes' of a single validation issue for the content.

So these are really just INFO messages from the glTF-Validator. If there was any issue with the extensions themself, they should be caught by the actual validation functionality of the 3d-tiles-validator, and listed as ERROR or WARNING explicitly.

We could/should, however, consider to filter out the messages that you showed. Although the extensions are not (yet?) supported by the glTF-Validator, every aspect of their validity should be covered by the validation that is done by the 3d-tiles-validator.

(Eventually, we might add support for these extensions in the glTF-Validator, but there is no timeline for that yet)

bertt commented 10 months ago

ah ok I thought/hoped validation of the extensions was added to the 3d-tiles-validator, but apparently not yet

javagl commented 10 months ago

The validation has been added.

When one of the GLB files uses the extension, then it will be sent to the glTF-Validator for the "baseline" validation. This will cause the "info" messages that say that the extensions are not supported by the glTF-Validator (!).

If the baseline glTF validation passes without errors, then the 3d-tiles-validator will perform the validation of the glTF extensions. Spec/Unit-test level examples for glTF assets with these extensions are in https://github.com/CesiumGS/3d-tiles-validator/tree/main/specs/data/gltfExtensions

If you encounter a glTF with one of these extensions that passes validation, but of which you think that it should not be considered valid, then feel free to open an issue (or add a comment here). There may always be cases that are not properly validated, despite our best efforts.

javagl commented 10 months ago

I assume that this can be closed. Specific questions can be (and are) tracked more easily in dedicated issues.