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

Parameter callbackFrequency seems to have no effect #68

Open
lmorvan opened this issue Aug 18, 2021 · 2 comments
Open

Parameter callbackFrequency seems to have no effect #68

lmorvan opened this issue Aug 18, 2021 · 2 comments
Assignees
Labels

Comments

@lmorvan
Copy link

lmorvan commented Aug 18, 2021

When calling UVAtlasCreate with a callback for a given mesh, the number of times the callback is called is always the same no matter callbackFrequency was given: about once per 1 ms.

Would it be a bug or something that I missed?

@walbourn walbourn added the bug label Aug 18, 2021
@walbourn
Copy link
Member

The callbackFrequency implementation is a little odd in this codebase. It's implemented as a 0-1 scalar instead of as a time-based value:

// Call callback function per m_dwCallbackDelta steps
m_dwCallbackDelta = static_cast<size_t>(
            m_fCallbackFrequency * float(dwTaskWork) / fPercentOfAllTasks);
static const float UVATLAS_DEFAULT_CALLBACK_FREQUENCY = 0.0001f;

What values have you tried?

@walbourn walbourn added question and removed bug labels Aug 18, 2021
@walbourn walbourn self-assigned this Aug 18, 2021
@lmorvan
Copy link
Author

lmorvan commented Aug 19, 2021

I tried 0, 1, 0.5, 0.01.
I also tried 25 but there is a check that returns a failure (something like bad argument) if this value is not between 0 and 1.

Reading the code, I understood that it is supposed to ensure that the callback is called each time callFrequency "percent" is added to the overall process "percentage". Which seems not to be the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants