Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unwrapper.packAtlas(...) goes wrong #1

Open
AD2018 opened this issue Apr 5, 2023 · 3 comments
Open

unwrapper.packAtlas(...) goes wrong #1

AD2018 opened this issue Apr 5, 2023 · 3 comments

Comments

@AD2018
Copy link

AD2018 commented Apr 5, 2023

Here is the code
image

package.json
image

before unwrapping
image

here is the result of the unwrap(unwrapper.packAtlas(...))
image

I pass to unwrapper.packAtlas(...) array with only one geometry:
image

UPD: meanwhile with the model from this github project https://github.com/lucas-jones/three-lightmap-baker all is ok:
image

what is the problem?

@repalash
Copy link
Owner

Hi, can you share the 3d model which has this issue?

@mattni
Copy link

mattni commented Nov 9, 2023

Hi!
Thanks for great library, it works mainly very well! I have similar issue unwrapping issue with some geometries. I don't understand why geometry get broken.

The issue occurs only with rounded geometries (usually small triangles). Do you know what is the problem?

Example of broken model (single geometry) below.

not_working_geometry_glb.zip

unwrapping_issue

@gkjohnson
Copy link
Contributor

gkjohnson commented Sep 29, 2024

It looks like this could be due to the geometry's index array being set to use a Uint32 buffer while XAtlas.js is only designed to support Uint16 index arrays. The model contains more than 80,000 vertices while Uint16 indices only support up to around 65,500 vertices. Looking at the XAtlas code, though, it looks like it would be possible to enable support for either Uint16 or Uint32 indices here.

Or, more simply, the code could be changed to just support Uint32 indices and the buffer could be converted when set, similar to #11.

edit
Not sure if these lines that read the index buffer back as an array of Uint32s rather than Uint16s may have something to do with it, too.

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

No branches or pull requests

4 participants