CesiumGS / gltf-pipeline

Content pipeline tools for optimizing glTF assets. :globe_with_meridians:
Apache License 2.0
1.87k stars 241 forks source link

I used draco(-d) compression, why put my custom data to the loss. There are two files in the attachment that have not been compressed. The customized data in 100.glb still exists after compression, but the customized data in 102.glb is lost. #650

Closed sui0312feng closed 7 months ago

sui0312feng commented 7 months ago

testfile.zip

I used draco(-d) compression, why put my custom data to the loss. There are two files in the attachment that have not been compressed. The customized data in 100.glb still exists after compression, but the customized data in 102.glb is lost.

The custom data is placed in the first and second elements of the bufferview array.

1700534748870 1700534929657

lilleyse commented 7 months ago

@sui0312feng there are some validation issues with 102.glb. Is it possible to fix those and then try again? I copied the relevant errors below:

        "messages": [
            {
                "code": "ACCESSOR_TOTAL_OFFSET_ALIGNMENT",
                "message": "Accessor's total byteOffset 127 isn't a multiple of componentType length 4.",
                "severity": 0,
                "pointer": "/accessors/0"
            },
            {
                "code": "ACCESSOR_TOTAL_OFFSET_ALIGNMENT",
                "message": "Accessor's total byteOffset 12451 isn't a multiple of componentType length 4.",
                "severity": 0,
                "pointer": "/accessors/1"
            },
            {
                "code": "ACCESSOR_TOTAL_OFFSET_ALIGNMENT",
                "message": "Accessor's total byteOffset 16559 isn't a multiple of componentType length 4.",
                "severity": 0,
                "pointer": "/accessors/2"
            },
            {
                "code": "ACCESSOR_TOTAL_OFFSET_ALIGNMENT",
                "message": "Accessor's total byteOffset 65519 isn't a multiple of componentType length 4.",
                "severity": 0,
                "pointer": "/accessors/3"
            },
            {
                "code": "ACCESSOR_TOTAL_OFFSET_ALIGNMENT",
                "message": "Accessor's total byteOffset 73583 isn't a multiple of componentType length 4.",
                "severity": 0,
                "pointer": "/accessors/4"
            },
            {
                "code": "ACCESSOR_TOTAL_OFFSET_ALIGNMENT",
                "message": "Accessor's total byteOffset 76271 isn't a multiple of componentType length 4.",
                "severity": 0,
                "pointer": "/accessors/5"
            },
            {
                "code": "BUFFER_VIEW_TARGET_OVERRIDE",
                "message": "Override of previously set bufferView target or usage. Initial: 'IndexBuffer', new: 'VertexBuffer'.",
                "severity": 0,
                "pointer": "/meshes/0/primitives/0/attributes/_FEATURE_ID_0"
            },
            {
                "code": "MESH_PRIMITIVE_ATTRIBUTES_ACCESSOR_UNSIGNED_INT",
                "message": "Mesh attributes cannot use UNSIGNED_INT component type.",
                "severity": 0,
                "pointer": "/meshes/0/primitives/0/attributes/_FEATURE_ID_0"
            },
            {
                "code": "BUFFER_VIEW_TARGET_OVERRIDE",
                "message": "Override of previously set bufferView target or usage. Initial: 'IndexBuffer', new: 'VertexBuffer'.",
                "severity": 0,
                "pointer": "/meshes/0/primitives/1/attributes/_FEATURE_ID_0"
            },
            {
                "code": "MESH_PRIMITIVE_ATTRIBUTES_ACCESSOR_UNSIGNED_INT",
                "message": "Mesh attributes cannot use UNSIGNED_INT component type.",
                "severity": 0,
                "pointer": "/meshes/0/primitives/1/attributes/_FEATURE_ID_0"
            },
sui0312feng commented 7 months ago

Modified the above problem, the compression still lost the custom data No_0.zip

@sui0312feng there are some validation issues with 102.glb. Is it possible to fix those and then try again? I copied the relevant errors below:

        "messages": [
            {
                "code": "ACCESSOR_TOTAL_OFFSET_ALIGNMENT",
                "message": "Accessor's total byteOffset 127 isn't a multiple of componentType length 4.",
                "severity": 0,
                "pointer": "/accessors/0"
            },
            {
                "code": "ACCESSOR_TOTAL_OFFSET_ALIGNMENT",
                "message": "Accessor's total byteOffset 12451 isn't a multiple of componentType length 4.",
                "severity": 0,
                "pointer": "/accessors/1"
            },
            {
                "code": "ACCESSOR_TOTAL_OFFSET_ALIGNMENT",
                "message": "Accessor's total byteOffset 16559 isn't a multiple of componentType length 4.",
                "severity": 0,
                "pointer": "/accessors/2"
            },
            {
                "code": "ACCESSOR_TOTAL_OFFSET_ALIGNMENT",
                "message": "Accessor's total byteOffset 65519 isn't a multiple of componentType length 4.",
                "severity": 0,
                "pointer": "/accessors/3"
            },
            {
                "code": "ACCESSOR_TOTAL_OFFSET_ALIGNMENT",
                "message": "Accessor's total byteOffset 73583 isn't a multiple of componentType length 4.",
                "severity": 0,
                "pointer": "/accessors/4"
            },
            {
                "code": "ACCESSOR_TOTAL_OFFSET_ALIGNMENT",
                "message": "Accessor's total byteOffset 76271 isn't a multiple of componentType length 4.",
                "severity": 0,
                "pointer": "/accessors/5"
            },
            {
                "code": "BUFFER_VIEW_TARGET_OVERRIDE",
                "message": "Override of previously set bufferView target or usage. Initial: 'IndexBuffer', new: 'VertexBuffer'.",
                "severity": 0,
                "pointer": "/meshes/0/primitives/0/attributes/_FEATURE_ID_0"
            },
            {
                "code": "MESH_PRIMITIVE_ATTRIBUTES_ACCESSOR_UNSIGNED_INT",
                "message": "Mesh attributes cannot use UNSIGNED_INT component type.",
                "severity": 0,
                "pointer": "/meshes/0/primitives/0/attributes/_FEATURE_ID_0"
            },
            {
                "code": "BUFFER_VIEW_TARGET_OVERRIDE",
                "message": "Override of previously set bufferView target or usage. Initial: 'IndexBuffer', new: 'VertexBuffer'.",
                "severity": 0,
                "pointer": "/meshes/0/primitives/1/attributes/_FEATURE_ID_0"
            },
            {
                "code": "MESH_PRIMITIVE_ATTRIBUTES_ACCESSOR_UNSIGNED_INT",
                "message": "Mesh attributes cannot use UNSIGNED_INT component type.",
                "severity": 0,
                "pointer": "/meshes/0/primitives/1/attributes/_FEATURE_ID_0"
            },

Modified the above problem, the compression still lost the custom data。 No_0.zip

lilleyse commented 7 months ago

@sui0312feng thanks for sending over the new file.

It still looks like there are problems. No_0.glb is on the left, 100.glb is on the right.

image

sui0312feng commented 7 months ago

@sui0312feng thanks for sending over the new file.

It still looks like there are problems. No_0.glb is on the left, 100.glb is on the right.

  • properties should be an object (I think this is the main problem)
  • _class should be class
  • _name should be name

image

thank you! you are right! issue was settled !