Files
shacraft-core/client/block-light-worker.js
Emil c7e86663d8
MVP checks / mvp (push) Canceled after 0s
Expand voxel gameplay, lighting, full-height streaming and world imports
Add shared Rust/WASM physics, worker meshing and diagnostics, 64-chunk full-height streaming, atlas texture support, and baseline world import. Document the current implementation and include the supplied in-game lobby screenshot.
2026-09-17 02:10:53 +03:00

16 lines
663 B
JavaScript

import { buildBlockLight } from "./block-light.js";
self.onmessage = ({ data: request }) => {
try {
const start = performance.now();
const result = buildBlockLight(new Map(request.blocks), new Map(request.materials), request.bounds);
const { min, size, data, sourceCount, blockLevels, skyLevels } = result;
self.postMessage({ generation: request.generation,
field: { min, size, data, sourceCount, blockLevels, skyLevels },
milliseconds: performance.now() - start,
}, [data.buffer, blockLevels.buffer, skyLevels.buffer]);
} catch (error) {
self.postMessage({ generation: request.generation, error: error.message });
}
};