File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -1521,17 +1521,19 @@ void ExtractInstanceDataFromExtMeshGpuInstancing(
15211521 }
15221522}
15231523
1524+ bool CheckForExtMeshGpuInstancing (
1525+ const CesiumGltf::Model& gltf,
1526+ const CesiumGltf::Node& node) {
1527+ // Check if the EXT_mesh_gpu_instancing extension is present
1528+ return node.getExtension <CesiumGltf::ExtensionExtMeshGpuInstancing>() !=
1529+ nullptr ;
1530+ }
1531+
15241532void ExtractInstanceDataFromGltfModel (
15251533 const CesiumGltf::Model& gltf,
15261534 const glm::dmat4& tileTransform,
15271535 std::vector<InstanceData>& outInstanceData) {
15281536
1529- // check i3dm extras
1530- auto i3dmIt = gltf.extras .find (" i3dm" );
1531- if (i3dmIt == gltf.extras .end ()) {
1532- return ;
1533- }
1534-
15351537 // Extracting EXT_mesh_gpu_instancing data from a model converted by I3dmToGltfConverter
15361538 gltf.forEachPrimitiveInScene (
15371539 -1 ,
@@ -1707,8 +1709,7 @@ void* UnityPrepareRendererResources::prepareInMainThread(
17071709 primitiveGameObject.layer (tilesetLayer);
17081710
17091711 // check i3dm
1710- auto i3dmIt = gltf.extras .find (" i3dm" );
1711- bool isI3dmType = i3dmIt != gltf.extras .end ();
1712+ bool isI3dmType = CheckForExtMeshGpuInstancing (gltf,node);
17121713
17131714 std::vector<InstanceData> instanceData;
17141715 std::vector<UnityEngine::GameObject> intanceObjects;
You can’t perform that action at this time.
0 commit comments