Skip to content

Position quantization precision problem in some cases #1084

Description

@hu-xd

gltfpack version > 0.22 (present in gltfpack 1.2)
when quantizes positions with large coordinates + duplicate geometry,
much precision was lost.

repro.zip

Repro: attached repro.gltf.
check the node scale.

suspected cause:

The geometry_duplicate feature (introduced in 0.22):

  1. dedupMeshes() marks two meshes geometry_duplicate (same geometry hash, different material).
  2. detachMesh() keeps such meshes attached to their node instead of baking the transform to world space:
    if (mesh.nodes.size() == 1 && mesh.geometry_duplicate && !settings.mesh_merge)
        return;
  3. So duplicate meshes stay in local space while unique meshes are baked to world space.
  4. prepareQuantizationPosition() merges all bounds.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions