Files
Syoyo Fujita c6ace402dc Add granular coroutine yield phases for Tydra conversion
- Remove debug console.log statements from coroutine helpers
- Split Tydra conversion into multiple phases with yields:
  - detecting: Format detection
  - parsing: USD parsing
  - setup: Converter environment setup
  - assets: Asset resolution setup
  - meshes: Tydra mesh conversion
  - complete: Done

- Each phase yields to event loop, allowing browser repaints
- Update progress-demo.js phase mapping with descriptive messages
- The Tydra ConvertToRenderScene call is still blocking, but yields
  occur before and after it

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 04:13:51 +09:00
..
2025-08-26 12:52:01 +09:00
2025-07-25 05:12:43 +09:00
2025-08-23 08:52:42 +09:00
2025-07-11 09:21:26 +09:00
2025-09-02 10:04:35 +09:00

TinyUSDZ JS/WASM

Demo app

See demo folder. It uses npm package of tinyusdz, so no WASM building required.

Technical note on JS/WASM version of TinyUSDZ

Please see wiki https://github.com/lighttransport/tinyusdz/wiki/WASM-and-JavaScript-module

For library developers

See js folder for JS codes.

Building WASM module

Emscripten and emcmake required. TinyUSDZ is beging built with C++20 to use C++20 coruntine to support async over JS/WASM boundary, without requiring sASYNCIFY and JSPI(JavaScript Promise Integration)

Standard WASM32 build (2GB memory limit)

$ ./bootstrap-linux.sh
$ cd build
$ make

WASM64/MEMORY64 build (8GB memory limit)

$ rm -rf build
$ emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DTINYUSDZ_WASM64=ON -Bbuild
$ cd build
$ make

Memory Limit Defaults

  • WASM32 (standard): 2GB default memory limit
  • WASM64 (MEMORY64): 8GB default memory limit

The JavaScript wrapper automatically uses the appropriate native default based on the build architecture.

Note: WASM64/MEMORY64 requires browsers with MEMORY64 support (Chrome 109+, Firefox 102+ with flags enabled).

wasm module(tinyusdz.js and tinyusdz.wasm) will be output to js/src/tinyusdz folder.

See also: bootstrap-examples.sh for build configuration examples.

Note

  • asyncify is disabled since it increases code size ~2.5x

Code size

tinyusdz.wasm

2025/05. emsdk 4.0.8. -Oz : 1.6 MB 2025/06. emsdk 4.0.9. -Oz : 1.9 MB

zstd compression

we recommend to use zstd compression for wasm binary in the deployment. for example, 1.9MB tinyusdz wasm can be compressed to 400KB with -19 compression level.

Prepare wasm.zstd

$ zstd -19 tinyusdz.wasm

See js/src/tinyusdz/TinyUSDZLoader.js to how to load zstd compressed wasm.

stack size

128k => ok. 64k => ok.

npm packaging

See npm folder and <tinyusdz>/.github/workflows/wasmPublish.yml for npm publish.