Syoyo Fujita 64e77a615d Fix compilation with VS2017
Enable OpenSubdiv by default for VS2019(CMakeSettings.json)
2020-04-20 22:12:32 +09:00
2020-04-20 03:30:32 +09:00
2020-04-15 01:53:36 +09:00
2020-04-17 21:21:09 +09:00
2020-04-20 22:12:32 +09:00
2020-04-02 01:34:04 +09:00
2020-01-08 22:05:24 +09:00
2020-04-20 22:12:32 +09:00
2020-04-15 00:36:35 +09:00
2020-04-15 14:08:53 +09:00
2020-04-20 22:12:32 +09:00
2020-04-20 22:12:32 +09:00

Tiny USDZ loader

TinyUSDZ is dependency-free(depends only on C++ STL. Yes, you don't need USD library!) USDZ loader library written in C++11.

Status

TinyUSDZ is currently in alpha stage. Not usable.

  • USDC data parse
  • Reconstuct scene graph representaion(2020 April expected)
  • Write simple OpenGL viewer example(2020 April expected)
  • Animation(usdSkel) support(2020 Summer expected)
  • Vulkan raytracing viewer example
  • USDZ writer

Supported platforms

  • Linux 64bit or later
    • ARM AARCH64
    • x86-64
    • RISC-V(Should work)
    • SPARC, POWER(Big endian machine). May work(theoretically)
  • Android arm64v8a
  • iOS(Should work)
  • macOS
  • Windows 10 64bit or later
    • Windows ARM should work

Requirements

  • C++11 compiler
    • gcc 4.8.5(CentOS 7 default) or later
    • Visual Studio 2017 or later(2015 may OK)
    • clang 3.8 or later

USDZ file format

USDZ is actually the uncompressed zip file. USDZ(ZIP) contains usdc(binary) and resources(e.g. image/auduo files)

Build

Integrate to your app

Recomended way is simply copy src and include folder to your app, and add *.cc files to your app's build system.

Compiler defines

  • TINYUSDZ_USE_OPENSUBDIV : Use OpenSubviv for subdivision surface(to get smooth mesh from USD(Z) primitive).

CMake

cmake build is still provided for CI build. CMakeSettings.json is provided for Visual Studio 2019.

Cmake project is not recommended for embedding TinyUSDZ to your app.

$ mkdir build
$ cd build
$ cmake ..
$ make

CMake build options

  • TINYUSDZ_BUILD_TESTS : Build tests
  • TINYUSDZ_BUILD_EXAMPLES : Build examples(note that not all examples in examples folder are built)
  • TINYUSDZ_WITH_OPENSUBDIV : Use OpenSubviv to tessellate subdivision surface.
    • OpenSubdiv code is included in TinyUSDZ repo. If you want to use external OpenSubdiv repo, specity the path to OpenSubdiv using osd_DIR cmake environment variable.
  • TINYUSDZ_WITH_AUDIO : Support loading audio(mp3 and wav).
  • TINYUSDZ_WITH_EXR : Support loading EXR format HDR texture through TinyEXR.

Meson

Meson build is provided for compile tests.

$ meson builddir
$ cd builddir
$ ninja

Examples

Simple dump Simple OpenGL viewer

See examples directory for more examples.

Data format

See prim_format.md and preview_surface.md

TODO

  • Subdivision surface using OpenSubdiv.
    • Replace OpenSubdiv with our own subdiv library or embree3's one.
  • USDA(USD Ascii) support
    • Write our own USDA parser with PEG.
  • Animation
    • Skinning(usdSkel)
    • Blend shapes
      • In-between blend shapes
  • Audio play support
    • Play audio using SoLoud or miniaudio(or Oboe for Android)
    • wav(dr_wav)
    • mp3(dr_mp3)
    • m4a?
  • Android example
  • iOS example?
  • CPU raytracer viewer
  • Viewer with Vulkan API.
  • Read USD data with bounded memory size. This feature is especially useful for mobile platform(e.g. in terms of security, memory consumption, etc)
  • USDZ saver
  • Support Nested USDZ
  • UDIM texture support
  • Support big endian

Fuzzing test

See tests/fuzzer/

License

TinyUSDZ is licensed under MIT license.

Third party licenses

Description
Tiny, dependency-free USDZ/USDA/USDC library written in C++14
Readme 114 MiB
Languages
C++ 64.1%
JavaScript 15.5%
C 8.8%
Python 3.7%
CMake 1.5%
Other 6.2%