Open gkjohnson opened 2 years ago
/cc @robertlong – Hi! Hope it's OK to ask a couple questions here. I'm wondering about using xatlas-web for this. I think we'd ideally need two workflows supported:
(A) 1 mesh - unwrap and pack
position
and normal
attributesxref
vertex IDs to rewrite the original mesh since some vertices have been duplicated. Original mesh may have arbitrary other attributes not used in the atlasing process.(B) N meshes - repack only
position
, normal
, and uv
attributesxref
vertex IDs to rewrite all original meshes, as aboveAt a glance I'm having trouble seeing if these workflows are supported by xatlas itself, the xatlas-web bindings, or neither... is that something you happen to know?
Related: https://github.com/donmccurdy/glTF-Transform/issues/534
A nice workflow would also be (kind of an extension of B):
This is generally what game engines (Unity/Unreal at least) do for lightmaps.
@donmccurdy Looks like there's a new xatlas wrapper being developed -- maybe it alleviates some of your concerns?
Related to #32. Something like the following:
Untested UV unwrapping logic using xatlas is here:
https://github.com/gkjohnson/three-gpu-pathtracer/blob/main/src/utils/UVUnwrapper.js
Originally from this Mozilla Spoke commit:
https://github.com/mozilla/Spoke/commit/9701d647020e09d584885bd457eb225e9995c12f
TODO