GitXplorerGitXplorer
s

tinyvdbio

public
36 stars
1 forks
1 issues

Commits

List of commits on branch devel.
Unverified
098348efab3d68e0ef7c0ad280c423593f963f3f

Add variant.

ssyoyo committed 2 years ago
Unverified
ed6ff549ea7c7ffe6fffe63580afd6200d768639

Merge branch 'devel' of github.com:syoyo/tinyvdbio into devel

ssyoyo committed 3 years ago
Unverified
52bbda17b0fc10a66ecf08a4968293a9032e5229

Fix compile.

ssyoyo committed 3 years ago
Unverified
51798db00a8f3e361e6b51234b8a2d451c22281f

VoxelIndex hash experiment.

ssyoyo committed 3 years ago
Unverified
3c5beba02bf28e41eaabe6ea16557b913067bc59

Add nanovdb for openvdb2nanovdb example(through TinyVDBIO).

ssyoyo committed 3 years ago
Unverified
5a1e9b51781628a7c4d20d52abd7383bd01051c4

Fix build on clang.

ssyoyo committed 4 years ago

README

The README file for this repository.

TinyVDBIO, header-only C++ OpenVDB IO library.

WARNIG! This is still experimental project and WORK IN PROGRESS project!! not working yet

TinyVDBIO is header-only C++11 OpenVDB IO library. Not all OpenVDB format are supported. Also, TinyVDBIO does not provide non-IO related features(e.g. volume op, iso-surface generation).

TinyVDBIO is good for not only your graphics application, but also HPC visualization tools.

Features

  • [x] Dependency-free C++11 code.
  • [x] Big endian support(e.g. Power, SPARC)
  • [x] Cross-platform(should be at least compilable on Linux, macOS and Windows)
  • [x] Limited support of loading OpenVDB data(version from 220 to 223 are supported)
    • [x] ZIP compression
    • [x] BLOSC compression
  • [ ] Simple saving of OpenVDB data.

TinyVDB only feature

  • [ ] Support big endian machine(e.g. SPARC, POWER).
    • Will be supported soon!

Limitation on reading OpenVDB file with TinyVDB

File version less than 220(OPENVDB_FILE_VERSION_SELECTIVE_COMPRESSION) is not supported.

Currently, only FloatTree(tree::Tree4<float, 5, 4, 3>::Type) topology is supported. (At least example VDB files at http://www.openvdb.org/download/ could be read in TinyVDB)

TODO

  • [ ] Multi-threaded decoding using C++11 thread.
  • [ ] Support points.
  • [ ] Support various topology type.
  • [ ] Support Multipass IO version(224)
  • [ ] mmap based accesss for larger data set.
  • [ ] Switch to MIT license by removing OpenVDB code(MPL 2.0 licensed code)

How to use

Simply copy src/tinyvdbio.h and src/miniz.c and src/miniz.h to your project. Recent OpenVDB file(223~) are usually compressed using BLOSC, so it is highly recommended to enable BLOSC suppor(see the below for compiliation).

Compile flags

  • TINYVDBIO_USE_BLOSC : Enable Blosc compression.
  • TINYVDBIO_USE_SYSTEM_ZLIB : TinyVDBIO use miniz as a default zip compression library. You can define this TINYVDBIO_USE_SYSTEM_ZLIB to use system provided zlib library. Plese add an include path to zlib.h if required.

Example

// Uncomment this if you want to use system provided zlib library.
// #define TINYVDBIO_USE_SYSTEM_ZLIB
// #include <zlib.h>

// define this only in *one* .cc file.
#define TINYVDBIO_IMPLEMENTATION
#include "tinyvdbio.h"


T.B.W.

openvdb2nanovdb

TODO: Convert OpenVDB data to NanoVDB usint TinyVDBIO

Blosc

Setup

$ git submodule update --init --recursive --depth 1

Build

$ cd third_party/c-blosc/
$ rm -rf build
$ mkdir build
$ cd build
$ cmake ..
$ make

CMake build

CMake build is provided for example/test build.

Linux

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

CMake options

Notes

Terms

background is a uniform constant value used when there is no voxel data.

Node is composed of Root, Internal and Leaf. Leaf contains actual voxel data.

Root and Internal node have Value or pointer to child node, where Value is a constant value for the node(i.e. 1x1x1 voxel data).

There are two bit masks, child mask and value mask, for each Node.

License

TinyVDBIO is released under the Mozilla Public License Version 2.0, which is a free, open source, and detailed software license developed and maintained by the Mozilla Foundation. It is a hybrid of the modified BSD license and the GNU General Public License (GPL) that seeks to balance the concerns of proprietary and open source developers.

Third party licenses

  • imgui : MIT license
  • stb series : Public domain
  • glfw3 : zlib license
  • glad : ???
  • clipp: MIT license.
  • nanovdb : MPL 2.0 license.

Notes on patent

TinyVDB uses some code from OpenVDB related to IO, Archive and Tree. According to MPL2.0, Modifing source code may loose patent grant from original contributors(in this case, DreamWorks).

At this point, it looks there is no claimed patent(including application or pending phase) for hierarchical grid representation by DreamWorks.