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

Simplification should recognize and handle UV mirroring seams #718

Open
Makio64 opened this issue Jul 8, 2024 · 2 comments
Open

Simplification should recognize and handle UV mirroring seams #718

Makio64 opened this issue Jul 8, 2024 · 2 comments

Comments

@Makio64
Copy link

Makio64 commented Jul 8, 2024

Rare case but on some models, simplification lead to UV artefacts : UVs are getting fully streched (same value on both vertices) when many other triangles could have been optimized instead, I suggest to give a lower priority to simplify/remove vertices/faces of the mesh leading to these results.

It might also be a bug in the way the uvs get re-assigned.

The model used to illustrate this example :
https://www.dropbox.com/scl/fi/po761ykdiqdmtbzd9fitf/rhino.glb?rlkey=s6jp06vtr4id0opnv76wwys1p&dl=0

Before simplify :
Screenshot 2024-07-08 at 16 25 05

After simplify :
Screenshot 2024-07-08 at 16 14 54

@zeux
Copy link
Owner

zeux commented Jul 8, 2024

Are UVs mirrored here? If so then yeah it’s a known issue atm, and will get addressed eventually.

@zeux
Copy link
Owner

zeux commented Jul 8, 2024

Yeah I looked at the scene closer and it's indeed UV mirroring. This needs special handling in the simplifier, probably as a separate pre-process.

Re-attaching the file so that this isn't lost in the future (I also regenerated the normals here because they were just broken in the input file):
rhino.zip
rhino-tbn.zip

Worth noting is that if the GLB file gets re-exported with tangent data and a normal map (without a normal map gltfpack needs -kv flag), the simplifier will automatically recognize the mirroring seam and simplify correctly (of course, this ideally should work without tangent information present to begin with):
image

@zeux zeux changed the title Check if uv get "extra stretch" before delete point Simplification should recognize and handle UV mirroring seams Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants