5 ms·
It is using ThreeJS for the 3D rendering, with a custom Rust geometry kernel to generate the mesh buffers to render. The editor interface is React based.
by joeld42 1y ago
It is using ThreeJS for the 3D rendering, with a custom Rust geometry kernel to generate the mesh buffers to render. The editor interface is React based.
- Twinklebear 1y agoPretty general question, but what has your approach been for coupling ThreeJS + React w/ a Rust/Wasm kernel for mesh generation? E.g. do you have Wasm own the memory and you give ThreeJS views of the memory to upload to GPU?
- joeld42 1y agoWe don't need to update the scene at once, so when geometry changes we rebuild the buffer and send it over to typescript, and the three.js mesh will own the buffer. By being careful about what needs to be updated, we can keep things interactive. This is an older blog post but it covers the general idea of it: https://blog.arcol.io/parametric-geometry-engine https://blog.arcol.io/parametric-geometry-engine
- prideout 1y agoCurrently we simply copy a slice of the heap's ArrayBuffer from WASM to JS. In the past we exposed the heap slice directly but it was technically "unsafe" (perhaps because the heap can grow), and doing a copy did not hurt performance in any measurable way.