Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Revamping VRoid Hub’s model processing pipeline...

Avatar for yue yue
September 26, 2024
1k

Revamping VRoid Hub’s model processing pipeline with Rust

Avatar for yue

yue

September 26, 2024
Tweet

Transcript

  1. 5

  2. • Performances ✅ • Control and correctness ✅ • Wide

    range of build targets ✅ • Good variety of libraries with quality ✅ • Team members' skills ✅ Why Rust?
  3. • small code base ✅ • easy to POC /

    prototype ✅ • easy to compare ✅ ◦ we did the comparison with Node.js / golang.. • easy to try and error (nothing is stored)✅ Why start from the download server?
  4. ポータブルな Unityアプリ実行環境の構築 LLVMpipe Mesa Xvfb Unity App GNU C Library

    Linux Kernel GPU エミュレー ション OpenGL GUI printf(); 一番偉い ポータブルにするには 自前で準備する必要あり セットで存在する LinuxサーバーでのUnityアプリケーション実行環境の模式図 → too complex 😣
  5. • Prepare for advanced processing ◦ perform texture atlas in

    pure rust context ◦ build an importer & exporter for glTF/VRM from scratch The challenge
  6. The glTF™ format • GL Transmission Format • png for

    3D models • simple: json + binary • optimized for transmission/runtime
  7. • compiled to wasm/wasi targets ◦ runs in browser ◦

    runs in docker WasmEdge Runtime • compiled as bindings ◦ node w/ napi-rs ◦ ruby w/ magnus Some future possibilities
  8. • gltf_rs / glTF handling ◦ used in Bevy engine

    (game engine) • petgraph / graph processing ◦ the same tool behind swc (js build tool) • euclid & guillotiere / math & atlas implementation ◦ comes from Servo community (browser engine) Crates we used
  9. • salsa / on-demand, incrementalized computation. ◦ powers rust-analyzer (Rust

    LSP) • KTX-Software / meshoptimizer ◦ unlocks the possibility to link with C/C++ code More dependencies available
  10. • distroless / docker base image • cargo deny /

    license and security scan Extra tooling we found useful
  11. • insta / snapshot testing • playwright / E2E testing

    with WebGL • Sentry (has an official Rust crate!) / error tracking • Datadog / performance monitoring How did we test
  12. We contribute back to the ecosystem Three.js / @types/three /

    gltf-Transform / ktx-parse / basis-universal-rs / vrm-utils-rs / …
  13. We maintain OSS projects • three-vrm • vrm-utils-rs new! ◦

    Data structures for the VRM Format. ◦ published on GitHub / crates.io ◦ https://github.com/pixiv/vrm-utils-rs
  14. To wrap it up • At VRoid, we will continue

    to focus on improving existing systems and user experiences. • There are more plans and features coming this year to enhance our services. Please stay tuned!