In the latest Cesium for Unreal 2.26 in Unreal 5.7.4, 3D Tiles exports with instanced geometry from our tool Remoscape fail to load I3DM files. In the example linked below, the .i3dm files are in a “2” subfolder, externally referring .glb files one step up in the root folder, e.g. “../scotspine1.glb”. The .glb files in turn refer texture image files in the same root folder, e.g. “scotspine_trunk1.jpg”.
This worked fine in previous versions of Cesium for Unreal, but I’m not sure in which version it started to fail. Now I have to copy the textures into the “2” subfolder to make it work. I consider this a regression and a bug, do you agree? I hope it’s an easy fix.
https://remographdownloadstorage.blob.core.windows.net/downloads/Sturefors_3D_Tiles.zip
It sounds like a regression (and at least based on the verbal description, it sounds like a file layout that should be valid). For those who are about to investigate this, it might be helpful to know any version where it still worked (just to narrow down the search space a bit).
I’m searching around for older installations of Unreal to try to see where it actually worked. No luck so far though. But I just saw the same problem in Unity 6000.4.9f1 and Cesium for Unity 1.23.2. Not that i3dm instances work correctly in Unity yet (a real pity) but it complained about the same textures until they were copied into the “2” subfolder. So maybe it’s something in the common cesium-native?
Yes, I had skimmed over glTF-related PRs/commits in cesium-native, and found some that sounded like they could have affected the loading behavior (including the one that you now linked to in the issue). But none that had been done recently, so I didn’t investigate the changes in these older ones more closely.
In fact, it’s a bit surprising that this hasn’t been noticed until now, because sharing textures (in subdirectories) between GLBs is not uncommon. But it’s not an uncommon bug, because it can be a bit tricky to always carry through the right “resolution context” (i.e. the directory that URLs should be resolved against), from tileset.json through content.i3dm, down to contentData.glb.
There probably should be a dedicated unit test for stuff like this. I added a test data set that contains similar structures at Failed textures from glb files referred from i3dm files · Issue #1378 · CesiumGS/cesium-native · GitHub