【问题标题】:Misaligned UV coordinates after Draco compressionDraco 压缩后未对齐的 UV 坐标
【发布时间】:2020-09-23 23:09:44
【问题描述】:

使用 Blender 的内置 Draco 压缩导出到 glTF 后,所有扩展属性在资产中的第一个基元之后未对齐。

示例:第一个很好,但接下来的两个错位导致错误。

            "extensions" : {
                "KHR_draco_mesh_compression" : {
                    "bufferView" : 0,
                    "attributes" : {
                        "POSITION" : 0,
                        "NORMAL" : 1,
                        "TEXCOORD_0" : 2,
                        "TEXCOORD_1" : 3
                    }
                }
            },
            "indices" : 4,
            "material" : 0,
            "mode" : 4
        },
        {
            "attributes" : {
                "POSITION" : 5,
                "NORMAL" : 6,
                "TEXCOORD_0" : 7,
                "TEXCOORD_1" : 8
            },
            "extensions" : {
                "KHR_draco_mesh_compression" : {
                    "bufferView" : 4,
                    "attributes" : {
                        "POSITION" : 0,
                        "NORMAL" : 1,
                        "TEXCOORD_0" : 7,
                        "TEXCOORD_1" : 8
                    }
                }
            },
            "indices" : 9,
            "material" : 1,
            "mode" : 4
        },
        {
            "attributes" : {
                "POSITION" : 10,
                "NORMAL" : 11,
                "TEXCOORD_0" : 12,
                "TEXCOORD_1" : 13
            },
            "extensions" : {
                "KHR_draco_mesh_compression" : {
                    "bufferView" : 5,
                    "attributes" : {
                        "POSITION" : 0,
                        "NORMAL" : 1,
                        "TEXCOORD_0" : 12,
                        "TEXCOORD_1" : 13
                    }
                }
            },

我了解到,一种解决方案可能是更改第二个和更多原语的extensions 内的属性,以便它们遵循递增顺序。但是,在处理大量对象时,此手动过程可能会导致一些问题,因为它需要大量手动工作,这可能会导致结果中出现错误和错误。

我的问题是DracoThree.js 的最新版本是否修复了这些错误? 我们的应用目前在three.js r107上运行。

【问题讨论】:

    标签: three.js blender gltf


    【解决方案1】:

    解决方案第 1 部分:是的,您应该手动更新 extensions._compression.attributes,以便它们遵循数字顺序,至少 until this bug report is fixed

    但是,我几乎可以肯定,您仍然遇到此问题的原因是您使用的是 Three.js r107。我这样说是因为 GLTF 支持 KHR_Mesh_Quantization was added on r111,这是 Blender 的 DRACO 压缩使用的。此外,在 r107 和 r117 之间,DRACO 和 GLTF 都有实质性改进。你可以see this in the changelog

    更新到最新版本时,别忘了更新dracoLoader.setDecoderPath()as outlined in the docs的文件。

    【讨论】:

      猜你喜欢
      • 2015-06-14
      • 2019-11-25
      • 1970-01-01
      • 2018-06-23
      • 2019-09-07
      • 2017-05-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多