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

Expose target_error to gltfpack #494

Open
FreakTheMighty opened this issue Oct 14, 2022 · 2 comments
Open

Expose target_error to gltfpack #494

FreakTheMighty opened this issue Oct 14, 2022 · 2 comments

Comments

@FreakTheMighty
Copy link

It would be helpful to have target_error exposed to gltfpack. If I understand this correctly, this could provide another tool for aggressively simplifying, while setting a lower floor for quality.

size_t meshopt_simplifySloppy(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* out_result_error)

@zeux
Copy link
Owner

zeux commented Nov 21, 2022

Right now gltfpack sets the error automatically to 0.1f (meaning up to 10% deviation) when using aggressive simplifier. The slight difficulty in exposing a setting for this is that the error thresholds are actually different between normal mode and aggressive mode, so -sa ends up doing two attempts at simplification - once with meshopt_simplify with target error 1%, and once more if necessary with meshopt_simpifySloppy with target error 10%.

Are you looking to increase or reduce the error threshold?

@FreakTheMighty
Copy link
Author

@zeux I think the main use case would be to remove as many triangles away while preserving a specific quality. To produce LODs I might do something like set the triangle target to 0, but vary the maximum error.

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