[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Public WebGL] Web Workers and ArrayBuffers?

I'm trying to write a Worker thread that does some processing and creates a mesh on the fly.
It works fine up until returning the created result to the main GUI thread.
it seems that the communication between the worker and the main thread does JSON serialization,
so if I'm sending a Float32Array from the worker, what I get in the main thread is a regular _javascript_ array.

A trivial solution is to just rebuild the Float32Array again from the array I receive but that seems wasteful.
Is there a good workaround for this? Maybe a way to tell the JSON deserialization that something should be a Float32Array ?