Files
shacraft-core/client/edit-mesh-worker.js
Emil c7e86663d8
MVP checks / mvp (push) Waiting to run
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

11 lines
653 B
JavaScript

import {buildEditMesh} from './edit-mesh.js';
import {loadLightProperties} from './light-properties.js';
const properties=loadLightProperties();
self.onmessage=({data})=>properties.then(table=>{
const start=performance.now(),result={id:data.id,epoch:data.epoch,editJob:data.editJob,preview:true};
try {
const mesh=buildEditMesh(data,table);
self.postMessage({...result,...mesh,milliseconds:performance.now()-start},[mesh.vertices.buffer,mesh.transparent.buffer]);
} catch(error) {self.postMessage({...result,error:error.message});}
}).catch(error=>self.postMessage({id:data.id,epoch:data.epoch,editJob:data.editJob,error:error.message}));