cdb-to-3dtiles icon indicating copy to clipboard operation
cdb-to-3dtiles copied to clipboard

EXT_feature_metadata buffers are not 8-byte aligned

Open nithinp7 opened this issue 3 years ago • 6 comments

This pertains specifically to #58

I ran into this issue with a cdb-to-3dtiles-next tileset, it seems like sometimes the metadata buffers aren't 8-byte aligned (as the extension spec prescribes). I briefly looked through the cdb-to-3dtiles code and I didn't catch any 8-byte alignment of the metadata buffers, so that seemed to confirm my understanding.

Again I looked only briefly at the code here; the issue may be a bad implementation on my end or a misunderstanding of the spec even, feel free to close this if that is the case!

@sanjeetsuhag

nithinp7 avatar Dec 02 '21 21:12 nithinp7

Do you know which type of GLBs are affected? Is the GSModels or the GTModels?

sanjeetsuhag avatar Dec 02 '21 21:12 sanjeetsuhag

I've noticed it with Elevation and GSModels glbs. GTModels are not completely supported yet in cesium-native (at least the instanced ones) so those may secretly have the same issue too even though it's hidden for now.

nithinp7 avatar Dec 02 '21 22:12 nithinp7

I'm not sure if it's related, but I'm going to retile with this branch I opened a while ago just to check: https://github.com/CesiumGS/cdb-to-3dtiles/pull/62.

nithinp7 avatar Dec 02 '21 22:12 nithinp7

@nithinp7 Did retiling on that branch help resolve your issue?

sanjeetsuhag avatar Dec 07 '21 19:12 sanjeetsuhag

@sanjeetsuhag I finally got around to retiling again with the branch, the issue seems to still remain. I had to comment out our alignment validation check to get EXT_feature_metadata buffers to work.

nithinp7 avatar Dec 09 '21 06:12 nithinp7

I think the issue is here: https://github.com/CesiumGS/cdb-to-3dtiles/blob/4fbb27dd1a3322b0274e3694658896d80f2de371/CDBTo3DTiles/src/Gltf.cpp#L529

All metadata buffers are just tacked onto the end of the 0th buffer, with no padding.

nithinp7 avatar Dec 13 '21 18:12 nithinp7