I have a question which is probably not entirely babylon related. However, I would like to know your opinion or maybe get some advice.
My situation is as following:
- I have an existing scene
- On some event I load 10.000 - 70.000 meshes into the scene (instanced)
- The position calculation is not too heavy: You can imagine the code is structured as following:
For each object
Step 1: Calculate mesh position & scaling
Step 2: Create instance & adjust scaling and position
Step 1 is rather less computation intensive (~ 1-2%)
Now as the process takes a bit I want to display some kind of progressbar.
(I was thinking about Babylong.GUI & Slider)
However, as you can imagine the thread is blocked and the progressbar not updated.
I wonder, how would you tackle this issue?
- Should I devide the creation of the instances in some smaller packages and use promises to asyncly process the workload & update the progress on finalization?
- Maybe web-workers? However I lack experience here (Existing scene etc…)
- Something else?
What would you suggest?
Thx in advance for your advice!