Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
98382da
Vector Tiles: Update to 3DTILES_content_gltf_vector
donmccurdy May 5, 2026
d3de98f
Vector Tiles: Add 3DTILES_content_gltf_vector samples
donmccurdy May 6, 2026
e3ce80b
Tidy up
donmccurdy May 6, 2026
6a8ac4e
Merge branch 'main' into donmccurdy/feat/3DTILES_content_gltf_vector
donmccurdy May 8, 2026
e923216
Vector Tiles: Clean up
donmccurdy May 8, 2026
348a149
Merge branch 'main' into donmccurdy/feat/3DTILES_content_gltf_vector
donmccurdy May 11, 2026
223a982
Vector Tiles: Fix EXT_mesh_polygon Feature ID lookup bug
donmccurdy May 11, 2026
f0d8968
Vector Tiles: Support tilesets without EXT_structural_metadata
donmccurdy May 11, 2026
17964e6
Vector Tiles: Support tileset.featureIdLabel
donmccurdy May 11, 2026
b20284f
Vector Tiles: Revert dev changes in sandcastle
donmccurdy May 11, 2026
12c66a2
Vector Tiles: Update for latest EXT_mesh_polygon changes
donmccurdy May 15, 2026
846ad11
Vector Tiles: Update polygon sample data
donmccurdy May 15, 2026
a3d64a8
Merge branch 'main' into donmccurdy/feat/3DTILES_content_gltf_vector
donmccurdy May 15, 2026
0245e5c
Merge branch 'main' into donmccurdy/feat/3DTILES_content_gltf_vector
donmccurdy May 15, 2026
06cf39f
BufferPrimitiveCollection: Tidy up stats
donmccurdy May 15, 2026
c5ad973
Vector Tiles: Cleanup
donmccurdy May 15, 2026
22a93fc
Vector Tiles: Fix failing tests, fix stats
donmccurdy May 15, 2026
3c5cffa
Merge branch 'main' into donmccurdy/feat/3DTILES_content_gltf_vector
donmccurdy May 18, 2026
7ca1c5c
Vector Tiles: Unit tests on EXT_mesh_polygon
donmccurdy May 18, 2026
7b2a6b6
Vector Tiles: Update changelog
donmccurdy May 18, 2026
ca811b6
Vector Tiles: Fix JSDoc types
donmccurdy May 18, 2026
2bbfe5c
Vector Tiles: Correctly handle restart indices on array copies
donmccurdy May 20, 2026
298638f
Vector Tiles: Support either TRIANGLES or LINE_LOOP as polygon primit…
donmccurdy May 26, 2026
9a7e0ed
Vector Tiles: Typo fixes in polygon parsing.
donmccurdy May 26, 2026
c834b57
Vector Tiles: Remove unused fallback for missing triangles
donmccurdy May 26, 2026
cd6cf24
Vector Tiles: Fix unit tests
donmccurdy May 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
20 changes: 20 additions & 0 deletions Apps/SampleData/vector/sample-cities-spain-v02.tileset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"asset": { "version": "1.1" },
"extensionsUsed": [ "3DTILES_content_gltf", "3DTILES_content_gltf_vector" ],
"extensions": {
"3DTILES_content_gltf": {
"extensionsUsed": [ "EXT_mesh_features" ],
"extensionsRequired": [ ]
}
},
"geometricError": 2000000.0,
"root": {
"boundingVolume": { "region": [ -0.14912553056282754, 0.630603674286057, 0.038089971913258434, 0.7585433514898835, -1000, 1000 ] },
"geometricError": 0.0,
"refine": "REPLACE",
"content": {
"uri": "sample-cities-spain-v02.glb",
"extensions": { "3DTILES_content_gltf_vector": { "vector": true } }
}
}
}
Binary file added Apps/SampleData/vector/sample-us-outline-v02.glb
Binary file not shown.
20 changes: 20 additions & 0 deletions Apps/SampleData/vector/sample-us-outline-v02.tileset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"asset": { "version": "1.1" },
"extensionsUsed": [ "3DTILES_content_gltf", "3DTILES_content_gltf_vector" ],
"extensions": {
"3DTILES_content_gltf": {
"extensionsUsed": [ "EXT_mesh_features", "KHR_mesh_primitive_restart" ],
"extensionsRequired": [ "KHR_mesh_primitive_restart" ]
}
},
"geometricError": 2000000.0,
"root": {
"boundingVolume": { "region": [ -3.1267109291897386, 0.31214887295348465, 3.13772622569785, 1.2453371191800977, -1000, 1000 ] },
"geometricError": 0.0,
"refine": "REPLACE",
"content": {
"uri": "sample-us-outline-v02.glb",
"extensions": { "3DTILES_content_gltf_vector": { "vector": true } }
}
}
}
Binary file added Apps/SampleData/vector/sample-us-states-v02.glb
Binary file not shown.
20 changes: 20 additions & 0 deletions Apps/SampleData/vector/sample-us-states-v02.tileset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"asset": { "version": "1.1" },
"extensionsUsed": [ "3DTILES_content_gltf", "3DTILES_content_gltf_vector" ],
"extensions": {
"3DTILES_content_gltf": {
"extensionsUsed": [ "EXT_mesh_features", "EXT_mesh_polygon" ],
"extensionsRequired": [ ]
}
},
"geometricError": 2000000.0,
"root": {
"boundingVolume": { "region": [ -3.1267109291897386, 0.31214887295348465, 3.13772622569785, 1.2453371191800977, -1000, 1000 ] },
"geometricError": 0.0,
"refine": "REPLACE",
"content": {
"uri": "sample-us-states-v02.glb",
"extensions": { "3DTILES_content_gltf_vector": { "vector": true } }
}
}
}
12 changes: 10 additions & 2 deletions packages/engine/Source/Scene/Cesium3DTileContentFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ const Cesium3DTileContentFactory = {
return GaussianSplat3DTileContent.fromGltf(tileset, tile, resource, glb);
}

if (tileset.isGltfExtensionUsed("CESIUM_mesh_vector")) {
// @deprecated CESIUM_mesh_vector to be removed after v1.142 release.
if (
tileset.hasExtension("3DTILES_content_gltf_vector") ||
tileset.isGltfExtensionUsed("CESIUM_mesh_vector")
) {
return VectorGltf3DTileContent.fromGltf(tileset, tile, resource, glb);
}

Expand All @@ -114,7 +118,11 @@ const Cesium3DTileContentFactory = {
return GaussianSplat3DTileContent.fromGltf(tileset, tile, resource, json);
}

if (tileset.isGltfExtensionUsed("CESIUM_mesh_vector")) {
// @deprecated CESIUM_mesh_vector to be removed after v1.142 release.
if (
tileset.hasExtension("3DTILES_content_gltf_vector") ||
tileset.isGltfExtensionUsed("CESIUM_mesh_vector")
) {
return VectorGltf3DTileContent.fromGltf(tileset, tile, resource, json);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/engine/Source/Scene/Cesium3DTileset.js
Original file line number Diff line number Diff line change
Expand Up @@ -3686,11 +3686,11 @@ Cesium3DTileset.supportedExtensions = {
"3DTILES_metadata": true,
"3DTILES_implicit_tiling": true,
"3DTILES_content_gltf": true,
"3DTILES_content_gltf_vector": true,
"3DTILES_multiple_contents": true,
"3DTILES_bounding_volume_S2": true,
"3DTILES_batch_table_hierarchy": true,
"3DTILES_draco_point_compression": true,
CESIUM_mesh_vector: true,
MAXAR_content_geojson: true,
};

Expand Down
73 changes: 73 additions & 0 deletions packages/engine/Source/Scene/GltfLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const {
LineStyle,
Material,
Vector,
Polygon,
} = ModelComponents;

/**
Expand Down Expand Up @@ -899,6 +900,38 @@ function loadAccessor(loader, accessor, useQuaternion) {
return loadDefaultAccessorValues(accessor, values);
}

function loadAccessorTypedArray(loader, accessor) {
const values = ComponentDatatype.createTypedArray(
accessor.componentType,
accessor.count * AttributeType.getNumberOfComponents(accessor.type),
);
Comment thread
donmccurdy marked this conversation as resolved.

if (!defined(accessor.bufferView)) {
return values;
}

const bufferViewLoader = getBufferViewLoader(loader, accessor.bufferView);

// Save a link to the gltfJson, which is removed after bufferViewLoader.load()
const { gltfJson } = loader;

const promise = bufferViewLoader.load().then(() => {
if (loader.isDestroyed()) {
return;
}
const result = getPackedTypedArray(
gltfJson,
accessor,
bufferViewLoader.typedArray,
);
values.set(result);
});

loader._loaderPromises.push(promise);

return values;
}

function fromArray(MathType, values) {
if (!defined(values)) {
return undefined;
Expand Down Expand Up @@ -2208,6 +2241,13 @@ function loadPrimitive(loader, gltfPrimitive, hasInstances, frameState) {
}

const extensions = gltfPrimitive.extensions ?? Frozen.EMPTY_OBJECT;

const polygonExtension = extensions.EXT_mesh_polygon;
if (defined(polygonExtension)) {
primitive.polygon = loadMeshPolygonExtension(loader, polygonExtension);
}

// @deprecated CESIUM_mesh_vector to be removed after v1.142 release.
const meshVectorExtension = extensions.CESIUM_mesh_vector;
if (defined(meshVectorExtension)) {
primitive.vector = loadMeshVectorExtension(loader, meshVectorExtension);
Expand Down Expand Up @@ -2365,12 +2405,45 @@ function loadPrimitiveOutline(loader, outlineExtension) {
return loadAccessor(loader, accessor, useQuaternion);
}

/**
* Load EXT_mesh_polygon.
* @param {GltfLoader} loader
* @param {*} polygonExtension
* @returns {ModelComponents.Polygon}
* @ignore
*/
function loadMeshPolygonExtension(loader, polygonExtension) {
const result = new Polygon();
const accessors = loader.gltfJson.accessors;

result.count = polygonExtension.count;

result.indicesOffsets = loadAccessorTypedArray(
loader,
accessors[polygonExtension.indicesOffsets],
);

if (defined(polygonExtension.triangleIndices)) {
result.triangleIndices = loadAccessorTypedArray(
loader,
accessors[polygonExtension.triangleIndices],
);
result.triangleIndicesOffsets = loadAccessorTypedArray(
loader,
accessors[polygonExtension.triangleIndicesOffsets],
);
}

return result;
}

/**
* Load CESIUM_mesh_vector.
* @param {GltfLoader} loader
* @param {*} meshVectorExtension
* @returns {ModelComponents.Vector}
* @ignore
* @deprecated
*/
function loadMeshVectorExtension(loader, meshVectorExtension) {
if (!defined(meshVectorExtension)) {
Expand Down
2 changes: 2 additions & 0 deletions packages/engine/Source/Scene/Model/ModelUtility.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ ModelUtility.supportedExtensions = {
EXT_instance_features: true,
EXT_mesh_features: true,
EXT_mesh_gpu_instancing: true,
EXT_mesh_polygon: true,
EXT_mesh_primitive_edge_visibility: true,
EXT_meshopt_compression: true,
EXT_primitive_voxels: true,
Expand All @@ -368,6 +369,7 @@ ModelUtility.supportedExtensions = {
KHR_materials_clearcoat: true,
KHR_materials_unlit: true,
KHR_mesh_quantization: true,
KHR_mesh_primitive_restart: true,
KHR_techniques_webgl: true,
KHR_texture_basisu: true,
KHR_texture_transform: true,
Expand Down
Loading