Conversation
| </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
| 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
|
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. |
|
I'm mostly curious about the algorithm. If the output could get better we could easily integrate this in the Three.js Editor instead. |
|
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 |
|
BTW: Before adding a new component, a PR should improve the existing |
|
I'll just add that the implementation in glTF Transform uses meshoptimizer's 15kb WASM geometry simplifier. The older version of meshoptimizer used in glTF Transform preserves UVs but doesn't optimize for them; the newer version preserves UVs and gives UV error weight during simplification. See donmccurdy/glTF-Transform#1714. I'd also done a standalone simplification example using meshoptimizer directly in three.js here: https://discourse.threejs.org/t/mesh-simplification-using-meshoptimizer/63002/4 A nice feature of this approach — specifically for LODs — is that LODs don't need separate vertex attributes, only different indices. Applications could switch between LODs within a geometry using |
|
Closing since the PR in the current state can't be merged.
@donmccurdy I've just tested the approach from your fiddle with our simplifier example and I'm impressed by the result: https://jsfiddle.net/bpyhv6zj/ Couldn't we ditch the existing implementation of |

Description
A LOD generator tool. Upload a mesh and create different LOD meshes with QEM algorithm.
https://raw.githack.com/FlankaLanka/three.js/lod-gen/tools/lod-generator/index.html