Skip to content

Conversation

@FlankaLanka
Copy link

@FlankaLanka FlankaLanka commented Nov 26, 2025

Description

A LOD generator tool. Upload a mesh and create different LOD meshes with QEM algorithm.

Screenshot 2025-11-27 at 04 58 13

https://raw.githack.com/FlankaLanka/three.js/lod-gen/tools/lod-generator/index.html

</div>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>

Check warning

Code scanning / CodeQL

Inclusion of functionality from an untrusted source Medium

Script loaded from content delivery network with no integrity check.
import { FBXLoader } from 'three/addons/loaders/FBXLoader.js';
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';

import { LODGenerator, LODDistanceCalculator } from './LODGenerator.js';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import LODDistanceCalculator.
@mrdoob
Copy link
Owner

mrdoob commented Nov 27, 2025

Screenshot 2025-11-27 at 04 59 53

Is QEM the best algorithm? 🤔

@mrdoob mrdoob added this to the r183 milestone Nov 27, 2025
@gkjohnson
Copy link
Collaborator

I'll just point out that gltf-transform also has a reasonable mesh decimation algorithm (there are a number of easy-to-use tools available for this) so I question whether it's valuable to rewrite it let alone maintain a tool for it in this repo.

@mrdoob
Copy link
Owner

mrdoob commented Nov 27, 2025

I'm mostly curious about the algorithm.

If the output could get better we could easily integrate this in the Three.js Editor instead.

@Mugen87
Copy link
Collaborator

Mugen87 commented Nov 27, 2025

To clarify, QEM is the approach from Garland and Heckbert [1998] and well know for its conceptual issues like it does not properly preserve uv coordinates such that textures are correctly projected on the simplified meshes.

A very promising approach known from #14058 is this one: https://cragl.cs.gmu.edu/seamless/

In the link you find the related paper, the presentation from SIGGRAPH Asia 2017 and also a GitHub repository with a C++ implementation: https://github.com/songrun/SeamAwareDecimater?tab=readme-ov-file#seam-aware-decimater

@Mugen87
Copy link
Collaborator

Mugen87 commented Nov 27, 2025

BTW: Before adding a new component, a PR should probably improve the existing SimplifyModifier.

https://threejs.org/examples/webgl_modifier_simplifier

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants