UVAtlas
UVAtlas copied to clipboard
Parameter `callbackFrequency` seems to have no effect
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?
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?
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.