All Projects → syoyo → tinyusdz

syoyo / tinyusdz

Licence: MIT license
Tiny, dependency-free USDZ/USDA/USDC library written in C++14

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
CMake
9771 projects
Metal
113 projects
GLSL
2045 projects
HLSL
714 projects

Projects that are alternatives of or similar to tinyusdz

Webxr Emulator Extension
WebXR emulator extension
Stars: ✭ 231 (+5.48%)
Mutual labels:  ar
jpopup
Simple lightweight (<2kB) javascript popup modal plugin
Stars: ✭ 27 (-87.67%)
Mutual labels:  dependency-free
docker-gltf-to-udsz
Docker container for converting gltf files into apple usdz quicklook files
Stars: ✭ 42 (-80.82%)
Mutual labels:  usdz
Amazing Arkit
ARKit相关资源汇总 群:326705018
Stars: ✭ 239 (+9.13%)
Mutual labels:  ar
denoliver
A simple, dependency free static file server for Deno with possibly the worst name ever.
Stars: ✭ 94 (-57.08%)
Mutual labels:  dependency-free
obj2usdz
🦖 obj2usdz, convert .OBJ files to .USDZ on iOS
Stars: ✭ 56 (-74.43%)
Mutual labels:  usdz
Webar Article
WebAR-Article is a responsive and information rich website that is progressively enhanced with Augmented Reality content exposed through experimental web technologies.
Stars: ✭ 225 (+2.74%)
Mutual labels:  ar
StyleSight
Browser based 'real-time' AR 'fast' neural style transfer using tensorflowjs
Stars: ✭ 15 (-93.15%)
Mutual labels:  ar
ARGoal
Get more goals. | Virtual Goals & Goal Distance | App Doctor Hu
Stars: ✭ 14 (-93.61%)
Mutual labels:  ar
miniparquet
Library to read a subset of Parquet files
Stars: ✭ 38 (-82.65%)
Mutual labels:  dependency-free
Polymer
🎨 graphics + interaction engine
Stars: ✭ 243 (+10.96%)
Mutual labels:  ar
V2R
Code for our IJCAI 2020 paper: "Keep It Real: a Window to Real Reality in Virtual Reality".
Stars: ✭ 20 (-90.87%)
Mutual labels:  ar
lvr
👓 Augmented Reality for everyone - Out of the world experiences
Stars: ✭ 92 (-57.99%)
Mutual labels:  ar
Three.ar.js
A helper three.js library for building AR web experiences that run in WebARonARKit and WebARonARCore
Stars: ✭ 2,702 (+1133.79%)
Mutual labels:  ar
Bose-Frames-Web-SDK
A JavaScript version of the Bose Frames SDK
Stars: ✭ 74 (-66.21%)
Mutual labels:  ar
Webxr Polyfill
A polyfill and example code for building augmented reality (AR) and virtual reality (VR) applications using WebXR.
Stars: ✭ 227 (+3.65%)
Mutual labels:  ar
awesome-webxr
All things WebXR.
Stars: ✭ 117 (-46.58%)
Mutual labels:  ar
YUXI-Mixed-Reality-Hardware-Toolkit
YUXI: The Mixed Reality Hardware Toolkit makes it easier to get started bridging the physical and digital using sensors and actuators to create interactions with VR/AR/MR content.
Stars: ✭ 21 (-90.41%)
Mutual labels:  ar
Vapecord-ACNL-Plugin
Animal Crossing NL Vapecord Public Plugin WIP
Stars: ✭ 72 (-67.12%)
Mutual labels:  ar
velox
The minimal PHP micro-framework.
Stars: ✭ 55 (-74.89%)
Mutual labels:  dependency-free

Tiny USDZ library in C++14

TinyUSDZ is dependency-free(depends only on C++ STL. Other 3rd-party libraries included. Yes, you don't need pxrUSD library!) USDZ/USDC/USDA library written in C++14.

Build status

C/C++ CI

Linux Windows macOS iOS Android
dev Linux Build Windows CI build
Windows ARM CI build
macOS Build iOS Build Android arm64v8a Build

Total alerts

Supported platforms

Linux Windows macOS iOS Android WASM
dev 64bit
32bit
aarch64
64bit
32bit
ARM64/ARM32
sandbox/wasi

Status

TinyUSDZ is near to release first version v0.8.0. Core loading feature(both USDA and USDC) is production-grade. (Flattened scene only(i.e, USDZ). Composition features are not supported yet)

Remaining task is to write a examples, demo and scene/render delegate(Tydra).

  • USDZ/USDC(Crate) parser
  • USDZ/USDC(Crate) writer (Work-in-progress)
  • USDA parser
  • USDA writer
  • Support basic Primitives(Xform, Mesh, BasisCurves, etc.), basic Lights and Shaders(UsdPreviewSurface, UsdUVTexture, UsdPrimvarReader)

Please see doc/status.md for more details

  • Write simple SDL viewer example(2022 Winter expected)
  • Write iOS and Android example(2022 Winter expected)
  • Vulkan or OptiX/HIP RT raytracing viewer example
  • USD <-> glTF converter example
  • Web demo with Three.js?

Security and memory budget

TinyUSDZ has first priority of considering security and stability.

USDZ(USDC) is a binary format and data are compressed. To avoid out-of-bounds access, out-of-memory, and other security issues when loading malcious USDZ(e.g. USDZ file from unknown origin), TinyUSDZ has a memory budget feature to avoid out-of-memory issue.

To limit a memory usage when loading USDZ file, Please set a value max_memory_limit_in_mb in USDLoadOptions.

TinyUSDZ source codes(and some external third party codes) are also checked by Address Sanitizer, CodeQL and Fuzzer.

Fuzzer

See tests/fuzzer . For building fuzzer tests, you'll need Meson and Ninja.

If you need to deal with arbitrary USD files from unknown origin(e.g. from internet, NFT storage. Whose may contain malcious data), it is recommended to use TinyUSDZ in sandboxed environment(RunC, FlatPak, WASI(WASM)). Run in WASI is recommended at the moment(please see next section).

Web platform(WASM) and sandboxed environment(WASI)

TinyUSDZ does not use C++ exceptions and can be built without threads. TinyUSDZ supports WASM and WASI build. So TinyUSDZ should runs well on various Web platform(WebAssembly. No SharedArrayBuffer, Atomics and WebAssembly SIMD(which is not yet available on iOS Safari) required) and sandboxed environment(WASI. Users who need to read various USD file which possibly could contain malcious data from Internet, IPFS or blockchain storage).

See sandbox/wasi/ for Building TinyUSDZ with WASI toolchain.

Tydra

USD itself is a generic container of 3D scene data. Tydra is an interface to Renderers/Viewers and other DCCs. Tydra may be something like Tiny version of pxrUSD Hydra, but its API is completely different. See src/tydra/README.md for the background.

  • Image color space
  • More details are T.B.W.

Notice

TinyUSDZ does not support Reality Composer file format(.reality) since it uses proprietary file format and we cannot understand it(so no conversion support from/to Reality also).

Commercial support

TinyUSDZ focuses on loading/writing USDA/USDC/USDZ functionalities. Example viewer is just for demo purpose. Currently TinyUSDZ project is run as personal project by syoyo and syoyo does not provide commercial support as an individual.

If you need commercial support, eco-system development(e.g. plug-ins, DCC tools on top of TinyUSDZ) or production-grade USDZ model viewer(e.g. embed TinyUSDZ to your AR app, 3D NFT Android mobile viewer capable of displaying (encrypted) USDZ model), please contact Light Transport Entertainment, Inc. : https://goo.gl/forms/1p6uGcOKWGpXPHkA2

Projects using TinyUSDZ

Other related projects

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
  • macOS(Arm, x86-64)
  • Windows 10 64bit or later
    • Windows ARM(should work)
  • WebAssembly
  • WASI(through WASI toolchain)

Requirements

  • C++14 compiler
    • gcc 4.9 or later
    • Visual Studio 2019 or later(2017 may compiles)
      • Can be compiled with standalone MSVC compilers(Build Tools for Visual Studio 2019)
    • clang 3.4 or later https://clang.llvm.org/cxx_status.html
    • llvm-mingw(clang) supported
    • MinGW gcc supported, but not recommended(You may got compilation failure depending on your build configuration: #33 , and linking takes too much time if you use default bfd linker.). If you want to compile TinyUSDZ in MinGW environment, llvm-mingw(clang) is recommended to use.

Build

Integrate to your app

If you are using CMake, just include tinyusdz repo with add_subdirectory.

Another way is simply copy src folder to your app, and add *.cc files to your app's build system. All include paths are set relative from src folder, so you can just add include directory to src folder.

See <tinyusdz>/CMakeLists.txt and examples/sdlviewer/CMakeLists.txt for details.

It may not be recommend to use tinyusdz as a git submodule, since the repo contains lots of codes required to build TinyUSDZ examples but these are not required for your app.

Compiler defines

Please see CMake build options and CMakeLists.txt. In most case same identifier is defined from cmake build options: For example if you specify -DTINYUSDZ_PRODUCTION_BUILD=1 for cmake argument, TINYUSDZ_PRODUCTION_BUILD is defined.

CMake

Cmake build is provided.

Linux and macOS

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

Please take a look at scripts/bootstrap-cmake-*.sh for some build configuraions.

Visual Studio

Visual Studio 2019 and 2022 are supported.

CMakeSettings.json is provided for Visual Studio 2019, but reccommended way is to invoke vcsetup.bat. (Edit VS version in vcsetup.bat as you with)

LLVM-MinGW build

MinGW native and cross-compiling example using llvm-mingw(clang) is provided. See scripts/bootstrap-cmake-mingw-win.sh and scripts/bootstrap-cmake-llvm-mingw-cross.sh for details.

One of benefit to use llvm-mingw is address sanitizer support on Windows app.

To run app(.exe, you'll need libunwind.dll and libc++.dll on your working directory or search path)

For Windows native build, we assume ninja.exe is installed on your system(You can use it from Meson package)

CMake build options

  • TINYUSDZ_PRODUCTION_BUILD : Production build. Do not output debugging logs.
  • 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.
  • TINYUSDZ_WITH_PXR_COMPAT_API : Build with pxrUSD compatible API.

clang-cl on Windows

Assume ninja.exe is installed and path to ninja.exe is added to your %PATH%

Edit path to MSVC SDK and Windows SDK in bootstrap-clang-cl-win64.bat, then

> bootstrap-clang-cl-win64.bat
> ninja.exe

Examples

See examples directory for more examples, but may not actively maintained except for the above examples.

USDZ Data format

See prim_format.md and preview_surface.md

Blender add-on(will be removed)

There was some experiements of TinyUSDZ add-on for Blender.

But Blender's USD support is getting better. We recommend to use Omniverse version of Blender's USD import/export feature.

https://builder.blender.org/download/experimental/

Build Blender add-on on Linux(deprecared)

Edit path to python interpreter in scripts/bootstrap-cmake-linux-blender-pymodule.sh, then

$ ./scripts/bootstrap-cmake-linux-blender-pymodule.sh
$ cd build
$ make

Copy tinyusd_blender.*-linux-gnu.so to blender's folder. Recommended location is USER folder(~/.config/blender/2.xx)

Create scripts/addons/modules folder if required

mkdir -p ~/.config/blender/2.93/scripts/addons/modules

TODO

Higher priority

  • Built-in usdObj(wavefront .obj mesh) support.
    • Through tinyobjloader.
  • Support Crate(binary) version 0.8.0(USD v20.11 default)
  • usdSkel utilities
    • Joint hierachy reconstruction and compute skinning matrix(usdSkel)
    • Blend shapes
      • Basic Blendshapes support
      • In-between blend shapes
  • Read USD data with bounded memory size. This feature is especially useful for mobile platform(e.g. in terms of security, memory consumption, etc)
  • USDC writer
  • Support Nested USDZ
  • UDIM texture support
  • MaterialX support
    • Parse XML file

Middle priority

  • Composition arcs
  • Code optimization

Lower priority

  • iOS example?
  • Support AR related schema(Game-like feature added by Reality Composer?)
  • Audio play support
    • Play audio using SoLoud or miniaudio(or Oboe for Android)
    • wav(dr_wav)
    • mp3(dr_mp3)
    • m4a(ALAC?)
  • Viewer with Vulkan API.
  • Replace OpenSubdiv with our own subdiv library.
  • Write parser based on the schema definition.
  • Support big endian architecture.

Python binding and prebuit packages

Python binding and prebuilt packages(uploadded on PyPI) are provided.

See python/README.md and doc/python_binding.md for details.

CI build

CI build script is a build script trying to build TinyUSDZ in self-contained manner as much as possible(including custom Python build)

Linux/macOS

T.B.W.

Windows

Build custom Python,

> ci-build-python-lib.bat

then build TinyUSDZ by linking with this local Python build.

> ci-build-vs2022.bat

License

TinyUSDZ is licensed under MIT license and Apache 2.0 license. (Doing relicensing from MIT to Apache 2.0. Will be fully relicensed to Apache 2.0 at some point)

Third party licenses

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].