Hi all,
I get the following error when I try to load a GLB file via a 3D Tiles stream:
An error occurred while rendering. Rendering has stopped.
RuntimeError: Fragment shader failed to compile. Compile log: ERROR: 0:56: ‘featureId_0’ : no such field in structure
ERROR: 0:56: ‘czm_round’ : no matching overloaded function found
The GLB file contains textured meshes with EXT_structural_metadata & EXT_mesh_features extensions. As suppose the error is related to metadata (feature_id0 in the message)…
Some additional information:
the GLB is loaded fine in VS Code by Babylon, THree.js and Filament - only Cesium fails (same error than in the browser),
I obtain this GLB trying to optimize another GLB (I regroup all the primitives sharing the same material in a single mesh) - The GLB without this change loads fine.
Does anyone here have an idea about the reported problem ?
Thanks in advance, any hints appreciated.
I obtain this GLB trying to optimize another GLB (I regroup all the primitives sharing the same material in a single mesh) - The GLB without this change loads fine.
This sounds like one of the optimization steps that may be done, for example, with glTF-Transform.
But regardless of the tool or library that is used: You should be aware that nearly any “structural modification” may interfere with the EXT_structural_metadata and EXT_mesh_features extensions: Unless the optimization process knows how to handle these extensions, and how to take them into account during the optimization, the result may become invalid.
(You could run the 3D Tiles Validator on the data, and see whether it shows any errors)
As a complementary information : I have generated the same model without metadata and it loads fine. I’m wondering if maybe metadata support in Cesium if not fully complete, ot at least doesn’t support well metadata in meshes with multiple primitives.
The bad news for me is that regrouping all primitives with the same material in a single mesh doesn’t decrease the number of ‘commands’ in the rendering stage. I am affraid I will have to merge all these primitives in a single one to get any optimization.
There are some aspects of metadata that are not fully supported yet (with some details in this issue, and some related issues).
But the first post contained the statement
The GLB without this change loads fine.
Maybe I misunderstood that, but it sounds like
the (unoptimized) model with metadata works as expected
the optimized model (with metadata) does not work
If this is correct, then something might have gone wrong during the optimization. Otherwise (if the metadata does not work in general), we might need more information (and maybe an example file) to be sure.
Yes, the 3D Tiles Validator internally calls the glTF validator (for the main part of the glTF validation). But it also performs a validation of the Cesium extensions which is not done by the glTF validator itself.