Trying to use CreateGroundFromHeightMap() with url: string gives the error:
Uncaught (in promise) LoadImage is only supported in web or BabylonNative environments
It looks like passing data: Uint8Array instead of url: string can work inside of a Web Worker. Is there an easy way to get the Uint8Array buffer inside of a Web Worker from the string URL?
The best way would be to parse it outside of the web worker and then pass it to the worker as a typed array.
You can actually use the function Tools.LoadImage and then the engine’s resizeImageBitmap function to do that (which is exactly what the ground builder is doing), or skip the LoadImage altogether and pass an HTML Image element directly to resizeImageBitmap. you get the Uint8Array and can do whatever you want with it