I'm getting a little pressed for performance in a game I'm working on. With ~6+ characters I'm starting to drop below 60fps on medium/low-end computers when my meshes are not very high poly, my animations don't have a very high sample rate and only one animation playing per character, and with no particle effects.
My render loop perf breakdown is 4-6ms spent in _animate and 12-20ms in _renderForCameras in the top level render call.
I'm investigating ways to optimize the loop, but it's really difficult to find big chunks that would use:
a) where the chunk is easy to black box
b) where the chunk is big enough that it's worth paying the high bridge-latency-cost of going in and out of a wasm module
or 2) web workers
a) where work can be done simultaneously with other stuff / where order of costly calculations don't matter
b) where we don't need to serialize / deserialize too much info if we were to send it to a worker & get a response back
c) where (like wasm) the chunk is big enough that it's worth paying the cost of messaging to and from the worker
Wasm to me feels like it'll be an all-or-nothing sort of thing because of how intertwined so many things are in babylon.
Do other people have ideas / opinions / specialty knowledge? Do you guys spot some large areas that would be easy to isolate & either execute asynchronously or just optimize with wasm?