ModifyingCompressedVoxels Main
ModifyingCompressedVoxels Main
†
V. Careil1,2 , M. Billeter1 , E. Eisemann1
1 Delft University of Technology, The Netherlands
2 Université de Rennes, France
Figure 1: To test and demonstrate our method for editing large sparse voxel geometries, we have implemented an interactive prototype
application with support for interactive editing operations. The left image shows a copy operation in the Epic Citadel scene, voxelized at a
resolution of (128k)3 . The statue inside this building contains about 170k voxels. The middle image shows larger scale edits, copying an entire
building (order of 80M voxels). The right images illustrate tools to add and delete voxels, as well as paint voxel color attributes. The bottom
right image uses the San Miguel model, voxelized at (64k)3 , where we first solidified, then carved a hole in a column.
Abstract
Voxels are a popular choice to encode complex geometry. Their regularity makes updates easy and enables random retrieval of
values. The main limitation lies in the poor scaling with respect to resolution. Sparse voxel DAGs (Directed Acyclic Graphs)
overcome this hurdle and offer high-resolution representations for real-time rendering but only handle static data. We introduce
a novel data structure to enable interactive modifications of such compressed voxel geometry without requiring de- and
recompression. Besides binary data to encode geometry, it also supports compressed attributes (e.g., color). We illustrate the
usefulness of our representation via an interactive large-scale voxel editor (supporting carving, filling, copying, and painting).
CCS Concepts
• Computing methodologies → Volumetric models;
DAGs in the compressed domain. It enables interactive geometry The original sparse voxel DAGs only encode geometry.
edits, and paves the way to many applications requiring dynamic Dado et al. [DKB∗ 16] and Dolonius et al. [DSKA18] show how
changes to a compressed DAG. Furthermore, our data structure is additional information, such as colors and other attributes (e.g.,
compatible to existing attribute-compression schemes [DSKA18]. normals), can be compressed alongside a sparse voxel DAG. Our
We demonstrate interactive color manipulations as an example. method is compatible with such approaches, and we demonstrate the
Specifically, we make the following contributions: use of colors, employing the compression method of Dolonius et al.
• A method for modifying sparse voxel DAGs in their compressed A sparse voxel DAG can be built efficiently from a sparse voxel
form, i.e., without decompression/recompression; octree [ABD∗ 18,SKOA14]. Many methods for building sparse voxel
• A novel data structure to enable interactivity and ensure little octrees exist, including out-of-core approaches [BLD13]. Neverthe-
impact on compression/rendering/traversal performance; less, while these aim at efficient ground-up builds, we focus on
• A natural recording of changes to enable undo/redo operations efficient online modifications of a sparse voxel DAG structure.
and associated garbage collection to free memory, when needed.
3. Method
2. Related Work
Modifying uncompressed voxel structures is straight-forward (and
Voxels are used in many applications to represent complex geometry. indeed one of its strengths). However, compressed structures, such
The regularity of voxel structures makes them appealing if opting as Voxel DAGs, are largely considered static. The reason is that any
for dynamic modifications, as in editing tools [3DC, SVR], as well node in a DAG may be referenced by multiple parents. Thus, naively
as games [Mc, Ast]. Nevertheless, uncompressed voxel structures changing an existing node potentially affects many parts of the
grow rapidly in size with increasing resolution. scene. To avoid this problem, our method keeps the original structure
Compressing voxel volumes is an option for reducing the mem- intact but attaches additional information to indicate modifications.
ory costs. While several rendering algorithms have been pro- These additions are light-weight as they take place directly in the
posed [BRGIG∗ 14], solutions for fast editing of large volumes compressed domain, while maintaining an efficient traversal (and,
are lacking. Our work focuses on the modification of sparse struc- thus, rendering) performance. Further, this encoding keeps track of
tures that can, e.g., arise when converting solid geometries into very all modifications, which can then be naturally un- and redone.
high-resolution voxel data. To explain our method, we first describe the principle of modify-
Sparse voxel octrees [Mea82] (SVOs) encode sparse volumes ing the geometry in a DAG (Section 3.1) without discussing imple-
efficiently by employing a hierarchy. Meagher [Mea82] encodes mentation details. We then introduce our data structure to achieve
geometry in an octree, where leafs are either filled or empty, while interactive performance (Sec.3.2). Next, we cover several extensions,
inner nodes are either empty or contain at least one pointer to a including the use of attributes, demonstrated with color manipula-
non-empty child node on the next level. By only storing non-empty tions, e.g., for painting applications (Sec.3.3). At all time, geometry
parts of the structure, SVOs deal very well with sparse data (as and color data remain compressed but the DAG is augmented with
their name indicates). SVOs can be directly traversed without de- information in each modification step. A garbage collection is used
compression and efficiently rendered via ray tracing [LK10], which to trim this information, when memory is required (Sec.3.5).
made them suitable for many applications, including indirect il-
lumination [CNS∗ 11], multi-scale editing [SVR] and out-of-core
3.1. Modifying DAG Geometry
rendering [CNLE09, CNSE10, GMI08].
We assume that modifications take place within a bounding volume
Kämpe et al. [KSA13] show that the compression rates of SVOs
(e.g., brush). Independent of the applied operation, we, thus, first
can be increased significantly by also exploiting similarities in the ac-
identify the voxel locations that require changes. To do so, our
tual geometric data. Their method identifies identical subtrees in an
method traverses the DAG structure in a depth-first manner. If a
SVO and removes duplicates by changing all references to point to
node is not affected by the change, we stop the traversal, otherwise,
a single instance of the subtree. This transforms the octree into a di-
we descend into the children. During this traversal, it is possible to
rected acyclic graph (DAG). Using this method, Kämpe et al. encode
descend into nodes that did not exist in the original DAG structure
volumes with resolutions of up to (128k)3 , while remaining compact
and will be added and compressed on the fly. An example that
(e.g., the structures fit fully into GPU memory) and maintaining real-
requires a full descent would be a single voxel that is added at the
time rendering performance. Later work increases compression rates
highest resolution level. If a larger region is filled, an earlier stop
by exploiting additional similarities [JMG16, JMG17], but we base
might be possible when an entire subtree is filled.
our method on the simpler (but still very compact) original sparse
voxel DAGs. Sparse voxel DAGs have found various applications, Once the necessary depth and location for the manipulation is
including shadows [SKOA14], many-view rendering [KBLE19], reached, we create a node representing the newly modified geometry
and time-varying geometry [KRB∗ 16]. In the latter, Kämpe et al. (following Kämpe et al. [KSA13], DAG leafs are 43 = 64 subvol-
use DAGs with multiple roots. Following a different root results in umes encoded in bits of a 64-bit integer). At this point, we need to
a different geometric representations, while identical data is still integrate the new node into the DAG. There are two cases; there
shared. The total compression increases significantly compared to already exists an identical leaf-subvolume node somewhere in the
storing separate DAGs. We use a similar insight to store multiple DAG, which means that we can use the existing version instead, or
states (before and after edits) efficiently. we need to append a new node to the DAG (without invalidating
Figure 2: Overview of the editing process. (Left) Original voxel data and the corresponding DAG. We wish to fill the region highlighted in red.
(Children are shown in counter-clockwise order, starting top-left.) (Center-left) We traverse the DAG structure and identify the leaf nodes
affected by the modification (highlighted in orange and purple in the voxel data). The purple leaf already exists in the DAG, so we find it and
return a pointer to the existing node. The orange leaf is new, so we append it to the leaf level. (Center-right) We propagate the pointers to the
parent node, and construct it. The DAG does not contain such a node yet, so we create a new one. (Right) We propagate the new pointer to its
parent (the root). Three of the parent’s children are unmodified, and we copy the corresponding values from the old instance. The fourth child
is our modified node. The new node does not exist either, and becomes a new root node that represents the modified volume. The old root is
kept (unless trimmed later) and traversing the old root returns the original voxel data.
existing nodes). In both cases, we obtain a pointer to a node within nodeptr edit( editOp, lvl, center, node )
the DAG that contains the modified geometry. The pointer is then {
passed to the parent. In the special case, where a node ends up empty, if( !editOp.affects_volume_at( center, lvl ) )
we propagate a special (reserved) pointer value to the parent node. return NodeUnchanged;
This instructs the parent to omit the node in its child mask and to if( lvl == DAGDepth-2 )
indicate its absence (no pointer needs to be stored). For each parent, return edit_leaf(editOp, lvl, center, node);
once its children have been processed, we again create a new node childMask = 0; childPtrs[8] = { EmptyNode, ... };
that reflects the changes. Such interior nodes consist of a bit-mask if( node != EmptyNode )
identifying non-empty children (eight bits) and a set of pointers (one childMask = get_child_mask( node );
per non-empty child). As in the previous case, the same two options childPtrs = unpack_child_pointers( node );
exist: the same node already exists, and we use it instead, or we add for( i = 0; i < 8; ++i )
the new node to the DAG. Again, either choice results in a pointer newChild = edit( editOp, lvl+1,
to a node in the DAG with the correctly-modified geometry, which position_of_child( center, lvl, i ),
childPtrs[i] );
is then passed again to the parent.
if( newChild != NodeUnchanged )
The procedure is repeated until reaching the root of the DAG, childPtrs[i] = newChild;
where we create a new root node. It represents the modified DAG, if( newChild != EmptyNode )
including the geometric changes. Please note that the trees attached childMask |= (1<<i); // set bit i to one
to the previous root node reflect the previous version of the DAG, else
childMask &= ∼(1<<i); // clear bit i
which enables un- and redo operations by storing such previous
roots and starting traversals from them. Section 3.5 will show how if( childMask == 0 )
to remove this unnecessary data, if needed. We illustrate the entire return EmptyNode;
editing process in Figure 2. Listing 1 includes pseudo code for the childPtrs = pack_child_pointers( childPtrs );
recursive editing function. The efficiency of our method hinges on p = find_node( lvl, childMask, childPtrs );
two operations: finding a node in the DAG and inserting new nodes. if( p == NodeNotFound )
p = append_node( lvl, childMask, childPtrs );
The next section describes how to achieve these tasks efficiently. return p;
}
v = levelBaseAddr + h × 2P + i.
Figure 4: Editing with the HashDAG structure. The figure illustrates the process at Level N; this is the same level as shown in Figure 3. The
edit updates the structure shown there. Level N receives the child pointers p0,1 and t0 from Level N + 1 (c.f. recursive calls in Listing 1). We
construct the child masks by checking the returned pointer values. For each of the three non-empty nodes, we hash the child mask and the
pointers. This identifies the buckets in which the nodes will reside. The first and third nodes (blue) are identical and a linear search will find
them at index 0x00 of the hash table. Combining the bucket’s address (0x32) with the index gives the virtual address of the node, 0x3200.
The second node (orange) is not found in bucket 0x34, so we append it to the first possible location, index 0x02 here. The final virtual
address becomes 0x3402. The virtual addresses are returned to Level N − 1, where the process repeats.
Acknowledgements [ED07] E ISEMANN E., D ECORET X.: Visibility sampling on GPU and
applications. Computer Graphics Forum (Proc. of Eurographics) 26, 3
We would like to thank Dan Dolonius and colleagues for pro- (2007). doi:10.1111/j.1467-8659.2007.01076.x. 8
viding the software to create the initial compressed DAG geom-
[GMI08] G OBBETTI E., M ARTON F., I GLESIAS G UITIÁN J.: A single-
etry and attributes from source meshes. The source scenes, San
pass GPU ray casting framework for interactive out-of-core rendering
Miguel [McG17] and Epic Citadel, were created by Guillermo M. of massive volumetric datasets. The Visual Computer 24, 7-9 (2008).
Leal Llaguno and Epic Games, respectively. doi:10.1007/s00371-008-0261-9. 2
This work was partially funded by the Swiss National Science Foun- [JMG16] JASPE A., M ARTON F., G OBBETTI E.: SSVDAGs: Symmetry-
dation (Advanced Postdoc Mobility Project 174321) and the VIDI aware sparse voxel DAGs. In Proceedings of the 2016 ACM SIGGRAPH
NextView, funded by NWO Vernieuwingsimpuls. Symposium on Interactive 3D Graphics and Games (2016), I3D ’16.
doi:10.1145/2856400.2856420. 1, 2
[JMG17] JASPE A., M ARTON F., G OBETTI E.: Symmetry-aware sparse
References
voxel DAGs (SSVDAGs) for compression-domain tracing of high-
[3DC] 3DCoat. https://3dcoat.com/, accessed 2020-02-26. 2 resolution geometric scenes. Journal of Computer Graphics Techniques
(JCGT) 6, 2 (2017). http://jcgt.org/published/0006/02/
[ABD∗ 18] A SSARSSON U., B ILLETER M., D OLONIUS D., E ISEMANN
01/. 2
E., JASPE A., S CANDOLO L., S INTORN E.: Voxel DAGs and Multires-
olution Hierarchies: From Large-Scale Scenes to Pre-computed Shad- [KBLE19] KOL T. R., BAUSZAT P., L EE S., E ISEMANN E.: MegaViews:
ows. In EG 2018 - Tutorials (2018), The Eurographics Association. Scalable many-view rendering with concurrent scene-view hierarchy
doi:10.2312/egt.20181028. 2 traversal. Computer Graphics Forum 38, 1 (2019), 235–247. doi:
10.1111/cgf.13527. 2
[App16] A PPLEBY A.: MurmurHash3, 2016. https:
//github.com/aappleby/smhasher/wiki/MurmurHash3, [KRB∗ 16] K ÄMPE V., R ASMUSON S., B ILLETER M., S INTORN E.,
accessed 2020-02-26. 4, 8 A SSARSSON U.: Exploiting coherence in time-varying voxel data. In
Proceedings of the 2016 ACM SIGGRAPH Symposium on Interactive
[Ast] Astroneer - A Game of Aerospace Industry and Interplanetary Ex-
3D Graphics and Games (2016), I3D ’16. doi:10.1145/2856400.
ploration. https://astroneer.space/, accessed 2020-02-26. 2
2856413. 1, 2
[BC18] Block compression (Direct3D 10), 2018. https:
[KSA13] K ÄMPE V., S INTORN E., A SSARSSON U.: High resolution
//docs.microsoft.com/en-us/windows/win32/
sparse voxel DAGs. ACM Transactions on Graphics 32, 4 (2013). doi:
direct3d10/d3d10-graphics-programming-guide-
10.1145/2461912.2462024. 1, 2
resources-block-compression, accessed 2020-02-26. 4
[LK10] L AINE S., K ARRAS T.: Efficient sparse voxel octrees. In Proceed-
[BLD13] BAERT J., L AGAE A., D UTRÉ P H .: Out-of-core construction
ings of the 2010 ACM SIGGRAPH Symposium on Interactive 3D Graphics
of sparse voxel octrees. In Proceedings of the 5th High-Performance
and Games (2010), I3D ’10. doi:10.1145/1730804.1730814. 2
Graphics Conference (2013). doi:10.1145/2492045.2492048.
2 [Mc] Minecraft. https://www.minecraft.net/en-us/, ac-
cessed 2020-02-26. 2
[BRGIG∗ 14] BALSA RODRÍGUEZ M., G OBBETTI E., I GLESIAS G UI -
TIÁN J., M AKHINYA M., M ARTON F., PAJAROLA R., S UTER S.: State- [McG17] M C G UIRE M.: Computer graphics archive, 2017. https:
of-the-art in compressed GPU-based direct volume rendering. Computer //casual-effects.com/data. 9
Graphics Forum 33, 6 (2014). doi:10.1111/cgf.12280. 2 [Mea82] M EAGHER D.: Geometric modeling using octree encoding.
[CNLE09] C RASSIN C., N EYRET F., L EFEBVRE S., E ISEMANN E.: Gi- Computer Graphics and Image Processing 19, 1 (1982), 85. doi:
gavoxels: Ray-guided streaming for efficient and detailed voxel rendering. 10.1016/0146-664X(82)90128-9. 1, 2
In Proceedings of the 2009 ACM SIGGRAPH Symposium on Interactive [PGMG09] P EYTAVIE A., G ALIN E., M ERILLOU S., G ROSJEAN J.:
3D Graphics and Games (2009), I3D ’09. doi:10.1145/1507149. Arches: a Framework for Modeling Complex Terrains. Computer Graph-
1507152. 2 ics Forum (Proc. of Eurographics) 28, 2 (2009). doi:10.1111/j.
[CNS∗ 11] C RASSIN C., N EYRET F., S AINZ M., G REEN S., E ISEMANN 1467-8659.2009.01385.x. 8
E.: Interactive indirect illumination using voxel cone tracing: A preview. [SKOA14] S INTORN E., K ÄMPE V., O LSSON O., A SSARSSON U.: Com-
In Proceedings of the 2011 ACM SIGGRAPH Symposium on Interactive pact precomputed voxelized shadows. ACM Transactions on Graphics
3D Graphics and Games (2011), I3D ’11. doi:10.1145/1944745. 33, 4 (2014). doi:10.1145/2601097.2601221. 2
1944787. 2
[SVR] SculptVR - Build your world with friends in ScultVR. http:
[CNSE10] C RASSIN C., N EYRET F., S AINZ M., E ISEMANN E.: Efficient //www.sculptrvr.com/, accessed 2020-02-26. 2
rendering of highly detailed volumetric scenes with gigavoxels. In GPU
Pro, Engel W., (Ed.). A K Peters, 2010, ch. X.3. http://maverick. [Vk19] Vulkan 1.1.123 - A Specification - Chapter 31 - Sparse Resources,
inria.fr/Publications/2010/CNSE10. 2 2019. https://www.khronos.org/registry/vulkan/
specs/1.1-extensions/html/vkspec.html, accessed
[DKB∗ 16] DADO B., KOL T. R., BAUSZAT P., T HIERY J.-M., E ISE - 2020-02-26. 6
MANN E.: Geometry and attribute compression for voxel scenes. Com-
puter Graphics Forum (Proc. of Eurographics) 35, 2 (2016). doi:
10.1111/cgf.12841. 1, 2
[DSKA18] D OLONIUS D., S INTORN E., K ÄMPE V., A SSARSSON U.:
Compressing color data for voxelized surface geometry. IEEE Trans-
actions on Visualization and Computer Graphics 25, 2 (2018). doi:
10.1109/TVCG.2017.2741480. 1, 2, 4, 5, 8