CubeTexture in Webworker


I’m trying to create a valid THREE.CubeTexture object in a Web Worker.

Since THREE.CubeTextureLoader references the document which is inaccessible in a Web Worker context, how should I go about achieving my goal?

Things I’ve already tried that don’t work:

  • create URIs of images in main thread and send them to the worker so that a CubeTexture object can be instantiated from an array of URIs.
  • pass URIs to the load method of CubeTextureLoader (still references document)
  • create an array of 6 CanvasTextures each containing one cubemap image and instantiate CubeTexture with said array.

Thank you for your time!