Alchemist0823 / three.quarks

Three.quarks is a general purpose particle system / VFX engine for three.js
https://quarks.art
480 stars 22 forks source link

Improvement: Offload Physics to Thread #55

Closed theripper93 closed 1 year ago

theripper93 commented 1 year ago

The system will reach a CPU bottleneck pretty fast when using complex effects, way sooner than any GPU bottleneck.

Implement a way to offload the physics calculations to a worker. Ideally, when a particle is first created the first couple frames are calculated on the main thread while calculations of multiple frames are requested to the worker which can generate the simulation in advance.

Obviously requesting the calculations every frame to the worker would not be possible since you would be bottlenecked by the transfer between threads so the only way i see this working is if the worker calculates multiple frames in advance per request.

Alchemist0823 commented 1 year ago

Thanks for the suggestion. We are actively working on a WebAssembly based solution and Compute Shader based solution for simulation.