Closed SunnyBily closed 2 years ago
This issue is migrated to community forum: https://community.cesium.com/t/how-to-load-a-model-with-both-khr-draco-mesh-compression-and-cesium-primitive-outline-extensions/19918
@SunnyBily looks like this is a bug in CesiumJS. I opened a PR to fix it: https://github.com/CesiumGS/cesium/pull/10686
@lilleyse , I modified my local code according to your submission, and the problem was solved, Thanks a lot!
@SunnyBily great to hear!
I'll just keep this open until the PR is merged.
@SunnyBily I merged the PR to fix the outline loading crash. That said, I noticed that the glTF file (inside the .i3dm
inside the tileset) seems to be missing some details which makes it not render correctly, even with the fix. The accessors do not reference any buffer views, so most of the data in the model is ignored (including the outline indices)
"accessors": [
// ...
{
"componentType": 5126,
"count": 78,
"type": "VEC2"
// Missing bufferView, and possibly byteOffset.
// Without a bufferView, the accessor values will default to all 0s!
},
// ...
This is because of the following line from the glTF spec
When
accessor.bufferView
is undefined, the sparse accessor is initialized as an array of zeros
Some relevant parts of the glTF specification:
It's ok that the draco compressed attributes are missing buffer views since the data comes from the draco blob.
The problem might be that CESIUM_primitive_outline
references the same accessor as indices
which doesn't have a buffer view.
Hi,
I'm trying to use Cesium to load a 3dTiles model with outlines, and the geometry of this model is compressed by draco.
I stored the compressed geometry as a bufferView, and the outlines data as a separate bufferView (outline indices are not compressed). The primitives extension part in the mesh includes both two fields: KHR_draco_mesh_compression and CESIUM_primitive_outline, like this:
The model generated by the above method does not load properly in Cesium.
Here is the 3dTiles model generate by my method. 3dTiles_draco_outlines.zip
The Cesium version is 1.96
What I want to know is how to properly generate the draco-compressed model with outlines?
Thanks.