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

feat: interpolation #214

Merged
merged 3 commits into from
Dec 10, 2023
Merged

feat: interpolation #214

merged 3 commits into from
Dec 10, 2023

Conversation

Lutra-Fs
Copy link
Member

@Lutra-Fs Lutra-Fs commented Dec 1, 2023

Closes #153.

The interpolation has been added to the project. To implement it, the output density field will be packed into 1 array in worker per second and sent the data to the main thread for further processing. The interpolation now is a simple linear interpolation, where it only considers the generated frame inside the pack. In the implementation, the target is hardcoded as 30fps.

Some issues in the implementation

In this branch, if the user press pause button, the worker will pause after 1iteration, however, those iterations in that seconds will still be handled and returned for interpolation

The output data type of the simulation component was changed to enhance
the visual representation of the simulation. Initially, a simple
Float32Array was used. However, a more complicated output data type - an
array of Float32Arrays - was introduced to better represent the density
data. We also added interpolation to handle low frame rates. This
modification will provide a smoother simulation display. Furthermore,
loggers were improved to provide more insights about the worker
creation, frame rate, and the interpolation process. The naming of
temporary variables holding crucial data was also refined for a better
understanding of the codebase. Lastly, the code organization was
improved and clearer comments were added.

BREAKING CHANGE: Output from worker now distributes the data per second
instead of per each run
the missing deps have been re-added to useEffect in Simulation.tsx
according to ESLint Check
Changed the way cache is handled in the modelWorker file. Instead of
duplicating the entire cache with the 'slice' method, the change uses
the cache directly because the copy will automatically handled by
postMessage. This optimization reduces unnecessary resource consumption
and improves efficiency.
@Lutra-Fs Lutra-Fs merged commit f593892 into main Dec 10, 2023
4 checks passed
@Lutra-Fs Lutra-Fs deleted the interpolation branch December 10, 2023 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add interpolation between model output frames
2 participants