donmccurdy / glTF-Transform

glTF 2.0 SDK for JavaScript and TypeScript, on Web and Node.js.
https://gltf-transform.dev
MIT License
1.3k stars 145 forks source link

Faster bitwise-equal weld() implementation #1237

Closed donmccurdy closed 5 months ago

donmccurdy commented 5 months ago

Provides an alternative weld() implementation based on Meshoptimizer's approach. When tolerance=0, we use a hashtable to find bitwise-equal vertices quickly. This is vastly faster than previous approaches, but comes without tolerance options. When tolerance is non-zero, weld() falls back on the older implementation. In v4.0, the new implementation will be the default.

Results

model before after
lovecraftian 1,232ms 149ms
plant_3 2,607ms 431ms
concessionaire 138ms 32ms
weld_problem 115ms 21ms

Context

Tasks

donmccurdy commented 5 months ago

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.