vpenades / SharpGLTF

glTF reader and writer for .NET Standard
MIT License
454 stars 72 forks source link

add Cesium ext_instance_features #201

Closed bertt closed 7 months ago

bertt commented 7 months ago

Add Cesium extension EXT_instance_features support. Specs: https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_instance_features

This extension must be used with the EXT_mesh_gpu_instancing extension.

Sample node:

 "nodes": [
    {
      "extensions": {
        "EXT_mesh_gpu_instancing": {
          "attributes": {
            "TRANSLATION": 4,
            "_FEATURE_ID_0": 5
          }
        },
        "EXT_instance_features": {
          "featureIds": [
            {
              "attribute": 0,
              "featureCount": 2,
              "label": "Forests",
              "nullFeatureId": 2,
              "propertyTable": 0
            },
            {
              "featureCount": 9,
              "label": "Trees",
              "propertyTable": 1
            }
          ]
        }
      },
      "mesh": 0
    }
  ],
vpenades commented 7 months ago

So far I don't see any problems, other than adjusting the tests to NUnit 4.0