Professional Documents
Culture Documents
Tiling
Adrien Peytavie, Eric Galin, Jérôme Grosjean, Stéphane Mérillou
1 LIRIS - CNRS - Universitï¿ 21 Claude Bernard Lyon 1, France 2 LIRIS - CNRS - Universitï¿ 21 Lumiï¿ 12 re Lyon 2, France
3 LSIIT - CNRS - Universitï¿ 21 Louis Pasteur Strasbourg, France 4 XLIM - CNRS - Universitï¿ 12 de Limoges, France
Abstract
In this paper, we present a tiling method for generating piles of rocks without any computationally demanding
physically-based simulation. Previous techniques rely on a periodic tiling of rocks and generate unrealistic repet-
itive patterns. In contrast, our approach relies on a modified corner cube algorithm to generate a set of aperiodic
tiles. We generalize the construction method so that the geometry of rocks should straddle corner cubes with a view
to avoiding unrealistic gaps in the arrangement of rocks. Moreover, we propose an original technique to control
the shape of rocks into contact by computing the Voronoï cells using a parameterized anisotropic distance. Our
method has been successfully used to generate landscapes and stone huts and walls with thousands of rocks piled
together.
Categories and Subject Descriptors (according to ACM CCS): [Computer Graphics]: Three-Dimensional Graphics
and Realism
Keywords: Procedural modeling, natural phenomena, aperiodic tiling.
1. Introduction
Figure 2: Synthetic overview of the rock generation process, the bunny model is used as the support object
tion [KMN88, NWD05, MDH07] and terrain synthesis from 1.2. Contributions
images or sample terrain patches [ZSTR07]. While those In this paper, we present an original aperiodic tiling scheme
techniques are efficient for creating large scale terrains, for generating rocks into contact based on a modified corner
they do not generate the geometry of rocks and rely on cube [LD06a] generation algorithm. Our method proceeds in
procedural texturing methods or displacement maps to two steps (Figure 2). First, we generate a set of aperiodic
render rocks. tiles of rocks while guaranteeing contact between neighbor-
ing rocks. This step is performed once and for all as a pre
Rock generation In general, a few rocks models are cre-
processing step. Rock piles are then generated by virtually
ated by artists and located in the scene by hand, which is
tiling space with the precomputed set of aperiodic tiles and
impractical for generating thousands of rocks. Relying on
instancing only those rocks that intersect a support object.
only a few instances produces unrealistic replication arti-
facts. While collision detection techniques can be used to We present an original method for controlling the shape
create piles of rocks, this approach is computationally de- of rocks by computing the Voronoï cells generated by a set
manding and difficult to control. of seed points using a class of anisotropic distance function.
Our technique enables us to generate different kinds of mod-
[MIS01] proposed a texture based tiling method com-
els, including flat sharp edged rock or smooth and round peb-
bined with a bump mapping scheme to create stones paving
bles.
a path. The method creates stones by a displacing a two-
dimensional map and can’t create rock piles. The remainder of this paper is organized as follows. Sec-
tion 2 presents an overview of our aperiodic tiling gener-
[Miy90] proposed a procedural model for generating
ation algorithm and notations. Sections 3, 4 and 5 describe
stone walls. [LDG01] presented a general cellular pattern
the computation of the set of aperiodic tiles, the computation
based technique for generating stone walls according to the
of the bounding volumes of rocks and the erosion process
architectural settings and the geometric features of the un-
used to compute the final rock shapes. Section 6 presents
derlying shape. This method tends to generate regular pat-
how rocks piles are created from a support shape. Section 7
terns on surfaces suited for architectural models, whereas
presents some results before we finally conclude this work.
we focus on aperiodic volumetric distributions for natural
sceneries.
2. Overview and notations
Aperiodic tiling Several two-dimensional aperiodic tiling In this section, we present an overview of our method for
techniques [CSHD03, BPB09, SKP05] have been proposed generating a set of aperiodic tiles of rocks into contact.
to distribute natural objects such as trees over the surface of
a terrain in a natural way with a view to avoiding repetitive Periodic tiling Let us recall the fundamentals of the peri-
patterns. Wang cubes [LEQ∗ 07] have been successfully used odic algorithm presented in [PGMG09]. First, a set of points
for volume illustration applications. Poisson sphere distribu- pk is distributed inside a cubic tile C. By considering that the
tions [LD06a] based on a three-dimensional aperiodic tiling cube C virtually tiles space, it is possible to construct closed
of points have been successfully used to locate instances of Voronoï cells, denoted as Vk for every point pk . The result-
objects in space. The main limitation of those techniques is ing set of cells Vk periodically tiles space. The Voronoï cells
that instances are separated by a minimum distance and can’t give a good approximation of convex rock shapes into con-
be into contact. tact. The final geometry of the rocks is created by eroding the
Recently, [PGMG09] proposed an original tiling tech- surface of Voronoï cells almost everywhere but at some ran-
nique for generating rock piles from a material layer rep- dom contact points located on the faces so that rocks should
resentation of terrains. The proposed method has two major nicely pack together.
weaknesses however. The periodic tiling scheme produces An important limitation of this approach is that unnatural
unrealistic patterns, and there is no control over the shape of repetitive patterns appear, the more so as the ground surface
rocks that are generated. is smooth as illustrated in Figure 3.
A. Peytavie, E. Galin, J. Grosjean, S. Merillou. / Procedural Generation of Rock Piles using Aperiodic Tiling
Figure 3: Unrealistic patterns with periodic tiling Figure 5: Aperiodic tiling avoids visible artifacts
RRBR BRBR
8 75 195 97 18
12
T T
33 p p
k k
26 235 129 192 72 V V’
k k
Figure 4: A number of different corner cubes from a com- Figure 6: Two different rock volumes Vk and Vk0 can be
plete set of 256 configurations, and a tiling generated from generated for a single seed point pk but with different com-
the set of corner cubes patible corner cubes
2. Create a rock volume Vk for every seed point pk by com- Creation of seed points During the generation of the 256
puting the Voronoï cells from the set of vertices pk using corner cubes, we create the random distribution of seed
an anisotropic distance function. points pk in the different cells Ci jk of the neighboring re-
3. Generate an implicit representation of the rocks by gions. One or more seed points may be created in the cells.
eroding the Voronoï cells Vk using spheroidal ero- Let s denote the maximum number of seed points per cell
sion [BFO∗ 07]. and let nk denote the number of seed points in a cell. Seed
4. Finally, create the mesh representation by polygonizing points pk are created using a low discrepancy sequence in
the implicit surface model of the different rocks. every cell. As we will see in the next section, the parameter
nk defines the relative density of seed points within a cell,
thus the relative size of the Voronoï volumes Vk .
3. Corner cube grid generation
In this section, we present the corner cube grid generation Vertex neighboring region R Vertex neighboring region B
process. Without loss of generality, we assume corners have
2 colors, thus we aim at generating a set of 256 cubic tiles.
Face cell
Edge region Copy of seed points in the RB edge neighboring region
Corner cube
face and center regions. The set of corner cube tiles has a
consistent distribution of seed points that guarantee that the
rock volumes Vk will perfectly match, even when straddling
the borders of the cubes.
inverse of the minimum distance between all seed points pk . Note that it is possible to randomly discard a few contact
points so as to create more space between rocks. However
this may results in some floating rocks. In our system, we
Let Gi jk denote a voxel of this grid and vi jk denote the cen-
keep all the contact points between rock volumes so as to
ter of the voxel. For every voxel, we first compute a unique
obtain visually plausible stable configurations.
identifier that stores the index k of its corresponding seed
point pk (Figure 14). This step is efficiently performed by
Generation of the erosion damping field The rocks are
evaluating the minimum distance between the center of the
generated by eroding the rock volumes Vk while preserv-
voxel and the seed points dk (vi jk ). This discrete representa-
ing the contact points between those volumes. Thus, ero-
tion will enable us to perform the erosion of the rock vol-
sion must be dampened in the neighborhood of the con-
umes to generate the final rocks shapes into contact.
tact points (Figure 16). For every contact point ci j , we de-
fine the compactly supported damping function ωi j (p) as a
5. The erosion process piecewise linear function of the distance to the contact point,
ωi j (p) = ωi j (r) with r = kp − ci j k and:
The rock volume generation process provides us with a voxel
based representation of the rock volumes Vk . The erosion
step aims at carving and sculpting the rock shapes out of 0 if r < a
ωi j (r) = (r − a)/(b − a) if a ≤ r < b
those coarse volumes while maintaining contact points be-
1 otherwise
tween the final rock shapes with a view to generating con-
vincing rock piles. The parameter a defines the contact radius of the spherical
region where no erosion occurs. This parameter enables us
to control the size of the contact surfaces between rocks. The
parameter b controls the size of the blending region between
full erosion and no erosion.
The final damping field ω(p) is defined as the combina-
tion of all the damping fields ωi j (p) as follows:
ω(p) = min (ωi j (p))
(i, j) ∈ [0, nG − 1]2
By using the minimum function we guarantee that no erosion
occurs within the spherical region r < a.
b Rock shape R i
c ij a
p Contact region
i
Figure 15: Rocks into contact after the erosion process. The
contact points have been represented as red shaded spheres
Blending region
Strong erosion
The erosion process proceeds in four steps. First we gen-
erate a set of contact points between the coarse rock vol- Figure 16: Definition of the erosion damping regions
umes. Then we define an attenuation field that will dampen around contact points
erosion in the neighborhood of contact points (Figure 16).
We perform a user controlled number of spheroidal erosion
steps [BFO∗ 07] and generate an implicit representation of
Erosion process The erosion process is performed in two
the rocks. Finally, we create the meshes of the rocks by us-
steps. First, we initialize the voxels Gi jk of the voxel grid
ing standard implicit surface meshing techniques [LC87].
with a parameter denoted as ρi jk = 1 that characterizes the
erosion state of the voxel. If ρi jk = 0, then the voxel is com-
Contact points The contact points between the different
pletely eroded and becomes empty (Figure 18).
rock volumes are created in two steps. We generate a contact
point, denoted as ci j , for every two rock volumes Vi and V j The erosion process is performed by iteratively computing
into contact. The contact point is created on the line segment which cells have to be eroded, and evaluating the amount of
[pi p j ] by finding the position that satisfies di (ci j ) = d j (ci j ) erosion. Only the voxels at the surface of the rock volume,
using a bisection algorithm. i.e. that share a face with either another empty voxel or a
A. Peytavie, E. Galin, J. Grosjean, S. Merillou. / Procedural Generation of Rock Piles using Aperiodic Tiling
Figure 17: A virtual canyon with piles of rocks and boulders lying in the river (25 313 rocks)
Partially eroded border voxel 0 ≤ ρ ≤ 1 Fully eroded voxels ρ = 0 The field function r(p) for every point in space is obtained
Contact region as a tri-linear interpolation of those values. Thus, we eas-
p ily create the mesh of the rocks by standard implicit surface
j
p meshing techniques [LC87].
k
p
i Contact point 6. Rock instantiation
Protected voxel preserving contact ρ = 1
Rock piles are created by using a support object O that de-
Figure 18: Erosion of the discrete Voronoï volumes fines the shape of the rock pile. We can use any kind of
model that provides us with a point membership function,
denoted as s(p). In our system, we used implicit represen-
tations (Figure 17, 24), procedural models (Figure 22) and
voxel of different identifier, should progressively erode. Let
closed triangle meshes (Figure 23).
ε(p) denote the amount of erosion at a point p in space at
a given iteration. We define the evolution of the state of a
voxel Vi jk as: Corner cube tile
Rock instance
ρi jk ← ρi jk − ε(p) ωi j (p) Support O
p
p j
i
Assuming that the corner cubes are placed with their cor-
Figure 19: Example of rocks generated into a corner cube ners on integer grid points, a stochastic tiling is obtained by
grid structure, the rocks have been shaded with same color assigning a random color to each integer grid point. We gen-
as the corner cube grid cells and some rocks removed to see erate rocks form the precomputed set of tiles by analyzing
the interior of the tile corner cubes straddling the object O (Figure 20).
v p
i jk k Created
Mesh generation process For every rock, we identify the
voxels in the grid with the corresponding identifier and de-
fine an implicit surface representation of its volume. We de- Rock shape Anchor points Not created
fine the field function values at the centers of the cells vi jk
as: Figure 21: Rock selection process
r(vi jk ) = 2 ρi jk − 1 r(vi jk ) ∈ [−1, 1]
A. Peytavie, E. Galin, J. Grosjean, S. Merillou. / Procedural Generation of Rock Piles using Aperiodic Tiling
Figure 22: A Zen garden scene featuring 94 658 small stones organized into lines and circular patterns
For every rock, we associate a set of anchor points A = Realism Our aperiodic tiling method greatly enhances the
{ai } which are defined as the union of the centers vi jk of overall realism of rock piles by avoiding unnatural repetitive
the voxels and the seed point pk . For all anchor points, we distribution patterns that occur with periodic schemes.
evaluate the point membership function s(ai ) and compute
the number of anchor points inside and outside of the object Control Because we do not rely on physically based sim-
O respectively (Figure 21). We instantiate rocks that have a ulations for computing the collisions between rocks, our
relative number of anchor points inside the object above a method lends itself for real time modeling of complex
given threshold. scenes. In particular, it is very efficient for controlling the
location of stones and creating special effects. The volumet-
ric model describing how rocks should fit line and circular
patterns in the Zen garden was generated procedurally.
The ancient dried stone huts demonstrate that our method
can efficiently instantiate thousands of stones for creating
complex architectural models. The volumetric model repre-
senting the walls and roof was sketched using our imple-
mentation of the Arches system [PGMG09] in less than two
minutes.
n Stones Time
5 7 355 23
Figure 23: A meshed statue converted into rocks
6 17 166 73
7 33 217 176
This method enables us to avoid the creation of rocks with
Table 1: Timings (in seconds) for generating tiles
only a small intersection with the geometry of the support
object. In practice, for large rock piles, we eliminate rocks
whose distance to the surface is larger than twice the maxi-
mum radius of the Voronoï embedding spheres. Timings Our rock pile generation technique can create
thousands of rocks piled together very efficiently. Table 1
reports timings for generating the set of aperiodic tiles as
7. Results and discussion well as the number of cells n. The Voronoï volume computa-
tion and the erosion processes were performed using a finer
We have implemented our aperiodic rock tiling algorithm
grid G, with nG = 10 × n so that the resolution should be fine
into a modeling application coded in C++. We have applied
enough to capture the details of smaller stones.
our method to create the different scenes shown throughout
this paper: a canyon (Figure 17), a Zen garden (Figure 22) Note that the creation of the corner cube grid with seed
and dried stone huts (Figure 24). Renderings were performed points is negligible: most of the time is spent in the Voronoï
by using Mental Ray on the textured meshes produced by our volume generation, the erosion process and in the creation of
method. the meshes of the rocks from their implicit representation.
A. Peytavie, E. Galin, J. Grosjean, S. Merillou. / Procedural Generation of Rock Piles using Aperiodic Tiling
Figure 24: Bories (ancient dry stone huts) generated with our rock tiling technique (28 032 stones)
Recall that the geometry of rocks in the cubic tiles is gen- [KMN88] K ELLEY A. D., M ALIN M. C., N IELSON G. M.: Ter-
erated once and for all as a preprocessing step. In contrast, rain simulation using a model of stream erosion. In Proceedings
of ACM SIGGRAPH (1988), pp. 263–268. 2
instantiating the rocks in a scene can be performed very ef-
ficiently. [LC87] L ORENSEN W. E., C LINE H. E.: Marching cubes: A high
resolution 3d surface construction algorithm. In Proceedings of
ACM SIGGRAPH (1987), pp. 163–169. 6, 7
8. Conclusion [LD06a] L AGAE A., D UTRÉ P.: Poisson sphere distributions. In
Vision, Modeling, and Visualization (2006), pp. 373–379. 2, 3
We have proposed an original aperiodic tiling technique for
[LD06b] L AGAE A., D UTRÉ P.: An alternative for Wang tiles:
generating piles of thousands of rocks. Our method not only
Colored edges versus colored corners. ACM Transactions on
avoids repetitive patterns that occur when using periodic Graphics (2006), 1442–1459. 3
tiling, but also provides simple control over both the shape
[LDG01] L EGAKIS J., D ORSEY J., G ORTLER S.: Feature-based
of rocks and the shape of rock piles. This enables us to create cellular texturing for architectural models. In Proceedings of
a vast variety of models (including gravels or pebbles) and ACM SIGGRAPH (2001), ACM Press, pp. 309–316. 2
improve the overall realism of natural sceneries. [LEQ∗ 07] L U A., E BERT D. S., Q IAO W., K RAUS M., M ORA
B.: Volume illustration using wang cubes. ACM Transanctions
on Graphics. 26, 2 (2007), 11. 2
Acknowledgements
[MDH07] M EI X., D ECAUDIN P., H U B.: Fast hydraulic erosion
This work was supported by Agence Nationale de la simulation and visualization on GPU. In Proceedings of Pacific
Recherche as ANR-06-MDCA-004-01 project. We wish to Graphics (2007), pp. 47–56. 2
credit Eden Games and Widescreen Games for participat- [MIS01] M IYATA K., I TOH T., S HIMADA K.: A method for gen-
ing to the project. Special thanks go to Pascal Bouvier and erating pavement textures using the square packing technique.
The Visual Computer 17, 8 (2001), 475–490. 2
Robert Foriel (Widescreen Games) for developing the real
time HLSL and Mental Ray shaders, and to Etienne Duran- [Miy90] M IYATA K.: A method of generating stone wall patterns.
In Proceedings of ACM SIGGRAPH (1990), pp. 387–394. 2
ton (LIRIS) for his assistance in the implementation into the
framework. [MKM89] M USGRAVE F. K., KOLB C. E., M ACE R. S.: The
synthesis and rendering of eroded fractal terrains. In Proceedings
of ACM SIGGRAPH (1989), pp. 41–50. 1
References [NWD05] N EIDHOLD B., WACKER M., D EUSSEN O.: Interac-
tive physically based fluid and erosion simulation. In Eurograph-
[BFO∗ 07] B EARDALL M., FARLEY M., O UDERKIRK D., ics Workshop on Natural Phenomena (2005), pp. 25–32. 2
S MITH J., J ONES M., E GBERT P.: Goblins by spheroidal weath-
ering. In Eurographics Workshop on Natural Phenomena (2007), [PGMG09] P EYTAVIE A., G ALIN E., M ERILLOU S., G ROS -
pp. 7–14. 4, 6 JEAN J.: Arches: a Framework for Modeling Complex Terrains.
Computer Graphics Forum 28 (2009), 457–467. 2, 8
[BPB09] B OULANGER K., PATTANAIK S. N., B OUATOUCH K.:
Rendering grass in real time with dynamic lighting. IEEE Com- [SKP05] S HAH M., KONTINNEN J., PATTANAIK S.: Real-
puter Graphics and Applications 29, 1 (2009), 32–41. 2 time rendering of realistic-looking grass. In Proceedings of
GRAPHITE (2005), pp. 77–82. 2
[CBS96] C RESPIN B., B LANC C., S CHLICK C.: Implicit sweep
objects. Computer Graphics Forum 15, 3 (1996), 165–174. 5 [ST89] S ZELISKI R., T ERZOPOULOS D.: From splines to frac-
tals. In Proceedings of ACM SIGGRAPH (1989), pp. 51–60. 1
[CSHD03] C OHEN M., S HADE J., H ILLER S., D EUSSEN O.:
Wang tiles for image and texture generation. ACM Transactions [ZSTR07] Z HOU H., S UN J., T URK G., R EHG J. M.: Terrain
on Graphics (Proceedings of SIGGRAPH) 22, 3 (2003), 289– synthesis from digital elevation models. IEEE Transactions on
294. 2, 3 Visualization and Computer Graphics 13, 4 (2007), 834–848. 2