Rebuild local Blender WASM environment and recovery evidence
This commit is contained in:
@@ -577,14 +577,17 @@ workerScope.onmessage = (event): void => {
|
||||
message.canvas.addEventListener("webglcontextlost", (event) => {
|
||||
event.preventDefault();
|
||||
contextLost = true;
|
||||
post({ type: "deviceStatus", status: "lost" });
|
||||
post({ type: "volumeStatus", status: "loading", count: 0, errorCode: "WEBGL_CONTEXT_LOST" });
|
||||
});
|
||||
message.canvas.addEventListener("webglcontextrestored", () => {
|
||||
contextLost = false;
|
||||
post({ type: "deviceStatus", status: "restoring" });
|
||||
configurePBRRenderer(renderer!);
|
||||
volumeRenderCache.clear();
|
||||
void refreshVolumes();
|
||||
render();
|
||||
post({ type: "deviceStatus", status: "ready" });
|
||||
});
|
||||
configurePBRRenderer(renderer);
|
||||
scene = new Scene();
|
||||
@@ -601,6 +604,7 @@ workerScope.onmessage = (event): void => {
|
||||
scene.add(light, light.target, new GridHelper(20, 20, 0x60656e, 0x383b42), root, importedLights);
|
||||
resize(message.width, message.height, message.pixelRatio);
|
||||
post({ type: "ready" });
|
||||
post({ type: "deviceStatus", status: "ready" });
|
||||
}
|
||||
else if (message.type === "snapshot") setSnapshot(message.snapshot, message.geometryBuffers, message.nonMeshGeometryBuffers);
|
||||
else if (message.type === "textureAssets") applyTextureAssets(message.assets);
|
||||
|
||||
Reference in New Issue
Block a user