Skip to content

Commit

Permalink
Massive improvements to NanoVDB
Browse files Browse the repository at this point in the history
Signed-off-by: Ken Museth <ken.museth@gmail.com>
  • Loading branch information
kmuseth committed Aug 1, 2023
1 parent 3552fc6 commit 563ff1b
Show file tree
Hide file tree
Showing 77 changed files with 16,567 additions and 6,827 deletions.
6 changes: 3 additions & 3 deletions doc/nanovdb/HelloWorld.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

```cpp
#include <openvdb/tools/LevelSetSphere.h> // replace with your own dependencies for generating the OpenVDB grid
#include <nanovdb/util/OpenToNanoVDB.h> // converter from OpenVDB to NanoVDB (includes NanoVDB.h and GridManager.h)
#include <nanovdb/util/CreateNanoGrid.h> // converter from OpenVDB to NanoVDB (includes NanoVDB.h and GridManager.h)
#include <nanovdb/util/IO.h>

// Convert an openvdb level set sphere into a nanovdb, use accessors to print out multiple values from both
Expand All @@ -17,7 +17,7 @@ int main()
auto srcGrid = openvdb::tools::createLevelSetSphere<openvdb::FloatGrid>(100.0f, openvdb::Vec3f(0.0f), 1.0f);

// Convert the OpenVDB grid, srcGrid, into a NanoVDB grid handle.
auto handle = nanovdb::openToNanoVDB(*srcGrid);
auto handle = nanovdb::createNanoGrid(*srcGrid);

// Define a (raw) pointer to the NanoVDB grid on the host. Note we match the value type of the srcGrid!
auto* dstGrid = handle.grid<float>();
Expand Down Expand Up @@ -77,7 +77,7 @@ int main()

```cpp
#include <nanovdb/util/IO.h> // this is required to read (and write) NanoVDB files on the host
#include <nanovdb/DefaultCudaAllocator.h> // required for CUDA memory management
#include <nanovdb/util/cuda/CudaDeviceBuffer.h> // required for CUDA memory management

extern "C" void launch_kernels(const nanovdb::NanoGrid<float>*,
const nanovdb::NanoGrid<float>*,
Expand Down
13 changes: 11 additions & 2 deletions nanovdb/nanovdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if(NANOVDB_BUILD_UNITTESTS OR NANOVDB_BUILD_BENCHMARK)
endif()

if(NANOVDB_USE_CUDA)
set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)

if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.18)
Expand Down Expand Up @@ -167,8 +167,16 @@ set(NANOVDB_INCLUDE_FILES

# NanoVDB util header files
set(NANOVDB_INCLUDE_UTILFILES
util/CpuTimer.h
util/CreateNanoGrid.h
util/CSampleFromVoxels.h
util/CudaDeviceBuffer.h
util/cuda/CudaAddBlindData.handle
util/cuda/CudaDeviceBuffer.h
util/cuda/CudaIndexToGrid.handle
util/cuda/CudaPointsToGrid.handle
util/cuda/CudaSignedFloodFill.handle
util/cuda/CudaUtils.handle
util/cuda/GpuTimer.h
util/DitherLUT.h
util/ForEach.h
util/GridBuilder.h
Expand All @@ -183,6 +191,7 @@ set(NANOVDB_INCLUDE_UTILFILES
util/NanoToOpenVDB.h
util/NodeManager.h
util/OpenToNanoVDB.h
util/PrefixSum.h
util/Primitives.h
util/Range.h
util/Ray.h
Expand Down
4,578 changes: 3,355 additions & 1,223 deletions nanovdb/nanovdb/NanoVDB.h

Large diffs are not rendered by default.

Loading

0 comments on commit 563ff1b

Please sign in to comment.