|
|
|
|
|
by Birch-san
1772 days ago
|
|
okay, have another look now[0]. I've updated it to use a consistent number of particle iterations regardless of how much time is being simulated. in fact, you've caught that it was using as many as 16 iterations (my intention was 3), so this change should make it substantially more performant and less stiff. moreover, I found that some objects were being allocated by my perf-measurement code. ironically making it slower. fixed now. if it needs to simulate large stretches of time: I now split that into multiple 1/60th-second world.Step() calls, instead of attempting to scale up the time and number of iterations. as a result of these changes: Wave Machine now looks a bit more like the original liquidfun.js demo. Gravity looks a bit more stable now (doesn't bounce when the scheduler throttles us). I've also added a safeguard to help underpowered devices. if we determine that we're not simulating fast enough to finish in a timely manner: we settle for simulating just 1/60th of a second (i.e. even if 1/20th of a second elapsed since we were last scheduled). this admittedly results in slow-mo, but is preferable to exacerbating the perf problem (and has a chance of getting us back-on-track). [0] https://birchlabs.co.uk/liquidfun-wasm/ |
|