Skip to content

AI: meshoptimizer-backed LOD generation #398

Description

@fernandotonon

Parent epic: #397

Goal

Replace/augment the current Ogre-based LOD chain in qtmesh lod with meshoptimizer's simplify + simplifyAttr for higher-quality LODs that preserve UV seams and bone weights.

Why

The current LOD pipeline relies on Ogre's built-in MeshLodGenerator, which produces visible seam artifacts and ignores skinning attributes. meshoptimizer (MIT, ~200 KB) is the de-facto industry standard (used by glTF tooling, Godot, Unity import). Drop-in CMake dep, no ML, no model files.

Scope

  • Add meshoptimizer as a CMake dependency (FetchContent or vendored).
  • Implement an alternate LOD backend selectable via --algo meshopt|ogre (default: meshopt once validated).
  • Preserve UV seams via simplifyWithAttributes (UV0 + bone weights as attribute streams).
  • Run optimizeVertexCache on each generated LOD.
  • Keep current --auto, --count N, --reductions a,b,c, --info, --remove flags fully working.
  • GUI: surface as a backend dropdown in the LOD section of the inspector.
  • MCP: add algo param to existing LOD tool.

Acceptance Criteria

  • qtmesh lod model.fbx --count 3 --algo meshopt -o out.fbx produces three LODs with preserved UVs.
  • Skinned meshes keep their bone weights through decimation.
  • --info --json reports the algorithm used.
  • Unit test verifies decimated triangle counts and that UV seam vertices are not collapsed.
  • Sentry breadcrumb ai.assist.lod recorded.

Effort

~2–3 days.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-assistLocal-AI-assisted 3D workflows (epic prefix: AI:)cliCommand-line / qtmeshenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions