CesiumGS / cdb-to-3dtiles

Convert CDB to 3D Tiles
Apache License 2.0
76 stars 28 forks source link

Fixed glb padding issue #62

Closed nithinp7 closed 2 years ago

nithinp7 commented 2 years ago

When adding padding to a glb to align to 8-byte boundaries, I don't think the glb's length and the json chunk's length were being properly updated. The new uint32_t byte lengths after padding were being static_cast to a char and put in the left-most byte of the byte length slots within the glb buffer.

sanjeetsuhag commented 2 years ago

Thanks for the PR @nithinp7. This is an important fix.

The associated spec for this should be updated too, since it clearly did not do enough to cover all cases: https://github.com/CesiumGS/cdb-to-3dtiles/blob/c7b1c67916db02ce493760664a08b8101611ec17/Tests/GltfTest.cpp#L325

lilleyse commented 2 years ago

I ran into the same problem. Even though the unit test could be improved I'm going to merge just so we get this fix in.