11
Vis Comput DOI 10.1007/s00371-013-0909-y ORIGINAL ARTICLE Procedural approach to volumetric terrain generation Aitor Santamaría-Ibirika · Xabier Cantero · Mikel Salazar · Jaime Devesa · Igor Santos · Sergio Huerta · Pablo G. Bringas © Springer-Verlag Berlin Heidelberg 2013 Abstract The recent outbreak of indie games has popular- ized volumetric terrains to a new level, although video games have used them for decades. These terrains contain geolog- ical data, such as materials or cave systems. To improve the exploration experience and due to the large amount of data needed to construct volumetric terrains, industry uses procedural methods to generate them. However, they use their own methods, which are focused on their specific prob- lem domains, lacking customization features. Besides, the evaluation of the procedural terrain generators remains an open issue in this field since no standard metrics have been established yet. In this paper, we propose a new approach to procedural volumetric terrains. It generates completely customizable volumetric terrains with layered materials and other features (e.g., mineral veins, underground caves, mate- rial mixtures and underground material flow). The method allows the designer to specify the characteristics of the ter- rain using intuitive parameters. Additionally, it uses a specific A. Santamaría-Ibirika (B ) · X. Cantero · M. Salazar · J. Devesa · I. Santos · S. Huerta · P. G. Bringas University of Deusto, Avda. de las Universidades, 24, 48014 Bilbao, Bizkaia, Spain e-mail: [email protected] X. Cantero e-mail: [email protected] M. Salazar e-mail: [email protected] J. Devesa e-mail: [email protected] I. Santos e-mail: [email protected] S. Huerta e-mail: [email protected] P. G. Bringas e-mail: [email protected] representation for the terrain based on stacked material struc- tures, reducing memory requirements. To overcome the prob- lem in the evaluation of the generators, we propose a new set of metrics for the generated content. Keywords Procedural generation · Virtual worlds · Volumetric terrain · Terrain modeling 1 Introduction Interactive graphic software has evolved in the last decades due to several reasons, including the rapid hardware evolution (arguably the most important factor). These advances have expanded the possibilities of virtual world simulations. For instance, the level of detail of virtual environments has grown to almost realistic levels. Therefore, a significant number of real-time graphic applications make use of highly detailed virtual worlds, even with volumetric terrains. Volumetric terrains are usually procedurally generated without human interaction. This process has two main advan- tages against the traditional design. First, it avoids terrain modeling steps, saving time and money. Second, it is pos- sible to create interesting and unpredictable terrains to be explored (in some cases, even theoretically infinite). Nowadays, the procedural generation of terrains is an area which includes different techniques. Traditional methods for procedurally generated terrains were based on fractals. They used different approaches, such as the grid subdivision technique [9] (which subdivides recur- sively a grid containing the terrain heights) or noise functions [4, 15, 21]. These methods generate realistic terrains with a high level of detail, but they suffer from a lack of customiza- tion features. Research in fractal terrains is an active topic. Some authors have focused their research on the improvement of the 123

Procedural approach to volumetric terrain generation

Embed Size (px)

Citation preview

Page 1: Procedural approach to volumetric terrain generation

Vis ComputDOI 10.1007/s00371-013-0909-y

ORIGINAL ARTICLE

Procedural approach to volumetric terrain generation

Aitor Santamaría-Ibirika · Xabier Cantero ·Mikel Salazar · Jaime Devesa · Igor Santos ·Sergio Huerta · Pablo G. Bringas

© Springer-Verlag Berlin Heidelberg 2013

Abstract The recent outbreak of indie games has popular-ized volumetric terrains to a new level, although video gameshave used them for decades. These terrains contain geolog-ical data, such as materials or cave systems. To improvethe exploration experience and due to the large amount ofdata needed to construct volumetric terrains, industry usesprocedural methods to generate them. However, they usetheir own methods, which are focused on their specific prob-lem domains, lacking customization features. Besides, theevaluation of the procedural terrain generators remains anopen issue in this field since no standard metrics have beenestablished yet. In this paper, we propose a new approachto procedural volumetric terrains. It generates completelycustomizable volumetric terrains with layered materials andother features (e.g., mineral veins, underground caves, mate-rial mixtures and underground material flow). The methodallows the designer to specify the characteristics of the ter-rain using intuitive parameters. Additionally, it uses a specific

A. Santamaría-Ibirika (B) · X. Cantero · M. Salazar · J. Devesa ·I. Santos · S. Huerta · P. G. BringasUniversity of Deusto, Avda. de las Universidades, 24,48014 Bilbao, Bizkaia, Spaine-mail: [email protected]

X. Canteroe-mail: [email protected]

M. Salazare-mail: [email protected]

J. Devesae-mail: [email protected]

I. Santose-mail: [email protected]

S. Huertae-mail: [email protected]

P. G. Bringase-mail: [email protected]

representation for the terrain based on stacked material struc-tures, reducing memory requirements. To overcome the prob-lem in the evaluation of the generators, we propose a new setof metrics for the generated content.

Keywords Procedural generation · Virtual worlds ·Volumetric terrain · Terrain modeling

1 Introduction

Interactive graphic software has evolved in the last decadesdue to several reasons, including the rapid hardware evolution(arguably the most important factor). These advances haveexpanded the possibilities of virtual world simulations. Forinstance, the level of detail of virtual environments has grownto almost realistic levels. Therefore, a significant number ofreal-time graphic applications make use of highly detailedvirtual worlds, even with volumetric terrains.

Volumetric terrains are usually procedurally generatedwithout human interaction. This process has two main advan-tages against the traditional design. First, it avoids terrainmodeling steps, saving time and money. Second, it is pos-sible to create interesting and unpredictable terrains to beexplored (in some cases, even theoretically infinite).

Nowadays, the procedural generation of terrains is an areawhich includes different techniques.

Traditional methods for procedurally generated terrainswere based on fractals. They used different approaches, suchas the grid subdivision technique [9] (which subdivides recur-sively a grid containing the terrain heights) or noise functions[4,15,21]. These methods generate realistic terrains with ahigh level of detail, but they suffer from a lack of customiza-tion features.

Research in fractal terrains is an active topic. Some authorshave focused their research on the improvement of the

123

Page 2: Procedural approach to volumetric terrain generation

A. Santamaría-Ibirika et al.

realism simulating the erosion of the elements: Musgraveet al. [10,11] simulated fluvial and gravitational erosion andOlsen [13] analyzed some speed optimizations. Benes andFrosbach [1] proposed a method to erode volumetric ter-rains. Other authors have focused on the improvement of thedesigner control: Kamal et al. [8] proposed a method for thispurpose, but it required unusable technical parameters. Doranet al. [3] used an agent-based approach to customize theterrain. Moreover, some authors have suggested innovativeapproaches to paint directly on the terrain surface [2,6,7,22].

Albeit fractals have been the main method in terrain gen-eration, a new trend has been born in the last few years. Someauthors have focused on evolutionary algorithms for proce-dural terrain generation [5,14,20], providing designers withhigher control over the process and adapting the results todifferent objectives [18,19].

Some researches focused on the validation of those typeof generators. Ong et al. [14] proposed four aspects that gen-erators should meet (adaptive, innovative, scalable and intu-itive). Saunder [17] defined the ideal generator with a setof desirable features (requiring low degree of human input,requiring high degree of human control, being intuitive, beingable to generate realistic and recognizable terrains, producingterrains at arbitrary scale, being able to run in real time andbeing extensible to support new types of terrains). Doran andParberry [3] proposed another set of properties for an idealgenerator (novelty, structure, interest, speed and controlla-bility).

However, to the best of our knowledge, the literature doesnot present any procedural approach to volumetric terraingeneration. The main consequence of this situation is thatcurrent industrial generators are completely focused on theirown problem domain and do not allow the customizationof the results. Moreover, there is not a standard method tovalidate procedural terrain generators, without any metric toevaluate this type of generators and their results.

In this paper, we propose a real-time method to proce-durally generate volumetric terrains, extending our previ-ous work in this field [16] (Fig. 1 shows a terrain gener-ated with our method). The proposed approach presents highcustomization features, enabling the designer to specify thematerials of the terrain. Additionally, our generator repre-sents the volumetric data with a novel method which reducesthe required memory. Besides, we deal with a classic prob-lem evaluating the quality of generators. The lack of metricsand procedures to measure highly important aspects (like theinterest of the results or the obtained realism) disables theevaluation objectivity. To avoid this problem in the valida-tion of our method, we propose a new set of metrics.

Summarizing, the main contributions of the paper are:

• A new customizable online method to generate proce-dural volumetric terrains.

Fig. 1 A terrain generated with our method

• A new system to represent volumetric terrains.• A new set of metrics and requirements to validate proce-

dural generators.

The remainder of this paper is organized as follows. First,Sect. 2 presents an overview of the contributions of this arti-cle. Next, Sect. 3 explains the volume representation systemand Sect. 4 outlines the generation process. We present theresults in Sect. 5. Finally, Sect. 6 presents the conclusion ofour research, with a strengths and weaknesses analysis andrecommendations for future work.

2 General overview

This section provides a general overview of the contributionsof this paper.

2.1 Evaluation metrics

Some authors have established a set of prerequisites a terraingenerator must satisfy [3,14,17]. We synthesize them intoa set of aspects which the procedural generators must meet.Additionally, we assign a metric to each aspect to allow themeasurement of the requisite.

Innovation Ability of the procedural generator to obtainunexpected elements.

0. No innovation. The results are completely predictable.1. The method generates the same elements in all the results,

but with different properties.2. The results have unexpected elements.

123

Page 3: Procedural approach to volumetric terrain generation

Procedural approach to volumetric terrain generation

Structure Ability of the procedural generator to obtain recog-nizable coupled elements.

0. Random. The results are similar to the random noise.1. The results have independent recognizable elements.2. The results have recognizable coupled elements.

Interest Ability of the procedural generator to obtain inter-esting results to interact with.

0. The terrains are not explorable.1. The terrains are explorable.2. The terrains motivate the exploration.

Speed Speed of the generator obtaining the result.

0. Offline.1. Hybrid approach. It is fast enough to be executed in the

previous step to the interaction (such as a loading screen),but it cannot be executed online.

2. Online.

Usability Ability of the procedural generator to hide technicalaspects to the designer.

0. N/A. The method does not have input parameters.1. The parameters are related to the technique.2. The parameters are related to the result.

Control Ability of the procedural generator to allow thedesigner to specify the generated contents features.

0. The designer can specify no aspect of the result.1. The designer can specify some aspects of the result.2. The designer can specify all the aspects of the result.3. The designer can specify all the aspects of the result,

correcting them iteratively.

Ampliability Ability of the procedural generator to obtaindifferent types of results.

0. None. It is impossible to obtain other types of results.1. The procedural generator needs internal changes to

obtain other types of results.2. It obtains other types of results by modifying the input.

Scalability Ability of the procedural generator to obtainresults at different scales and levels of detail.

0. The results are always at the same scale.1. Scalable. The procedural generator can obtain results at

different scales and levels of detail.

Realism Ability to obtain plausible results.

0. Impossible in any reality. For example, random noise.1. Plausible in other realities. For example, flying isles.2. Based on our reality, but not on a simulation (called data

free approach by Natalie et al. [12].)3. Simulation of our reality. (called sparse-data and dense-

data approach by Natalie et al. [12].)

2.2 Our method

The main objective of this paper is to obtain a valid gener-alist method to get volumetric terrains. To this end, basedon the metrics established before, our method has to meetthe requirements shown in Table 1. We choose the maxi-mum value of each metric excluding control and realism.We choose a level 2 of control because a level 3 requirean interactive process, making executing it online impossi-ble. Aditionally, we establish the required level of realismat 2 because this is a constant in the video game indus-try, due to the high requisites in computation for a realisticsimulation.

To satisfy these requisites, we propose a method with thefollowing features:

• Probabilistic generation Our approach is based on proba-bilities, making it impossible to predict what element is tobe constructed next.

• Underground layers, veins and caves Generated terrainsare structured in underground layers formed with materialmixtures. This feature allows the terrain to avoid sharplimits between materials, connecting them with realis-tic progressive changes. Additionally, our method gener-ates caves and mineral veins among layers, motivating theexploration.

• Real time generation Our approach is fast enough to gen-erate the terrain online.

• Control The method allows the designer to control all thepreviously stated characteristics. Input parameters allowthe generation of multiple terrain types, such as realisticor fantastic terrains, at different scales. Additionally, inputdata are directly related to the terrain, avoiding technicalconcepts.

• Reduced memory The representation system used reducesthe required memory and accelerates the generationprocess.

3 Volume representation

Volumetric data have been commonly represented by voxels.A voxel-based representation uses a a three-dimensional reg-ular grid of voxels, which stores the volumetric data structur-

123

Page 4: Procedural approach to volumetric terrain generation

A. Santamaría-Ibirika et al.

Table 1 Requirements for a procedural generator

Metric Ideal value Our requirement Notes

Innovation 1, 2 2 The ideal value depends on the scope and the objective of the problem, andthe desired level of heterogeneity between the results

Structure 2 2 The results must always present recognizable and structured elements

Interest 0, 1, 2 2 The ideal value depends on the scope and the objective of the problem and thearea in which the results are to be used

Speed 0, 1, 2 2 The ideal value depends on the purpose of the problem. The results must beready when they are needed

Usability 2 2 The generator must always hide the technical aspects

Control 2, 3 2 The ideal value should be 3 only if the method is off-line

Ampliability 2 2 The generator must be easily adapted to obtain different types of results

Scalability 1 1 The ideal generator must be able to generate content at different scales

Realism ≥1 2 The ideal value depends on the objective of the problem and the area in whichthe results are to be used

ing it in the space. This type of representation is not optimalfor environments where the speed accessing the data and thememory usage are critical aspects because a Nt × Mt × L t

terrain needs Nt × Mt × L t voxels to store the terrain data.The proposed method avoids this issue using an alternative

representation system based on the approach proposed byBenes and Frosbach [1]. It divides the volumetric data intothree levels: chunks, columns and limits.

The highest data level is the chunk division. It repre-sents a three-dimensional portion of terrain with a size ofN × M × L voxels.

The next level is the column division. Each chunk isformed by a N × L two-dimensional regular grid of columns.Each column represents the stacked material at one point ofthe chunk and stores the data of M voxels.

Finally, the lowest division level is the limit division. Thecolumns are formed by an arranged collection of elements(we call them limits), which represent the volumetric data inone point of the column. Each column has at least two limits(the column top and bottom) and a maximum of M limits.

Figure 2 shows an example of the previously explainedrepresentation system. We can observe a chunk in green, acolumn in blue and their four limits in red.

This volume management system enables the user toobtain any voxel of the terrain. If the desired voxel is atthe same chunk, column and height of one of the limits, theprocedure generates it dynamically with the data stored inthis limit. Otherwise, the method generates it interpolatingbetween the limits surrounding the desired voxel. The Fig. 2shows an example of a column with all the voxels createdusing this method.

This representation can store different types of data. Thedata of our terrains is formed by the material composition (alist of materials with an associated concentration which deter-mines the color and texture of the volume) and the material

Fig. 2 Volume management example. This column has three limits: atthe top, bottom and frontier between two different layers.

flow (internal material flow of the terrain represented as athree-dimensional vector).

4 Terrain generation

The terrain generation starts by reading the input data andindexing the materials by their special parameters. Next, themethod creates the layers and veins of the terrain. Finally, thelayers and veins are converted to our volume representationsystem.

4.1 Input data

The input data are provided at design time to allow the gen-eration process to be real time. It has two main sets of para-meters: material data and general parameters.

123

Page 5: Procedural approach to volumetric terrain generation

Procedural approach to volumetric terrain generation

4.1.1 Material data

Material data are composed of three additional sets of para-meters, which define the materials of the terrain.

First, material descriptors for each material are provided:

• Name Material name.• Id Numerical unique identifier.• Color RGB color value.• Special parameters Parameters which establish some

special characteristics of the material:

– Void It determines empty voxels in the terrain.– Base Materials for the bottom layer of the terrain.– Alone Materials which cannot be mixed with others.– Vein It determines resources of the terrain, structuring

them into veins instead of layers.– Cave Materials for the empty voxels of the caves. It is

possible to generate different type of caves definingdifferent materials with his parameter defined.

• Textures Path to the material texture file.

Second, layer, vein and cave related-parameters are provided.The following data-fields are defined for each material (allvalues are normalized to 0–1 range):

• Area Only used with vein or cave materials. It specifiesthe vein or the cave area.

• Depth It determines the minimum, maximum and opti-mum depth of the elements formed with this material.

• Thickness It determines the minimum, maximum and opti-mum thickness of the layers, veins or caves formed withthis material.

• Roughness It determines the minimum, maximum andoptimum roughness of the elements formed with this mate-rial. For cave and vein materials, it represents the constantsfor the fractal algorithm explained in Sect. 4.2.2, affectingthe shape roughness. For regular materials, it representsthe roughness of the surface.

• Similarity It specifies the similarity of the shape betweentwo consecutive layers.

• Blend value It specifies the suitability of the material to bemixed with others.

Finally, the affinity of the materials is provided. Each pairof materials is assigned two affinity values: the affinity rateof the materials in the same layer and the affinity rate of thematerials in consecutive layers. Both values are expressed ina 0–1 range if the materials are compatible, and with a -1 ifthey are not. So, 0 affinity means that the materials are notprone to be mixed, but they still can be blended for otherreasons.

4.1.2 General parameters

These parameters represent values which affect not only onematerial, but also the whole terrain.

• Terrain depth The depth of the terrain from the deepestlayer to the surface.

• Layer thickness It converts the thickness of each layer intoan absolute value.

• Cave and vein area It affects the size of the area of eachvein and cave. It establishes the maximum length of theside of the square which bounds to the vein or cave.

• Cave and vein density It establishes the density of veinsand caves in the terrain.

• Roughness It converts the roughness parameter of eachmaterial into an absolute value.

• Layer similarity It affects the similarity parameter of eachmaterial.

• Scale Scale of the terrain.• Cave and vein thickness It converts the thickness of each

cave and vein into an absolute value.

4.2 Generation process

The process starts generating the layers, veins and caves ofthe terrain. First, it creates the deepest layer and continuesgenerating and stacking more layers, veins and caves, deter-mined by the parameters which define the density of veinsand caves in the terrain. The generation process ends whenthe distance from the bottom layer to the last generated layerreaches the desired depth for the terrain.

4.2.1 Layer generation

The generation starts choosing the materials for the layer. Ifit is the first layer of the terrain, the algorithm uses only mate-rials with the base parameter defined. Otherwise, it choosesthe materials from a list based on the affinity of the materialsof the last layer. To this extent, the method gets all the materi-als, removing any incompatibilities with the composition ofthe last layer from the list. Then, the global affinity of eachpossible material is calculated:

Ai =N∑

j=1

(ai j × c j ) (1)

where Ai is the global affinity of i th possible material, N isthe number of materials in the previous layer, ai j is the affinitybetween the i th possible material and the j th material of thelast layer, whereas c j is the concentration of j th material inthe last layer.

Next, we get the probability of each material to be in thenew layer:

123

Page 6: Procedural approach to volumetric terrain generation

A. Santamaría-Ibirika et al.

Pi = Ai/

⎝N∑

j=1

A j

⎠ (2)

where Pi is the probability of the i th possible material toappear, Ai is the global affinity of i th possible material cal-culated in the last equation, N is the number of possiblematerials, and A j is the global affinity of j th possible mate-rial.

At this point, the method uses a random value and thepreviously calculated probabilities to choose the main mate-rial for the new layer. The layer has a probability of con-taining additional materials (50 % for the second mater-ial, halving it consecutively for next materials). Addition-ally, to select more materials the algorithm includes in theprocess the affinities of the already selected materials for thelayer.

Next, the algorithm calculates the concentration for theselected materials. The main material concentration is 1 ifthe layer has only one material. Otherwise, the main mate-rial concentration is randomly chosen between 0.5 and 0.9and the concentration of the remaining materials is randomlychosen. The addition of the concentrations of the materialsmust be equal to 1.

Secondly, the method calculates the properties of the layer(relative thickness, similarity, blend value, and roughness)using the following equation:

V =N∑

i=1

(vi × ci ) (3)

where V is the property value, N is the number of materialsin the layer, vi is the property value of each material, and ci

is the concentration of each material.Third, the method generates the heights of the layer mul-

tiplying the roughness of the layer by a Perlin noise [15]value using the scale of the terrain as its frequency. Then thesimilarity modifier is applied:

h = h−1 × s + n × (1 − s) (4)

where h is the modified height, h−1 is the height of the lastlayer at the same point, s is the previously calculated simi-larity, and n is the Perlin noise value. This equation modifiesthe new layer, depending on the similarity, to look like thelast layer. This value is relative to the height of the layer.To obtain the absolute value the algorithm adds the thick-ness of the new layer and the average height of the previouslayer.

Finally, the underground material flow is generated. Thisflow is tangent to the layer surface, but rotated by a Perlinnoise value on the Y axis.

4.2.2 Vein generation

First, the method selects a random location for the vein andgenerates a base bounding square on it. The length of thesquare side is randomly chosen between VeinArea/2 andVeinArea, with VeinArea being the vein area general para-meter.

Second, as in the layer generation process, the algorithmselects the materials for the vein. The process is the same,but it only selects the main material among materials withvein parameter and only gets the affinities of the materialslocated under the base bounding square.

Third, the vein properties (relative area, roughness and rel-ative thickness) are calculated with the Eq. 3. Then, the basebounding square is multiplied by the relative area, obtainingthe final bounding square.

Fourth, the method generates the relative vein shape bymeans of a fractal algorithm based on the midpoint displace-ment method, which has been extensively used for terraingeneration [11]. Then, it fits it into the final bounding square,obtaining the final vein shape.

The fractal algorithm generates the relative shape locat-ing a square in a two-dimensional space and displacing itsvertices (P1, P2, P3 and P4) along the square diagonals(Fig. 3a). Next, it takes a random point (P ′) from a segment,displacing it along the line formed by the new point (P ′) andthe square center (Fig. 3b). The point displacement valueis randomly obtained with a maximum calculated with theEq. 5. This process is recursively performed.

di = (di−1/SmoothConstant)/2 (5)

where i is the recursive depth in the algorithm, di is themaximum displacement at the i th recursive depth, di−1 isthe maximum displacement at the i − 1th recursive depth(d0 is a constant), and SmoothConstant is a constant valuethat indicates the roughness loss in each iteration. The valuesfor both constants are taken from the roughness parameterof the materials. The recursive depth of fractal algorithm is

Fig. 3 Fractal algorithm for vein generation

123

Page 7: Procedural approach to volumetric terrain generation

Procedural approach to volumetric terrain generation

limited to 5 due to time performance. The minimum pointdisplacement is −di .

Fifth, the algorithm uses the minimum distance from eachpoint to the border of the shape to establish the relative heightof the vein. This height is calculated with the following equa-tion, which is based on the circumference located at [1, 0]and a radius of 1 unit length equation:

hxy =∣∣∣∣√

1 − (dxy − 1)2

∣∣∣∣ (6)

where hxy is the height at [x, y] point and dxy is the distancefrom the [x, y] point to the border.

Finally, our method generates the final heights of the veinmultiplying the relative heights, the relative thickness andthe global thickness, and adds the heights of the last layerunder the final vein shape. Then, the underground materialflow is generated following the same steps as the vein flowgeneration process.

4.2.3 Cave generation

The cave generation process follows the same steps as veingeneration process with some particularities.

First, as in the vein generation process, the algorithmestablishes the base bounding square and the location. Thisprocess employs CaveArea instead of VeinArea to determinethe size of the base bounding square.

Next, the method obtains the material of the cave and itsproperties. This process is performed in the same way as thevein material selection with two exceptions. The algorithmselects only one material, chosen within the set of materialswhere the cave special parameter is defined. Then, the prop-erties of the material are extracted, modifying the boundingsquare of the cave as in the vein generation process.

Finally, the method generates the final cave shape andheights with the same algorithms used in the vein generationprocess.

4.2.4 Online approach

The previous sections show how the proposed method gen-erates a terrain from scratch. The online generation has thepeculiarity that it must be able to extend an already existingterrain. With our method, this process is very similar to thegeneration from scratch, except for the fact that the compo-sition and properties of the layers are calculated beforehand.

First, the algorithm determines the number of veins andcaves in the new terrain plot. This value is obtained randomlybetween 0.5 and 1.5 times the number of veins and caves inthe original plot. While this process is performed againstthe number of veins and caves of the first plot of the terrain(which is generated using the density of veins and caves given

Table 2 Measured configurations

0 1 2 3

A

3 regular 3 regular 3 regular 3 regular

0 cave 0 cave 1 cave (0.5) 1 cave (0.25)

0 vein 1 vein (0.5) 0 vein 1 vein (0.25)

B

6 regular 6 regular 6 regular 6 regular

0 cave 0 cave 1 cave(0.5) 1 cave(0.25)

0 vein 2 vein(0.5) 0 vein 2vein(0.25)

in the input data), the density of those elements is preservedalong the whole terrain.

Once the number of veins and caves is obtained, themethod determines their position between the layers. Thisis a completely random process. The result of this step is astack of layers, veins and caves.

Next, the method generates the elements of the stackbeginning from the bottom. It extends the layers in the hori-zontal plane (along the X and Z coordinates) obtaining newheights using the Perlin noise algorithm. This step is the sameas the layer generation from scratch process (see Sect. 4.2.1),but the composition and properties of the layer are alreadycalculated. The generation of veins and caves is performedfollowing the same steps as before (see Sect. 4.2.2).

4.3 Converting the terrain to a volume

The previously explained process generates a collection oflayers, veins and caves, so, it is mandatory to convert themto our representation system. This process gives a naturalappearance to the terrain blending the materials of consecu-tive layers. To this end, the method calculates the blend areasbetween layers, multiplying their thickness by their blendvalue, resulting in the height where the transition with thelast layer ends.

5 Results

5.1 Speed and Size

We measure the time of the terrain generation using eightconfigurations. Table 2 shows the materials of these configu-rations (all of which have 1 void and 1 base additional mate-rials). The value in brackets near the vein and cave materialsis the density of veins and caves for that configuration. Allmaterials have the maximum affinity between them.

The method has been tested on an Intel(R) Core(TM) i7950 CPU, running at 3.07 GHz.

We generate 100 terrains of 5 × 5 × 5 chunks of10 × 10 × 10 voxels with each configuration. Table 3 shows

123

Page 8: Procedural approach to volumetric terrain generation

A. Santamaría-Ibirika et al.

Table 3 Time results Offline averagetime (ms)

Offline standarddeviation

Online averagetime (ms)

Online standardeviation

Avg.layers

Avg.elements

A0 319.14 41.94 310.59 32.20 4.65 0.00

A1 347.01 61.66 329.70 55.76 4.72 1.74

A2 334.85 53.49 312.20 44.75 4.81 1.55

A3 348.46 75.01 342.84 60.35 4.68 1.73

B0 324.36 46.85 309.24 32.29 4.75 0.00

B1 354.25 70.23 315.28 47.86 4.88 1.71

B2 354.30 62.27 316.40 46.28 4.79 1.90

B3 346.67 55.55 314.86 47.18 4.73 1.78

PN 61.25 14.46 61.25 14.46

Fig. 4 Comparison of the different configurations of our method forthe off-line setup

the average time and the standard deviation of the off-linegeneration and the extension of those terrains with the onlinealgorithm. Moreover, the table shows the average numberof layers and elements (caves or veins) generated in theterrains. Additionally, we use a terrain generated by simplePerlin noise (PN in the table) as a baseline. This Perlin Noiseprocess generates the internal flow and the material of eachvoxel.

Figures 4 and 5 provide a visual comparison of the dif-ferent tested configurations for online and off-line setups.In both setups, generation of caves increases the computingoverhead of our method, whereas the most time-consumingconfigurable feature of our method is the generation of thevein. However, the method was able to generate terrains withboth features online. It is also noticeable that the requiredtime for generating terrains with a complex material config-uration is not significantly higher than the time required withsimple material configuration.

The average number of limits of the generated terrainsis 84,376.42, while in a traditional volumetric terrain based

Fig. 5 Comparison of the different configurations of our method forthe online setup

on voxels and with the same dimensions as our generatedterrains the number of voxels is 125,000.

The algorithm presents a computational complexity of n2 ·m, with n being the terrain side length in a regular n × n × nterrain, and m the number of layers, veins and caves of theterrain. The number of layers and veins value is proportionalto the terrain height (n in this case). The constant n/m isdetermined by the configuration of the materials given inthe input data. So, the final computational complexity of ouralgorithms is O(n3).

5.2 Realism

The proposed method is based on common knowledge, gen-erating results similar to sedimentary terrains. Nonetheless,it is not based on real geological data and does not simulatethe real world. In this section we compare some results ofour method against real terrains.1

1 Contains British Geological Survey materials ©NERC 2012.

123

Page 9: Procedural approach to volumetric terrain generation

Procedural approach to volumetric terrain generation

Fig. 6 Comparison against real-world terrains

Fig. 7 Results obtained with our method

Figure 6 shows slices of real terrain representations (sub-figures 6a–c) and results of our method (subfigures 6d–g). Wecan observe that our method does not generate simulationsof real terrains, but it is possible to observe several similari-ties, such as stacked layers (all the subfigures) or propagatedfolds over the layers (subfigures 6b, f). In spite of this similar-ity, there are some real constructions that our method cannotmanage, such as that shown in subfigure 6c. Figures 1 and 7show more terrains generated with our method.

6 Conclusions

In this research we have proposed a new method to proce-durally generate volumetric terrains and a set of metrics toevaluate this type of generators. Our method, which is able to

run online, generates terrains with a natural appearance andwith a high customization level. Additionally, we propose aspecific volume representation system to reduce the memoryrequirements.

Analyzing the results, our method seems to accomplishall the requisites established in Table 1 for several reasons:

• Innovation The method uses a probabilistic method, sothe elements are completely unexpected.

• Structure Generated layers, veins and caves are con-structed in a coupled stack. Moreover, the probabilisticmethod uses material affinities to combine the structures.Additionally, the new elements have a similar shape tothe last layer, depending on the similarity value of thematerials forming it.

123

Page 10: Procedural approach to volumetric terrain generation

A. Santamaría-Ibirika et al.

• Interest The results are theoretically infinite, so they areprone to be explored. Moreover, the distributed resourcesover the terrain motivate this exploration.

• Speed The method can run in real time.• Usability All the input is related to the terrain, avoiding

technical concepts.• Control All aspects of the results can be specified by the

designer, and the method is not interactive.• Ampliability Modifying the input data, it is possible to

generate any type of layered terrain.• Scalability The scale of the result is determined with only

one parameter.• Realism The generated terrains are not simulations of real

world, but based on it.

To prove this accomplishment, more qualitative valida-tions are needed, such as a questionnaire among users tomeasure the interest and the realism, or among designers tomeasure the usability and the control.

Additionally, we observe several strengths of our method.First, generated terrains are valid for several genre of videogames, due to the customization level of the method. Second,the proposed representation system reduces significantly thememory requirements, so the terrains are suitable to be usedin interactive and dynamic environments where the datatransmission speed is critical. Last but not least, the terrainspresent a natural appearance, due to the blended layers andthe progressive interpolation of the voxels.

However, we can observe some weaknesses in the gen-erator. First, the method is able to run in real time, but theperformance is penalized by vein generation. Second, theproposed method does not generate complex cave systems,which is a usual feature of volumetric terrains. Finally, theterrains top surface is simple Perlin noise.

Future work will involve an increase of terrain character-istics, such as a more detailed surface (which can be tackledfrom any of the reviewed methods to simulate the erosion ofthe elements) or complex cave systems. Moreover, more testsare needed to validate the method against the requirements,such as the implementation of the method in a real videogame making surveys among the players and designers.

Acknowledgments We would like to thank Iván García-Ferreira forhis support over the research process. We would also like to thank theanonymous reviewers for their valuable comments.

References

1. Benes, B., Forsbach, R.: Layered data representation for visualsimulation of terrain erosion. In: Computer Graphics, Spring Con-ference on, 2001, IEEE, pp. 80–86 (2001)

2. de Carpentier, G.J.P., Bidarra, R.: Interactive gpu-based proceduralheightfield brushes. In: Proceedings of the 4th International Con-

ference on Foundations of Digital Games, FDG ’09, pp. 55–62.ACM (2009)

3. Doran, J., Parberry, I.: Controlled procedural terrain generationusing software agents. Comput Intell AI Games IEEE Trans 2(2),111–119 (2010)

4. Fournier, A., Fussell, D., Carpenter, L.: Computer rendering ofstochastic models. Commun. ACM 25(6), 371–384 (1982)

5. Frade, M., Vega, F., Cotta, C.: Evolution of artificial terrains forvideo games based on accessibility. In: Applications of Evolution-ary Computation, Lecture Notes in Computer Science, vol. 6024,pp. 90–99. Springer, Berlin (2010)

6. Gain, J., Marais, P., Straßer, W.: Terrain sketching. In: Proceedingsof the 2009 Symposium on Interactive 3D Graphics and Games,I3D ’09, pp. 31–38. ACM (2009)

7. Hnaidi, H., Guérin, E., Akkouche, S., Peytavie, A., Galin, E.: Fea-ture based terrain generation using diffusion equation. In: Com-puter Graphics Forum, vol. 29, pp. 2179–2186. Wiley Online,Library (2010)

8. Kamal, K.R., Uddin, Y.S.: Parametrically controlled terrain gen-eration. In: Proceedings of the 5th International Conference onComputer Graphics and Interactive Techniques in Australia andSoutheast Asia, GRAPHITE ’07, pp. 17–23. ACM (2007)

9. Miller, G.S.: The definition and rendering of terrain maps. In: Pro-ceedings of the 13th Annual Conference on Computer Graphicsand Interactive Techniques, SIGGRAPH ’86, vol. 20, pp. 39–48.ACM (1986)

10. Musgrave, F.K.: Methods for realistic landscape imaging. Ph.D.thesis, Yale University (1993)

11. Musgrave, F.K., Kolb, C.E., Mace, R.S.: The synthesis and render-ing of eroded fractal terrains. In: Proceedings of the 16th AnnualConference on Computer Graphics and Interactive Techniques,SIGGRAPH ’89, vol. 23, pp. 41–50. ACM (1989)

12. Natali, M., Lidal, E.M., Parulek, J., Viola, I., Patel, D.: Model-ing terrains and subsurface geology. In: Eurographics 2013, TheEurographics Association, pp. 155–173 (2013)

13. Olsen, J.: Realtime procedural terrain generation. In: University ofSouthern Denmark, Tech. rep. (2004)

14. Ong, T.J., Saunders, R., Keyser, J., Leggett, J.J.: Terrain generationusing genetic algorithms. In: Proceedings of the 2005 Conferenceon Genetic and Evolutionary Computation, GECCO ’05, pp. 1463–1470. ACM (2005)

15. Perlin, K.: An image synthesizer. SIGGRAPH Comput. Graph.19(3), 287–296 (1985)

16. Santamara-Ibirika, A., Cantero, X., Salazar, M., Devesa, J.,G. Bringas, P.: Volumetric virtual worlds with layered terraingeneration. In: 2013 International Conference on Cyberworlds,pp. 20–27. IEEE (2013)

17. Saunders, R.L.: Realistic terrain synthesis using genetic algo-rithms. Ph.D. thesis, Texas A&M University (2006)

18. Shaker, N., Yannakakis, G.N., Togelius, J.: Towards automatic per-sonalized content generation for platform games. In: Proceedingsof the AAAI Conference on Artificial Intelligence and InteractiveDigital Entertainment, AAAI Press, pp. 63–68 (2010)

19. Togelius, J., De Nardi, R., Lucas, S.: Towards automatic person-alised content creation for racing games. In: Computational Intel-ligence and Games, 2007. CIG 2007. IEEE Symposium on, IEEE,pp. 252–259 (2007)

20. Togelius, J., Preuss, M., Yannakakis, G.N.: Towards multiobjectiveprocedural map generation. In: Proceedings of the 2010 Workshopon Procedural Content Generation in Games, PCGames ’10, ACM,pp. 3–8 (2010)

21. Voss, R.F.: Random fractal forgeries. In: Fundamental Algorithmsfor Computer Graphics, pp. 805–835. Springer (1985)

22. Zhou, H., Sun, J., Turk, G., Rehg, J.: Terrain synthesis from digitalelevation models. Vis. Comput. Graph. IEEE Trans. 13(4), 834–848 (2007)

123

Page 11: Procedural approach to volumetric terrain generation

Procedural approach to volumetric terrain generation

Aitor Santamaría-Ibirika re-ceived his B.E. in 2010 andhis M.Sc. in Information Secu-rity in 2012 from the Fac-ulty of Engineering at the Uni-versity of Deusto. He is nowa Ph.D. student at DeustoTech(Deusto Institute of Technology)at the University of Deusto. Hisresearch interests include com-puter graphics, procedural gener-ation and artificial intelligence.

Xabier Cantero received hisB.E. in Computer Science and hisB.E. in Industrial Organization in2008 and his M.Sc. in Informa-tion Security in 2010. He is cur-rently conducting his research atDeustoTech (Deusto Institute ofTechnology), a Tecnology Cen-tre associated to Deusto Uni-versity. His research interestsinclude cybersecurity, machine-learning and applied mathemat-ics.

Mikel Salazar received his B.E.in 2008 and his M.Sc. in Infor-mation -Security in 2012 fromthe Faculty of Engineering at theUniversity of Deusto. He is nowa Ph.D. student at DeustoTech(Deusto Institute of Technology)at the University of Deusto. Hisresearch interests include com-puter graphics, augmented real-ity, user interfaces design and vir-tual reality.

Jaime Devesa studied ComputerSciences at the University ofDeusto, Spain. He obtained hismaster’s degree in Security inInformation Systems in 2010. Heis currently a Ph.D. candidatein DeustoTech (Deusto Instituteof Technology) at University ofDeusto. His research interestsinclude cybersecurity, and artifi-cial intelligence.

Igor Santos Ph.D. in com-puter science and artificial intel-ligence, M.Sc. in InformationSecurity. Currently, Head Resea-rcher of the S3lab-ComputingResearch Unit at DeustoTech(Deusto Institute of Technology)of the University of Deusto,where he conducts researchfocused mainly in the areas ofinformation security, malwaredetection, content filtering, nat-ural language processing, infor-mation retrieval methods, opin-ion mining, and applied machinelearning.

Sergio Huerta completed hisPh.D. in mathematics in Feb-ruary 2013 with a dissertationon rational homotopy. He joinedDesutoTech in March 2013. Hisresearch interests include artifi-cial intelligence, machine learn-ing and computational complex-ity. He also teaches at the Facultyof Engineering of the Universityof Deusto.

Pablo G. Bringas Ph.D. in com-puter science and artificial intel-ligence, M.Sc. in telecommuni-cations, M.Sc. in technical infor-matics and software engineer-ing. He is currently Directorat DeustoTech (Deusto Instituteof Technology). Founder of thethe S3lab-Computing ResearchUnit. Lecturer of the Faculty ofEngineering at the University ofDeusto. Director of the M.Sc. onInformation Security.

123