Introduction
Three-dimensional models are widely used in games, industrial design, and film production. The emerging demands for 3D models makes it important to develop a friendly modeling tool to create a large amount of materials. In this work, we aim to design a modeling application which can be easily used by non-professional user to express their creativity. The 3D modeling process can be divided into the following categories: parametric modeling, non-uniform rational B spline (NURBS) modeling, polygonal modeling, polygonal sculpting, and volumetric sculpting. Parametric modeling, NURBS modeling, and polygonal modeling methods require highly professional ability to create models and are not friendly for beginners. Sculpting based methods provide a more intuitive model editing process which allows the user to draw a model based on the shape of the brush without knowing the basis of the model (i.e., the vertices, edges, and triangles). This work targets at developing a modeling software which can be intuitively used in real-time applications, and therefore we choose to use the modeling method based on volumetric sculpting. We investigate the problems of volumetric sculpting method and propose the corresponding solutions.
For traditional modeling software, the user edits the model through the 2D screen, keyboard, and mouse. It is difficult to control the brush in a 3D virtual space through the 2D screen. The user needs to constantly change his/her view to edit various areas of the model, which makes it difficult for beginners to create even a simple prototype of 3D model. With the rise of virtual reality (VR), there are many applications proposed for artistic creation in a virtual space [1]–[7]. These VR applications allow the user to directly “draw” 3D content in the 3D environment. The success and rapid popularity of Oculus Medium [6] and Kodon [7] prove that 3D modeling based on the volumetric method is efficient enough for VR interaction, and the flexibility of editing allows the user to freely draw in any area in the 3D space. Moreover, the VR environment is suitable for multi-person cooperation and we have developed a collaborative VR sculpting prototype based on conventional scalar field based method [8]. Users enjoy co-creating with others in the VR environment; however, we encountered the problem of large memory usage when drawing a large scale model. In this work, we propose a memory efficient method for real-time sculpting, which allows the user to create larger-scale models.
The flexibility of editing is an attractive feature to general user. Also aiming at allowing flexible editing, Minecraft [9] uses low-resolution blocks and various materials to enable the user to construct the scene easily with the charming of voxels. ASTRONEER [10] uses simple intuitive editing operations to achieve highly destructible terrain, which shows the potential of volumetric based applications. In this work, in addition to developing a sculpting application, we also hope that the created content can be exported and imported to another application for further usage, such as being taken as part of destructible objects in another game to interact with the player. Therefore, we have to consider the compatibility to make the system easy to be integrated with the existing game engines (e.g., Unity 3D [11] and Unreal Engine 4 [12]).
In this work, we develop a volumetric based real-time VR sculpting and terrain generation system, which allows the user to flexibly edit the 3D content. The main contributions of our system are summarized as follows:
We propose a memory efficient data structure for volumetric sculpting based on the concept of layered depth-normal images (LDNIs) [13].
Based on the proposed data structure, We design commonly used sculpting tools including drawing, erasing, smoothing, and deformation.
A seamless multi-resolution mechanism is proposed to efficiently represent models with different resolutions.
A GPU-aided implementation pipeline is introduced for real-time volumetric sculpting. The overall pipeline of the proposed method is shown in Fig. 1.
The overall pipeline of the proposed rel-time volumetric sculpting method. When the user manipulates the model, the system first edits the stored data according to the drawing instruction. Then the voxel information is extracted from the data and a multi-resolution mechanism is applied in order to extract seamless triangle mesh. After obtaining the vertices and triangles, the normal vector of each vertex is calculated and then used for rendering the model. The steps in the left red box are computed on CPU and the steps in the right red box can be computed on CPU or on GPU.
The rest of this manuscript is organized as follows. We first review the related researches in Section II. The proposed data structure is introduced in Section III. The details of model manipulation and mesh extraction methods are described in Section IV, Section V, and SectionVI. The implementation details and the experimental results are discussed in Section VII and Section VIII, followed by the conclusion and future work in Section IX.
Related Work
The 3D modeling process can be divided into the following categories: parametric modeling, non-uniform rational B spline (NURBS) modeling, polygonal modeling, polygonal sculpting, and volumetric sculpting. We first introduce commonly used modeling methods and software.
Parametric modeling method is commonly used in computer-aided design (CAD) software such as SOLIDWORKS [14] and Autodesk Inventor [15]. A 3D model is generated according to the parameters set by the user (e.g., the thickness or radius), and these parameters strictly restrict the appearance of the model. Since each instruction/operation is affected by the previous ones, the parametric design requires careful planning and highly professional ability. The advantage of parametric modeling is that the intermediate instructions/operations can be easily reused and composed to create similar models through simple parameter adjustment.
NURBS modeling method [16] uses mathematical formulas to accurately represent the geometry of objects, and it is suitable for modeling curved objects. NURBS modeling software (e.g., Rhino [17]) is often used in industries that require high surface quality of the designed model, such as automobiles and aerospace.
Polygonal modeling method [18] directly operates on the vertices of the mesh. Famous 3D modeling software such as Maya [19] and Cinema 4d [20] use this kind of modeling technique. Compared with parametric modeling and NURBS modeling methods, directly operating on the model provides a more intuitive editing way for the user. Since all objects in polygonal modeling are composed of polygons (e.g., triangles or quadrilaterals), there is no real sphere or arc, which needs to be approximated by multiple continuous polygons. Although the surface of the model is not as smooth as that in parametric modeling or NURBS modeling, polygonal modeling is more efficient in terms of rendering. The polygonal models are mostly used in the industry of movies, animations, and games.
Sculpting based modeling methods provide a more intuitive model editing process than polygonal modeling. The user can draw a model based on the shape of the brush without knowing the basis of the model (i.e., the vertices, edges, and triangles). The sculpting based modeling methods can be classified into polygonal sculpting and volumetric sculpting. In a polygonal sculpting software (e.g., Zbrush [21]), the user directly operates on the vertices and surfaces of the model. For example, the user can edit the model by moving the positions of the vertices, adding new vertices, or deleting existing vertices. The advantage of directly operating on the model is that the user can build a precise model by assigning the vertices to specific positions. However, it is more complicated to calculate the new topology after adding/deleting a vertex. The user needs to plan ahead with the base mesh. Moreover, the user cannot extrude endlessly or hollow out the mesh. Therefore, polygonal sculpting is more suitable for hard bodied surfaces, like armour and buildings. In a volumetric sculpting software (e.g., 3D-Coat [22]), the system divides the space into voxel grids and then stores the model data in these small grids like pixels in the image. The user operates on the implicit data (e.g., the scalar field) instead of the mesh, and the system directly renders based on the implicit data or extracts the mesh by a specific method (e.g., Marching Cubes [23]) first for rendering. Because each voxel is independent and does not interfere with each other, volumetric sculpting is more flexible than polygonal sculpting. For volumetric sculpting, the current state of the model does not affect the following editing process. Moreover, it is easy to merge different objects for the user. However, the fineness of the model is limited by the resolution of voxel. Volumetric sculpting is suitable for creating quick concept or organic stuff, which does not require sharp features. Since our target is to develop a modeling software which can be intuitively used in real-time application, we choose to use the volumetric sculpting based method, investigate the problems of this modeling method, and propose the corresponding solutions.
In addition to develop a sculpting application, we also aim at allowing the user to intuitively create interactive objects (especially terrain) for game development. Here, we introduce commonly used approaches of terrain generation. According to the requirement of different applications, terrain generation can be implemented with different approaches. Due to the characteristic of the terrain, two-dimensional heightfield is the most common data structure used for storing and rendering. Two-dimensional heightfield is suitable for real-time editing and rendering of large-scale terrain because we only store and operate on 2D data. Moreover, the topology of the grids is fixed, which means the results can be calculated quickly with efficient memory usage. This technique is adopted by the terrain system in popular game engines such as Unreal Engine 4 and Unity 3D. However, the heightfield cannot represent terrain structures with multiple vertical layers such as overhanging cliffs, caves, or arches. Feature-based methods are commonly used in the application of rapidly automatic procedural generation of large-scale terrain. The system automatically generates terrain according to rough user input such as simple outlines of the terrain, material type of the specified terrain [24], [25], or other external forces such as the extrusion of plates [26]. It would be useful for game developer to create terrain in the developing stage, but the player cannot modify the details of the terrain while playing. Compared with heightfield and feature based methods that are suitable for editing terrain in the game developing stage, volumetric methods have the advantage of allowing players to edit the terrain during the playing stage.
The concept of volumetric sculpting was first introduced by Galyean et al. [27]. The 3D space is divided into voxel grids, each voxel is marked as inside or outside the solid region, and then Marching Cubes algorithm is used to extract the isosurface based on the state of the cell (eight neighboring voxels construct a 3D cell). Each vertex of the mesh is located at the midpoint of one cell edge. With the advancement of computing power, many volumetric sculpting methods based on scalar field have been proposed [28]–[30]. The value of the scalar field represents the distance from voxel to the surface of the solid region (A positive value indicates that a sample lies in the empty space, and a negative value indicates that a sample lies in the solid space). We can use these values to extract more precise vertex positions and keep more details. However, a critical problem of the scalar field methods is the inefficiency of memory usage. Therefore, researchers are committed to exploring a method that can effectively save memory and simultaneously achieve acceptable data access time. Since the values of the scalar field are important only around the surface of the model, we can store only the narrow-band data (also known as truncated signed distance field (TSDF)). For example, we only store the value between −1 and 1. The voxel values outside the model and far from the surface are all set to 1, while the values inside the model and far from the surface are all set to -1. In most cases, if the model is not too broken, the scalar field values of -1 (as well as 1) appear continuously as a cluster in the voxel space, and therefore the model representation can be compressed by different methods such as octree [31], hierarchical run-length encoding [32], and dynamic tubular grids [33]. However, these methods would have additional computation burden of decompressing data if the user want to access or modify the model. Another way is to only store the voxel chunks around the surface without compression. With the spatial hashing technique [34], [35], we can store data densely, which is beneficial for streaming between CPU and GPU. However, the size of a voxel chunk is fixed and part of the memory space is not used, resulting in more memory waste than just storing the narrow-band data. Volumetric Dynamic B+ tree (VDB) [36] provides dynamic scalar field data compression and access functions. The B+ Tree based structure can support constant-time random access operations like lookup, insertion, and deletion. The overall goal of VDB is to consume only as much memory as is required to represent active voxels, that is, only narrow-band data are stored. In Section VIII, we will show that the memory usage for storing narrow-band data is still about twice than our method. With the rise of deep learning techniques, there have been many works compressing the volumetric data through neural networks [37], [38], and these methods can achieve high compression rate. However, these methods are lossy compression methods, and the reconstructed results would contain noises. In addition, the computation process of neural network inference is time consuming and not suitable for the real-time sculpting application.
A volumetric based terrain generation method named Transvoxel was introduced in [39], which provides the theoretical basis and implementation details of a complete and practical real-time voxel-based terrain rendering system. Well-known modeling tools such as Oculus Medium and Voxel Plugin [40] for Unreal Engine 4 are developed based on this method. They use three-dimensional scalar field to store the volumetric information, and Marching Cubes algorithm is applied to extract the isosurface. In order to develop the LOD system, they introduce an algorithm named Transition Cells [41] to patch the seams, cracks, and holes between chunks of different resolutions by inserting an additional spatial structure. They further introduced methods for applying texture maps and advanced shading techniques to voxel-based terrain meshes. In this work, to significantly reduce the memory usage, our data structure is designed based on the concept of LDNIs instead of using the scalar field data. Moreover, we propose a new method of the multi-resolution mechanism, which does not require inserting additional structures between chunks and can be easily applied to achieve the LOD system.
LDNIs is a modeling method proposed for Computer aided design (CAD). Compared with scalar field which stores 3D voxel data, the LDNIs method stores the intersection points and normal vectors of the model in images which are orthogonal in three-axis. The number of images required for each axis is the maximum number of intersections between the grid lines in that direction and the model. This method can be beneficial for storing data in GPU memory. Since there are not too many intersections between a grid line and the model in general, the required memory can be reduced greatly. In order to keep sharp features, the LDNIs method adopts Dual Contouring algorithm [42] to extract the isosurface of the model. The required input data of Dual Contouring algorithm are the intersection positions and the normal vectors of the model and the grids, which are exactly the values stored in LDNIs. Based on the data structure used in LDNIs, commonly used operations in CAD (e.g., boolean operations and offsetting) have been implemented. Moreover, boolean operations between complex static models can be computed efficiently base on GPU. Inspired by LDNIs, in this work we store the model by the intersections and the normal vectors, which represent the model with less memory compared to scalar field data. We further propose a suitable data structure, several editing tools, and a multi-resolution mechanism to improve the real-time sculpting performance.
Data Structure
A two-dimensional example of a model intersecting with the grid lines in the
Two-dimensional example of the proposed data structure in the
Illustration of the difference between the proposed representation and the LDNIs representation.(a) A sphere model. (b) For our proposed representation, each white line indicates a grid line in the
For each axis, we store segments on a grid line as a list (as shown in Fig. 2). Each segment represents a solid region on the grid line and consists of two points. These two points represent the start and end of the segment, which are the intersections of the model and the grid lines. The normal vectors of the surface at the intersections can be also stored in the list to extract the isosurface. It is worth noting that points on the same grid line have the same two coordinate values (e.g., the same x and y), and therefore we only need to store the value in the rest direction (e.g., the z value). Segments in a list are sorted according to the stored values. As illustrated in Fig. 2, we can observe that for a manifold model, the number of intersections between the model and each grid line should be even, and each intersection pair represents the two endpoints of a solid section. Therefore, we can use a set of segments
Shown in (a) into the proposed representation and LDNIs in the
Model Manipulation
In this section, we first introduce how to perform drawing and erasing mesh based on the segment list data representation (Section IV-A) and show how to edit data with different shapes of brushes (Section IV-B). Section IV-C describes the implementation details of some special tools (e.g., smoothing and deformation) developed based on the proposed data structure. We also implement the color and material system based on the proposed method (Section IV-D).
A. Segment Manipulation
Updating the segment set
Algorithm 1 Segment Manipulation
while
end
if
Insert
end
while
Remove the value at
end
if
Insert
end
B. Drawing With Brush
The manifold model can be represented by a segment set, and the result of performing constructive solid geometry (CSG) operation based on two manifold is also a manifold. Any manifold model can be taken as a brush, and CSG operation can be performed directly on the segment-based data. For each CSG operation, the brush model is converted into a segment set
(a) A brush (indicated by a blue circle) is used to edit an existing model. (b) The result of drawing. (c) The result of erasing.
C. Special Tools
Brushes with some special functions are commonly used in digital content creation, such as deformation and smoothing. In order to implement these functions based on the proposed data structure, all operations must be manifold. First, we introduce how to perform smoothing. For each endpoint of the segments inside the brush, we extract the voxel state set \begin{equation*} p_{s}=\frac {(n_{l}+n_{r}+n_{f}+n_{b})}{4} \times w + p \times (1-w).\tag{1}\end{equation*}
The process of the smoothing operation. (a) We use dark gray points to represent the voxels inside the solid area. Red points and lines indicate the segments. Edges
The smoothing strength value
(a) The model before smoothing operation. (b) The model after smoothing operation. (c) The model before deformation operation. (d) The model after deformation operation.
Deformation operations such as extruding or squeezing are more difficult to be converted to manifold operations directly based on the proposed data structure, but we can achieve that in a more intuitive way described as follows. After applying isosurface extraction algorithm introduced in Section V, we can obtain the triangle mesh inside the brush and directly move the vertices. The resulting segment data can be obtained by calculating the intersections of the deformed mesh and the grid lines. Note that in order to prevent self-intersecting of the mesh, we constrain the step size of each vertex displacement to 0.3. Fig. 6(c) and (d) show example results of deformation.
D. Drawing Material
As shown in Fig. 7(b), the proposed data structure is sparse. If we only store the material information along with the vertex information, it would not be able to express the material inside the model. For example, when the materials are different at the start and end points of a segment, we do not know the boundary of the two materials. To solve this problem, we store material information in the same way as the volumetric information. Unlike the volumetric segments which need to be stored in three directions, the material segments can be stored in only one direction because there is only one material value for each cell. Each material segment represents a sequence of consecutive voxels with same material. Based on the above design, the user can modify the material or the model individually when drawing. To achieve terrain texture mapping, we adopt the triplanar projection algorithm [43] to obtain the uv value of each vertex from the position and normal value. The user can use multiple materials for one chunk, and the color of adjacent vertices with different materials is interpolated accordingly.
Two-dimensional examples of a manifold model described by (a) the scalar field based method and (b) the proposed method. We use points with different colors to represent different signed distance function values in the scalar field based method (from red to blue indicate −1 to 1). For the proposed method, red points indicate the endpoints of segments in x direction and yellow points indicate the endpoints of segments in y direction. The blue lines indicate the region covered by the segments.
Isosurface Extraction
Extracting the isosurface of the model is important for applications such as path generation of computer numerical control (CNC) tool, physical interaction, and parting line generation of mold design. With the ability of extracting isosurface of the model according to the user’s modification in real-time, our system can be widely used in general game engines. Well-known volumetric isosurface extraction algorithms such as Marching Cubes, Surface Nets [44], Dual Contouring, and Dual Marching Cubes [45] can be applied to our system. In this section, we introduce how to extract the surface of the model through Marching Cubes and Dual Contouring algorithm based on the proposed data structure and the comparison of the meshes extracted from Marching Cubes and Dual Contouring algorithm is shown in Fig. 8.
The comparison of the meshes extracted from (a) Marching Cubes and (b) Dual Contouring algorithm.
Marching Cubes algorithm is usually used to extract surfaces from scalar field data. A positive value in scalar field indicates that a sample lies in the empty space, and a negative value indicates that a sample lies in the solid space. Therefore, the voxel state set
Unlike the Marching Cube algorithm, the vertices extracted by Dual Contouring algorithm can be anywhere in the cell, so the extracted mesh can present sharp features. For applications requiring accurate model details (e.g., CAD, sculpting), we can extract the isosurface by applying Dual Contouring algorithm. Dual Contouring method requires Hermite data, which are the intersection points between the model and the grids and the normal vectors at intersection points. When a cell has any edge that intersects the model (i.e., the distance function value is zero), it implies there is a vertex in the cell. The vertex position in the cell is obtained by minimizing the error function defined based on all the intersections and the normal vectors in that cell [42]. However, the optimization process is time-consuming, which limits the amount of edited content for CPU-based calculation. Since the vertex in each voxel can be calculated independently, we further design a GPU-aided pipeline as shown in Fig. 1 to enable the user to edit a large region of the model.
We first extract the voxel information of the region that is going to be updated, including whether the voxels are inside the model, the intersections on the cell edges, and the normal vectors. These data are then transferred to GPU memory to calculate the vertex in each cell. Since the triangle information can be extracted without knowing the vertices, we use CPU for triangle extraction and connecting chunks with different resolution levels. After extracting the triangle information, we transfer these data to GPU memory and combine the vertex information into complete mesh. Before rendering, we smooth the normal vector based on the angle between adjacent triangles. Given a triangle
Multi-Resolution
Since volumetric isosurface extraction algorithms tend to produce a large number of vertices, multi-resolution mechanism is important to improve rendering performance. We can use fewer vertices to represent flat areas and more vertices to represent details. This could also help us to build the LOD system, which is commonly used in games to improve rendering performance. We divide the 3D space into chunks (a group of cells), each chunk can be edited independently and has its own resolution level. However, there will be gaps between two chunks of different resolutions when using Marching Cubes algorithm to extract mesh. In this section, we introduce how to increase and decrease the resolution based on the proposed data structure and patch the gaps between two chunks without adding any other spatial structure.
A. Increasing Resolution Level
In order to align the voxel data of chunks with different resolution levels, we half the unit size of the chunk to increase the resolution level of the target chunk, and it consequently increases the number of the segment lists. In an intuitive way, we can obtain the high-resolution information of the segment lists by calculating the intersections of these newly added grid lines and the current model. However, as shown in Fig. 9, for each direction there are three new segment lists per unit cell and two of them locate on the boundary of the cell. According to Marching Cubes algorithm, the edges of triangle also lie on the boundary of the cell. The floating-point error occurs when calculating whether the triangles and the new grid lines intersect with each other. In practice, a more robust, faster and parallel-friendly method is used in our work. We extract the voxel state set
The newly added grid lines (indicated by red lines) in a unit cell. Note that two grid lines (indicated by dotted lines) have already been created by the adjacent cell.
A look-up table for extracting high-resolution information. The blue line indicates an edge of the original triangle and the dark gray point indicates the voxel inside the model. Images in the
B. Decreasing Resolution Level
The proposed data structure stores the intersections of the model and the grids. Resolution level only affects how many points to be stored but does not affect the location of these points. Therefore, we can directly discard the high-resolution data when decreasing the resolution of the stored data. The remaining low-resolution segment lists can still form a manifold model. In the LOD system that maintains the high-resolution data, the low-resolution mesh can be extracted from the low-resolution part of the high-resolution segment lists without decreasing the resolution level of the stored data. Conventional scalar field based method has surface shifting problem [39] when triangulating the low-resolution mesh. We need to examine the values at the high-resolution part to construct the low-resolution mesh. Then the low-resolution scalar field values can be directly obtained based on the constructed mesh. In contrast, the proposed data structure only needs to sample the segment lists according to the resolution level, which allows us to build a LOD system in an efficient way. Fig. 11 shows the isosurface extracted from different resolution levels.
(a) The red points and lines indicate the segments on the low-resolution grids, and the yellow points and lines indicate the segments on the extra high-resolution grids. (b) The high-resolution mesh is constructed by the red and yellow points. (c) The low-resolution mesh can be extracted from the low-resolution segment information.
C. Connecting Chunks
As shown in Fig. 12(a), there are gaps between adjacent chunks of different resolution levels when using Marching Cubes algorithm to extract isosurface. Additional mechanisms must be used to patch these gap areas. Fig. 13(a) shows the segment lists on the connecting face, Fig. 13(b) shows the low-resolution information extracted from these segment lists, and Fig. 13(c) shows the high-resolution information extracted from the same segment lists. It can be observed that the high-resolution chunk keeps more details in the extra voxels than the low-resolution chunk, which would produce different meshes and result in gaps. Therefore, we adjust the extra voxels in the high-resolution chunk to produce the same result as the low-resolution chunk on the connecting face, as shown in Fig. 13(d). We change the voxel state of
(a) The gap between adjacent chunks of different resolution levels when Marching Cubes algorithm is applied to extract the isosurface. (b) The result of applying the proposed patching method.
(a) The segment lists on the connecting face of two chunks with different resolution levels. (b) The low-resolution information extracted from these segment lists. (c) The high-resolution information extracted from the same segment lists. (d) The extra voxels in the high-resolution chunk is adjusted to produce the same result as the low-resolution chunk in (b). We change the voxel state of
Dual Contouring method naturally supports multi-resolution connection. However, unlike Marching Cubes that generates triangles in each cell independently, the vertices extracted by Dual Contouring are connected to the surrounding cells and the extracted surface of a chunk is related to 27 neighboring chunks (
Two-dimensional example of referenced regions when Dual Contouring algorithm is applied to extract the isosurface. The yellow square shows that if we use a chunk as the center, 8 neighboring chunks are referenced to extract the isosurface. The red square shows that if we use the corner of a chunk as the center, only 4 neighboring chunks are referenced to extract the isosurface.
Implementation and Application
In order to validate whether the proposed data structure can be widely used, we implemented a VR sculpting and terrain generation application with the Unity 3D Engine. The main algorithm is written in C# language, and HTC VIVE is used to build the VR environment. GPU computing and rendering are respectively implemented in the compute shader and surface shader in Unity 3D.
It is not practical to update the entire mesh map every frame. We divide the space into cell chunks, and each cell chunk is composed of
A 2D example of the voxel and segment maps with chunk width
Note that the voxel information is extracted from the corresponding segment list only when the user modifies the voxels in that chunk. When the user edits the model, the system first modifies the corresponding data in the segment list chunks and then extracts the volumetric information of the edited chunks (inside the brush range). Isosurface extraction algorithm is applied to extract the triangular surface for rendering. Since the voxel information is required only when updating the mesh of the chunk, the memory used for storing the voxel information can be reused for every chunk. For each chunk, we store the extracted triangles, vertices and smoothed normal vectors in the GPU memory for rendering.
Fig. 16 shows some screenshots of the proposed VR sculpting system and Fig. 18(a) shows how the user draws with the HTC VIVE. Through an interface similar to commonly used 2D drawing software, the user can create 3D models in 3D environment based on our VR sculpting system. In addition to the drawing and erasing functions for model editing, we also develop many auxiliary tools for the user, such as line tool, alignment tool, layers, undo/redo, model data conversion (converting general model representations into volumetric representation), multi-player mode, saving/reading files, and particle system. These tools are placed on a palette-like user interface attached to the left-hand controller, and the user uses the right-hand controller to choose the tool and edit the 3D model. We also implement shortcut keys on the right-hand controller so that the user can quickly switch to different tools. Moreover, the user can press the buttons on the left-hand controller to move, rotate, and zoom the models in the selected drawing layer. As shown in Fig. 17, the proposed VR sculpting system can be easily used to create an interactive terrain for a game. The produced terrain has the editable characteristics benefiting from the proposed data structure. Moreover, it can be collided with the physics engine in the game engine since we also extract the mesh of the created models. Players can change the terrain through intuitive actions such as launching bombs.
(a) The user interface of our VR sculpting application. The user can adjust the parameters of the brush through the VR controllers. (b) The user uses the sphere brush to draw the tail of the cat model. (c) The user uses the smoothing tool to smooth the mesh. (d) The user uses the painting tool to edit the color of the mesh.
(a) The user draws the terrain roughly with the cube brush. (b) The user adjusts the detail of the shape and the materials of the terrain model. (c) The created terrain can be exported for game development. (d) The player launches bombs to destroy the terrain, which can be considered as using the erasing tool.
(a) The position and rotation of the HTC VIVE controllers and head-mounted display are tracked by the lighthouse. The user can use the controllers to draw and edit the model from different views. (b) The experimental environment for the comparison of computing time and memory usage. We executed random drawing/erasing instructions in the VR environment.
Experimental Results
We developed the system on a PC with memory size 16GB, Intel i5-9400F CPU, and Nvidia GeForce GTX 1660 GPU. In order to investigate whether the proposed data structure is suitable for real-time sculpting, we compare the memory usage and calculation speed with the scalar field based method. The scalar field and the proposed data structure are both stored in floating-point type. No special tricks are used to speed up. We drew on a canvas with the size of
Compared with conventional scalar field based methods, our method mainly differs in two aspects: (1) the way of editing and storing the volumetric information and (2) the method of extracting the point set
Table 2 shows the overall calculation time of our method based on different brush size, different isosurface extraction algorithms, and different hardware. The time involves editing the volumetric data, extracting the isosurface, rendering the model, and storing the extracted mesh in each frame. Since the overall process includes both CPU and GPU calculations, it is difficult for us to accurately calculate the calculation time of the proposed algorithm. Therefore, we compare the frame update speed of the entire system. Since the default maximum frame rate in Unity 3D for VR rendering is 90 FPS (11.17ms), the update time would be 11.17ms even though the computation speed is faster. In general situations, the brush with radius of 5 to 10 is sufficient for the user. For editing with much larger brush size, we can use an additional multi-thread mechanism to allow the user to draw a wide range solid region. Another way to enable real-time editing with large brush size is to avoid extracting triangles every frame. Editing the segment data can be calculated very quickly, but extracting triangles takes most of the time. Hence, we can update the model with an appropriate time interval to achieve real-time large-scale editing experience.
For the conventional scalar field based method, we store the spatial information in 3D dense voxels. Although the chunks can be dynamically allocated in the solid area, the memory size used by each voxel chunk is fixed. When the values of the signed distance function are restricted from
We use the conventional scalar field method, the narrow-band based method, and the proposed data structure to represent two models, i.e., a Deer model with simpler structure and a Coral model with more complex structures as shown in Fig. 19. Table 3 shows the memory size used for representing each model with different resolutions. Since each grid line would not has too many intersections with the Deer model, it requires less memory usage than the Coral model. Fig. 20(a) to (c) show a portion of the Deer model (the portion inside the red box in Fig. 19(a)) reconstructed in different resolutions. We further compare the maximum memory usage during the drawing process with the scalar field based method. The memory usage of each method is shown in Table 4. Note that we only calculate the memory usage of the endpoints for the proposed method and the values of the signed distance function for the scalar field based methods, respectively. For the scalar field based method, the amount of memory used by each chunk is fixed regardless of the model. We list the memory usage of the narrow-band based method with the bandwidth
(a) A Deer model with simpler structure. (b) A Coral model with more complex structure.
A portion of the Deer model (indicated as red box in Fig. 19(a)) reconstructed in the resolution level of (a) 256, (b) 512, and (c) 1024.
Conclusion and Future Work
In this work, we develop a volumetric based real-time VR sculpting system, which allows the user to flexibly edit the 3D content in the 3D environment. The proposed system has high interactivity because the extracted triangle mesh is friendly for physical interaction calculations. It is also suitable for generating terrain and creating destructible objects in game developing. A new data structure is designed based on the concept of LDNIs to reduce memory usage when generating the mesh in a volumetric way. We also introduce a seamless multi-resolution mechanism, which can also achieve the LOD system of terrain rendering. We demonstrate that any manifold model can be easily used as a brush to perform drawing and erasing. However, the proposed method has the following limitations.
For the narrow-band scalar field based methods, the value stored in each voxel usually ranges from
to-b (b would not be too large), while the value of the segment endpoint is the position of a vertex in a specific direction, which would be relatively large and is prone to floating-point error. Since the precision of a floating-point number is only 6 digits, in practice the data value (including intermediate data in the whole calculation process) is limited to the range from 2−8 to 28. Therefore, if we would like to draw on a large-scale canvas, we need to split the canvas first and use an independent data system with its own coordinates for each sub-canvas.b Each editing operation in our system should be manifold; otherwise there would be a problem of vertex missing. For an editing operation that does not directly use a manifold brush, we have to design an additional mechanism to convert it to a manifold operation. For example, to deal with deformation-like operations such as moving, squeezing, and extruding, we directly operate on the vertices of the triangle mesh and then calculate the intersections with the grids. In the worst case, if there is an operation that cannot be converted to a manifold operation, we can still convert the segment data to scalar field data and process the operation by using conventional methods. The segment data can be then obtained from the mesh reconstructed based on the resulting scalar field.
Bolier et al. [46] have shown that drawing in the VR space can improve the spatial ability and mental rotation ability of students. However, they draw in the 3D space with 2D brushes just like A-Painter [47] and Tilt Brush. We have done simple user tests on 36 junior high school students and all of them prefer to use 3D brushes than 2D brushes. They also like to draw with their friends in the same virtual environment which can improve the cooperation ability. With the multi-player mode provided by our system, they can draw together even if they are in different physical spaces. Since the proposed method is fast and has high memory efficiency, it has lower hardware requirements and can be more easily promoted to art courses in school. In the future, we are going to investigate whether drawing with 3D brush can be beneficial to improve the spatial ability and mental rotation ability of the students. We will also optimize the user interface to make our system suitable for students, and design a teaching system for art teachers.