This project contains the source code for our paper Editing Compressed High-resolution Voxel Scenes with Attributes which was be presented at Eurographics 2023. We present two different color compression schemes to be used for SVDAG editing:
- Linear-time compressor that is compatiable with the lossy compression scheme presented in Compressing Color Data for Voxelized Surface Geometry.
- GPU based linear-time compressor that encodes colors without loss of precision (lossless).
These compression schemes are implemented inside the HashDAG framework (paper) for interactive SVDAG editing.
You will need to install the latest CUDA release as well as the vcpkg package manager.
Install Visual Studio 2022 and the CUDA Toolkit.
To install vcpkg
, open Command Prompt and navigate to the folder where you want to install vcpkg
. Then run the following commands:
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg.exe integrate install
Now open the root folder of this (SVDAG editing) project using the "Open a local folder" option in Visual Studio:
Install CMake, a C++20 compatible compiler, and the CUDA Toolkit.
To install vcpkg
, open Terminal and navigate to the folder where you want to install vcpkg
. Then run the following commands:
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
This last step will print a message like:
CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake"
You are now ready to build the project. Navigate to the root folder of this project (SVDAG editing) in terminal and run the following commands. Replace -DCMAKE_TOOLCHAIN_FILE=...
by the instructions returned by ./vcpkg integrate install
in the previous step.
mkdir out
cd out
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake ../
cmake --build .
At the start of the pogram, it tries to load an existing SVDAG from a data
folder inside the root of this repository. Create a data
folder and place an existing HashDAG file there. The SVDAGs used in our paper are provided by Phyronazz and can be downloaded here:
https://drive.google.com/drive/folders/1sIYzKSAmOoMA9sfqzkpkF_LiN2HYKxxp?usp=sharing
Compressed DAGs with colors can be created from meshes using the tool from Dan Dolonius: https://github.com/gegoggigog/DAG-example/tree/compression Some additional work has been done by Phyronnaz in this fork: https://github.com/Phyronnaz/DAG_Compression
We found that CUDA malloc causes some slow-downs compared to using a custom memory allocator. We use Vulkan Memory Allocator to perform sub-allocations from a single large cudaMalloc
allocation performed at start-up. Vulkan Memory Allocator is enabled by default, but can be disabled with the following CMake option: -DENABLE_VULKAN_MEMORY_ALLOCATOR=0
.
The program is completely configured through compile time definitions. The default parameters are defined in typedefs.h
.
It is recommended to override them in src/script_definitions.h
.
#pragma once
// Scene
#define SCENE "epiccitadel"
#define SCENE_DEPTH 14
// Color encoding
#define DAG_TYPE EDag::MyHashDagLossy // MyHashDagLossy, MyHashDagLossless888, MyHashDagLossless565, HashDag (previous work)
#define COLOR_TREE_LEVELS 8 // Subtree depth at which color compression is applied.
// Miscellaneous
#define ENABLE_CHECKS 0 // Enable/disable debug assertions
#define THREADED_EDITS 1 // Enable multi-threading when editing.
#define EDIT_PARALLEL_TREE_LEVELS 9 // Multi-threading granularity: at which level in the tree (counting from the leaf nodes) editing will multi-thread.
// Benchmarking
#define BENCHMARK 0 // Disables any assertions/checks that could slow down performance.
#define USE_REPLAY 0 // Set to 1 to play a replay file.
#define REPLAY_NAME "screenshot1" // Name of the replay file (must be in "replays" folder).
#define REPLAY_DEPTH 14 // The scene depth at which the replay was recorded.
#define EXIT_AFTER_REPLAY 0 // Automatically close the program at the end of a replay.
#define STATS_FILES_PREFIX "epiccitadel32k-random_paint_everything_perf-asdf-c7-g9" // Name of the output stats file.
#define PROFILING_PATH "/home/mathijs/Documents/GitHub/HashDAG/profiling" // Folder to the output stats file.
Most of the code structure remains unchanged from the HashDAG framework. To implement our changes, we created a copy of the HashDAG editing code with some changes (see src/dags/my_hash_dag/...
). Color compression is implemented in src/colors/...
.
We also provide a stand-alone benchmark tool for testing color compression (extras/compression_benchmark
), as well as a tool to apply Perlin noise colors to an existing SVDAG (extras/rainbowify
).