I am merging all object of a scene and using another modifier subsequently, this can ttake up to half a minute.
The idea is to move these operations (modify geometries, merge then tessellate) to a web worker, but I get errors as soon as i set up the imports. Is this the best way to proceed?
Note that i am using Angular
/// <reference lib="webworker" />
//import * as THREE from "three";
//import * as BGU from "three/examples/jsm/utils/BufferGeometryUtils.js";
//import { TessellateModifier } from "three/examples/jsm//modifiers/TessellateModifier.js";
//import toonShader from "~shaders/toon-shader";
//import { SceneStore } from "~stores/scene.store";
addEventListener("message", ({ data }) => {
const response = `worker response to ${data}`;
postMessage(response);
});
const wireScene = (scene: any, sceneStore: any): string => {
return "done";
};