Skip to content

Fix glTF test data flagged by the generated glTF types - #14149

Open
jjhembd wants to merge 2 commits into
gltf-schema-typesfrom
gltf-schema-fixes
Open

jjhembd wants to merge 2 commits into
gltf-schema-typesfrom
gltf-schema-fixes

Conversation

@jjhembd

@jjhembd jjhembd commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Description

The glTF types generated in the previous PR found test data that doesn't follow the glTF schemas. This PR fixes it.

Code changes

Missing EXT_structural_metadata schema ids

The EXT_structural_metadata schema requires an id on each metadata schema, and 21 .gltf files in Specs/Data and Apps/SampleData had schemas without one. Each now has an id, such as WeatherSchemaId, or voxel for the voxel tilesets.

glTF 1.0 fixture with extensionsRequired

The GltfJsonLoaderSpec test "load throws if an unsupported extension is required" put extensionsRequired on a glTF 1.0 fixture, but glTF 1.0 has no extensionsRequired. The test now uses the glTF 2.0 fixture.

Issue number and link

Part of #13949.

Testing plan

  • npm run test -- --includeName Scene/GltfJsonLoader should pass.
  • npm run test -- --includeName Scene/Model should pass.
  • The 3d-models Sandcastle (BoxInstanced) and the voxels-in-3d-tiles Sandcastle should render as on main.

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

AI acknowledgment

  • I used AI to generate content in this PR
  • If yes, I have reviewed the AI-generated content before submitting

If yes, I used the following Tools(s) and/or Service(s): GitHub Copilot

If yes, I used the following Model(s): Claude Opus 5.5

@jjhembd
jjhembd added this pull request to stack #14151 December 4, 2026 14:59
@jjhembd
jjhembd requested a balanced review from Copilot December 4, 2026 15:00
@jjhembd
jjhembd marked this pull request as ready for review December 4, 2026 15:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the glTF fixture and sample-data corrections.

No open issues 🎉

What changed in this PR

Corrects glTF fixtures and sample data to address schema violations exposed by generated types, supporting #13949 without changing runtime code.

Changes:

  • Adds required EXT_structural_metadata schema IDs to 21 glTF files.
  • Uses a glTF 2.0 fixture for the unsupported-required-extension test.
File Description
Specs/​Data/​Models/​glTF-2.0/​Weather/​glTF/​weather.gltf Adds weather schema ID.
Specs/​Data/​Models/​glTF-2.0/​SimplePropertyTexture/​glTF/​SimplePropertyTexture.gltf Adds property texture schema ID.
Specs/​Data/​Models/​glTF-2.0/​PropertyTextureWithVectorProperties/​glTF/​PropertyTextureWithVectorProperties.gltf Adds vector properties schema ID.
Specs/​Data/​Models/​glTF-2.0/​PointCloudWithPropertyAttributes/​glTF/​PointCloudWithPropertyAttributes.gltf Adds point cloud schema ID.
Specs/​Data/​Models/​glTF-2.0/​Microcosm/​glTF/​microcosm.gltf Adds microcosm schema ID.
Specs/​Data/​Models/​glTF-2.0/​BuildingsMetadata/​glTF/​buildings-metadata.gltf Adds buildings schema ID.
Specs/​Data/​Models/​glTF-2.0/​BoxTexturedWithPropertyAttributes/​glTF/​BoxTexturedWithPropertyAttributes.gltf Adds textured box schema ID.
Specs/​Data/​Models/​glTF-2.0/​BoxInstancedInterleaved/​glTF/​box-instanced-interleaved.gltf Adds interleaved instances schema ID.
Specs/​Data/​Models/​glTF-2.0/​BoxInstanced/​glTF/​box-instanced.gltf Adds instanced box schema ID.
packages/​engine/​Specs/​Scene/​GltfJsonLoaderSpec.js Switches extension test to glTF 2.0.
Apps/​SampleData/​models/​BoxInstanced/​BoxInstanced.gltf Adds sample model schema ID.
Apps/​SampleData/​Cesium3DTiles/​Voxel/​VoxelEllipsoid3DTiles/​tiles/​0/​0/​0/​0.gltf Adds voxel schema ID.
Apps/​SampleData/​Cesium3DTiles/​Voxel/​VoxelCylinder3DTiles/​tiles/​1/​1/​1/​1.gltf Adds voxel schema ID.
Apps/​SampleData/​Cesium3DTiles/​Voxel/​VoxelCylinder3DTiles/​tiles/​1/​1/​1/​0.gltf Adds voxel schema ID.
Apps/​SampleData/​Cesium3DTiles/​Voxel/​VoxelCylinder3DTiles/​tiles/​1/​1/​0/​1.gltf Adds voxel schema ID.
Apps/​SampleData/​Cesium3DTiles/​Voxel/​VoxelCylinder3DTiles/​tiles/​1/​1/​0/​0.gltf Adds voxel schema ID.
Apps/​SampleData/​Cesium3DTiles/​Voxel/​VoxelCylinder3DTiles/​tiles/​1/​0/​1/​1.gltf Adds voxel schema ID.
Apps/​SampleData/​Cesium3DTiles/​Voxel/​VoxelCylinder3DTiles/​tiles/​1/​0/​1/​0.gltf Adds voxel schema ID.
Apps/​SampleData/​Cesium3DTiles/​Voxel/​VoxelCylinder3DTiles/​tiles/​1/​0/​0/​1.gltf Adds voxel schema ID.
Apps/​SampleData/​Cesium3DTiles/​Voxel/​VoxelCylinder3DTiles/​tiles/​1/​0/​0/​0.gltf Adds voxel schema ID.
Apps/​SampleData/​Cesium3DTiles/​Voxel/​VoxelCylinder3DTiles/​tiles/​0/​0/​0/​0.gltf Adds voxel schema ID.
Apps/​SampleData/​Cesium3DTiles/​Voxel/​VoxelBox3DTiles/​tiles/​0/​0/​0/​0.gltf Adds voxel schema ID.

Review effort: Balanced

@jjhembd
jjhembd requested a review from javagl December 4, 2026 15:29
@jjhembd
jjhembd force-pushed the gltf-schema-fixes branch 3 times, most recently from 24dbf01 to 6bc8066 Compare December 4, 2026 18:44

@javagl javagl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this looks like a straightforward change.


I actually wanted to try it out, and run the validator before and after this change. But... for the Voxel tilesets, the validator does not even come to the point where it would detect that missing id. It bails out before doing the (custom) metadata validation, because the glTF itself contains these errors:

            {
              "type": "CONTENT_VALIDATION_ERROR",
              "path": "/meshes/0/primitives/0/mode",
              "message": "Value 2147483647 is out of range.",
              "severity": "ERROR"
            },
            {
              "type": "CONTENT_VALIDATION_ERROR",
              "path": "/accessors/0/min/3",
              "message": "Declared minimum value for this component (0) does not match actual minimum (1).",
              "severity": "ERROR"
            }

For context: The approach for the glTF validation in the 3d-tiles-validator is that it performs the standard glTF validation first, and only when the glTF does not contain errors, it performs our custom glTF validation, e.g. for the metadata extensions (there is no point in validating a glTF where the glTF Validator already found an 'ERROR', because that thing might then not be a real glTF to begin with)

However, this process has to be made aware of the EXT_primitive_voxels extension, to ignore the error about the mesh primitive mode. I just took a quick note about this at CesiumGS/3d-tiles-validator#348 (comment)

That message about

Declared minimum value for this component (0) does not match actual minimum (1).

looks legitimate, though. I haven't checked the details, but it might be that this file is indeed invalid in that regard.


However, I at least tried the 3d-tiles-validator on one of the other files, namely, the box-instanced.gltf, and confirmed that the change here causes the

   {
      "type": "PROPERTY_MISSING",
      "path": "box-instanced.gltf/schema/id",
      "message": "The 'id' property is required",
      "severity": "ERROR"
    }

to disappear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants