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

simplify: attribute weighted simplification #1335

Open
marwie opened this issue Mar 26, 2024 · 7 comments
Open

simplify: attribute weighted simplification #1335

marwie opened this issue Mar 26, 2024 · 7 comments
Labels
feature New enhancement or request package:functions
Milestone

Comments

@marwie
Copy link
Contributor

marwie commented Mar 26, 2024

Hello, currently simplify doesn't take vertex colors into account. Looks like meshoptimizer added this feature recently. Is this already exposed/available in gltf-transform?

zeux/meshoptimizer#652 (comment)

@marwie marwie added the feature New enhancement or request label Mar 26, 2024
@donmccurdy
Copy link
Owner

Not yet exposed – see #1153. It's marked as an 'experimental' feature, so we would need to do something like that here, as I assume the meshoptimizer API could change at any time. In the meantime, vertex colors only factor in to the extent that they limit welding vertices before simplification.

@donmccurdy donmccurdy added this to the v4.0 milestone Mar 26, 2024
@marwie
Copy link
Contributor Author

marwie commented Mar 26, 2024

Ok - thanks for the link!

@marwie
Copy link
Contributor Author

marwie commented Mar 26, 2024

Here's also another very very simple model where this would help (it would probably not remove any vertices in this simple case)

BenchSmall.zip

image

@kzhsw
Copy link
Contributor

kzhsw commented Mar 28, 2024

Also have a look at #992

@donmccurdy
Copy link
Owner

It looks like there are breaking changes planned for the simplifyWithAttributes API, which is still experimental:

zeux/meshoptimizer#601

I think the rest of this task – supporting simplifyWithAttributes — will need to wait for a 4.1+ release.

@jo-chemla
Copy link
Contributor

In case it is useful to the discussion, a recent meshoptimizer PR exposed target_error to gltf_pack zeux/meshoptimizer#494

This change exposes simplification error via command line argument -se, which can be valuable to control simplification more precisely and may also be used to slightly increase the defaults when -sv is used.
Also this change completes zeux/meshoptimizer#688 by incorporating both normals and colors when -sv is specified, which improves quality on models with vertex colors further.

@kzhsw
Copy link
Contributor

kzhsw commented Aug 28, 2024

In case it is useful to the discussion, a recent meshoptimizer PR exposed target_error to gltf_pack zeux/meshoptimizer#494

@jo-chemla glTF-Transform does not directly use the gltfpack tool, it uses the meshoptimizer js api here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New enhancement or request package:functions
Projects
None yet
Development

No branches or pull requests

4 participants