Terrain Synthesis Using Noise Tuomo Hyttinen

Total Page:16

File Type:pdf, Size:1020Kb

Terrain Synthesis Using Noise Tuomo Hyttinen Terrain synthesis using noise Tuomo Hyttinen University of Tampere Faculty of Natural Sciences Computer Science M.Sc. Thesis Supervisor: Timo Poranen May 2017 University of Tampere Faculty of Natural Sciences Computer Science Tuomo Hyttinen: Terrain synthesis using noise M.Sc. thesis, 51 pages May 2017 Noise functions are versatile base functions used in many procedural generation methods. They can produce natural-like patterns usable in procedural textures, models and animations. They have been extensively adapted in procedural terrain implementations in games and other applications. Noise-based procedural terrains offer many advantages over static terrain models but designing such terrains is largely unintuitive by nature. Whereas traditional terrain models can be designed, e.g., in spatial editors, procedural terrains are implemented in algorithms. The purpose of this thesis is firstly to evaluate noise functions in the context of procedural terrain generation and especially example based procedural terrain synthesis. Secondly, a novel example based procedural terrain synthesis method is presented. A prototype application implementing the method was also constructed and evaluated. The prototype is a practical solution for example based procedural terrain design, aiming to bridge the gap between intuitive virtual terrain design and the advantages of procedural terrain functions. Key words and terms: noise, procedural terrains, example-based terrain synthesis Contents 1. Introduction......................................................................................................................................1 2. Noise function fundamentals...........................................................................................................4 2.1. Defining noise..........................................................................................................................4 2.2. Simple value noise function.....................................................................................................5 2.3. Comparison to other methods..................................................................................................9 2.4. Noise classifications..............................................................................................................10 3. Noise functions...............................................................................................................................11 3.1. Perlin noise.............................................................................................................................11 3.2. Simplex noise.........................................................................................................................13 3.3. Wavelet noise.........................................................................................................................15 3.4. Worley noise..........................................................................................................................18 3.5. Gabor noise............................................................................................................................18 3.6. Comparison of the noise functions........................................................................................19 4. Related work on procedural generation.........................................................................................21 4.1. Noise-based procedural terrains.............................................................................................21 4.2. Procedural noise by example.................................................................................................23 5. Procedural terrain by example.......................................................................................................26 5.1. Fractal sum and turbulence....................................................................................................26 5.2. Noise redistribution................................................................................................................27 5.3. Reference height maps...........................................................................................................28 5.4. Extracting and reproducing terrain features...........................................................................29 5.4.1. Generating noise layer....................................................................................................29 5.4.2. Automatic layer masking................................................................................................33 5.4.3. Procedural terrain storage format...................................................................................35 5.5. From height map to terrain model.........................................................................................37 5.6. User interface for procedural terrain design..........................................................................39 5.7. Result assessment..................................................................................................................42 6. Conclusions....................................................................................................................................47 1 1. Introduction Noise is a function that takes an n-dimensional point, typically n=1, n=2 or n=3 and returns a real number [Perlin, 2001]. It's pseudo-random by nature, meaning that the result appears to be random, but given the same input coordinates the function always returns the same value. Noise is continuous and non-periodic – it covers the entirety of n-space without seams or repetition [Lagae et al., 2010a]. Depending on the noise implementation and parameters, various patterns can be seen in the result. For example, by using a two-dimensional noise one could produce a grayscale image that has seemingly random lighter and darker areas, with smooth transitions in between. Procedural noise can be used for creating patterns automatically and on the fly, rather than, for example, drawing a texture by hand [Smelik et al., 2009]. They often require very little memory to be executed and are randomly accessible, meaning that they can be evaluated independently for each input point. The random access feature, among its other benefits, makes extensive parallelism possible [Lagae et al., 2010a]. Perlin noise is a widely used and referenced noise function that was originally designed by Ken Perlin related to his work with the special effects in Disney's science fiction film Tron in 1982. Later Perlin was awarded an Oscar for his work with computer generated imagery in movies. Perlin noise was originally designed for creating textures [Perlin, 1985], but noise functions also have usages in many other areas of computer graphics. Procedural generation, often utilizing Perlin noise and other noise functions, is widely used today in software. Noise functions have been used for creating natural-like content such as textures, models and animations in 3D modeling software, animation films and other computer graphics applications [Lagae et al., 2010a]. In games it has been used for decades for creating large game worlds [Smelik et al., 2009]. Noise functions are often used in games for creating large virtual worlds, including their terrain topology, texturing and cave systems etc. [Santamaría-Ibirika et al., 2014]. Minecraft, released in 2011, is perhaps today's most well known example of using noise functions and procedural terrain generation in games. It's the best selling video game of all time, having sold over hundred million copies world wide (including mobile, pc and console versions sales) [Hill, 2016]. It features a near-infinite procedurally generated world. As seen in Figure 1, the game world features a variety of visually distinct, procedurally generated landscapes. The game world is created by using several 2 and 3- dimensional Perlin noise functions [Persson, 2011]. Because of the procedural noise based approach the terrain can be generated in chunks as the player advances in the game world and the resulting terrain is the same regardless of, say, from which direction the player approaches a certain area. There are also many other voxel-based games with procedurally generated worlds – a popular gaming platform Steam even lists “Procedural generation” as its own genre of games. Especially indie-developers seem to have adopted procedural generation. It makes creating large, interesting game worlds possible without the massive work of designing and modeling them manually. 2 Figure 1: Procedural terrain examples from Minecraft (left) and No Man's Sky (right) [http://minecraft.gamepedia.com, http://nomanssky.gamepedia.com]. No Man's Sky (2016), also an indie game, is another example of extensive use of procedural generation. It was four years in production and highly anticipated before release. The game world of No Man's sky is an entire universe, containing 18 quintillion planets that can be visited by player [Parkin, 2014]. Planets in turn are procedurally generated, each containing a planet sized world to explore. Examples of the procedurally generated terrain are shown in Figure 1. The game can be considered a commercial success [Yin-Poole, 2016], but it received crushingly negative reviews shortly after release mostly due perceived lack of promised gameplay features. Despite its shortcomings it can still be considered a prime example of the possibilities of procedural generation in games. The enormously
Recommended publications
  • Fast, High Quality Noise
    The Importance of Being Noisy: Fast, High Quality Noise Natalya Tatarchuk 3D Application Research Group AMD Graphics Products Group Outline Introduction: procedural techniques and noise Properties of ideal noise primitive Lattice Noise Types Noise Summation Techniques Reducing artifacts General strategies Antialiasing Snow accumulation and terrain generation Conclusion Outline Introduction: procedural techniques and noise Properties of ideal noise primitive Noise in real-time using Direct3D API Lattice Noise Types Noise Summation Techniques Reducing artifacts General strategies Antialiasing Snow accumulation and terrain generation Conclusion The Importance of Being Noisy Almost all procedural generation uses some form of noise If image is food, then noise is salt – adds distinct “flavor” Break the monotony of patterns!! Natural scenes and textures Terrain / Clouds / fire / marble / wood / fluids Noise is often used for not-so-obvious textures to vary the resulting image Even for such structured textures as bricks, we often add noise to make the patterns less distinguishable Ех: ToyShop brick walls and cobblestones Why Do We Care About Procedural Generation? Recent and upcoming games display giant, rich, complex worlds Varied art assets (images and geometry) are difficult and time-consuming to generate Procedural generation allows creation of many such assets with subtle tweaks of parameters Memory-limited systems can benefit greatly from procedural texturing Smaller distribution size Lots of variation
    [Show full text]
  • Prime Gradient Noise
    Computational Visual Media https://doi.org/10.1007/s41095-021-0206-z Research Article Prime gradient noise Sheldon Taylor1,∗, Owen Sharpe1,∗, and Jiju Peethambaran1 ( ) c The Author(s) 2021. Abstract Procedural noise functions are fundamental 1 Introduction tools in computer graphics used for synthesizing virtual geometry and texture patterns. Ideally, a Visually pleasing 3D content is one of the core procedural noise function should be compact, aperiodic, ingredients of successful movies, video games, and parameterized, and randomly accessible. Traditional virtual reality applications. Unfortunately, creation lattice noise functions such as Perlin noise, however, of high quality virtual 3D content and textures exhibit periodicity due to the axial correlation induced is a labour-intensive task, often requiring several while hashing the lattice vertices to the gradients. months to years of skilled manual labour. A In this paper, we introduce a parameterized lattice relatively cheap yet powerful alternative to manual noise called prime gradient noise (PGN) that minimizes modeling is procedural content generation using a discernible periodicity in the noise while enhancing the set of rules, such as L-systems [1] or procedural algorithmic efficiency. PGN utilizes prime gradients, a noise [2]. Procedural noise has proven highly set of random unit vectors constructed from subsets of successful in creating computer generated imagery prime numbers plotted in polar coordinate system. To (CGI) consisting of 3D models exhibiting fine detail map axial indices of lattice vertices to prime gradients, at multiple scales. Furthermore, procedural noise PGN employs Szudzik pairing, a bijection F : N2 → N. is a compact, flexible, and low cost computational Compositions of Szudzik pairing functions are used in technique to synthesize a range of patterns that may higher dimensions.
    [Show full text]
  • Coherent Noise
    Coherent Noise User manual Table of Contents Introduction...........................................................................................5 Chapter I. .............................................................................................6 Noise Basics........................................................................................6 Combining Noise. ................................................................................8 CoherentNoise library...........................................................................9 Chapter II............................................................................................12 Noise generators................................................................................12 Generator base class.......................................................................12 ValueNoise.....................................................................................13 GradientNoise................................................................................14 ValueNoise2D and GradientNoise2D...................................................16 Constant.......................................................................................16 Function........................................................................................17 Cache...........................................................................................17 Patterns........................................................................................18 Cylinders....................................................................................18
    [Show full text]
  • Package 'Ambient'
    Package ‘ambient’ March 21, 2020 Type Package Title A Generator of Multidimensional Noise Version 1.0.0 Maintainer Thomas Lin Pedersen <[email protected]> Description Generation of natural looking noise has many application within simulation, procedural generation, and art, to name a few. The 'ambient' package provides an interface to the 'FastNoise' C++ library and allows for efficient generation of perlin, simplex, worley, cubic, value, and white noise with optional pertubation in either 2, 3, or 4 (in case of simplex and white noise) dimensions. License MIT + file LICENSE Encoding UTF-8 SystemRequirements C++11 LazyData true Imports Rcpp (>= 0.12.18), rlang, grDevices, graphics LinkingTo Rcpp RoxygenNote 7.1.0 URL https://ambient.data-imaginist.com, https://github.com/thomasp85/ambient BugReports https://github.com/thomasp85/ambient/issues NeedsCompilation yes Author Thomas Lin Pedersen [cre, aut] (<https://orcid.org/0000-0002-5147-4711>), Jordan Peck [aut] (Developer of FastNoise) Repository CRAN Date/Publication 2020-03-21 17:50:12 UTC 1 2 ambient-package R topics documented: ambient-package . .2 billow . .3 clamped . .4 curl_noise . .4 fbm .............................................6 fracture . .7 gen_checkerboard . .8 gen_spheres . .9 gen_waves . 10 gradient_noise . 11 long_grid . 12 modifications . 13 noise_cubic . 14 noise_perlin . 15 noise_simplex . 17 noise_value . 19 noise_white . 20 noise_worley . 21 ridged . 24 trans_affine . 25 Index 27 ambient-package ambient: A Generator of Multidimensional Noise Description Generation of natural looking noise has many application within simulation, procedural generation, and art, to name a few. The ’ambient’ package provides an interface to the ’FastNoise’ C++ library and allows for efficient generation of perlin, simplex, worley, cubic, value, and white noise with optional pertubation in either 2, 3, or 4 (in case of simplex and white noise) dimensions.
    [Show full text]
  • Noisy Gradient Meshes Procedurally Enriching Vector Graphics Using Noise
    Noisy Gradient Meshes Procedurally Enriching Vector Graphics using Noise Bachelor Thesis Rowan van Beckhoven Computer Science Faculty of Science and Engineering University of Groningen July 2018 Supervisors: Jirˇ´ı Kosinka Gerben Hettinga Abstract Vector graphics is a powerful approach for representing scalable illustrations. These vector graphics are composed of primitives which define an image. Existing high-level vector graphics primitives are able to model smooth colour tran- sitions well and can be used to vectorise raster images which feature large regions with constant or slowly changing colour gradients. However, when applied to natural images, these methods often result in many small gradient primitives due to high frequency regions present in the image. Working with many gradient primitives becomes a tedious process and thus a solution has to be found in which a high level of detail can be achieved while the underlying mesh remains simple. Procedural noise has been used for texture synthesis before, but it is rarely used in combination with vector graphic primitives. In this research, a gradient mesh is combined with a procedural noise function. i Contents 1 Introduction1 1.1 Gradient Mesh..................................1 1.2 Noise.......................................3 1.2.1 Perlin Noise................................4 1.2.2 Worley Noise...............................4 1.3 Structure of this Thesis..............................5 2 Related Work6 3 Problem Statement8 4 Approach9 5 Implementation 10 5.1 Gradient Mesh Framework............................ 10 5.1.1 Halfedge Structure............................ 10 5.1.2 Framework Extensions.......................... 11 5.2 Pipeline...................................... 12 5.2.1 Noise Field Generation.......................... 13 5.2.2 Distortion................................. 14 5.2.3 Filtering.................................. 15 5.2.4 Colour Mapping............................
    [Show full text]
  • Better Gradient Noise
    1 Better Gradient Noise Andrew Kensler, Aaron Knoll and Peter Shirley UUSCI-2008-001 Scientific Computing and Imaging Institute University of Utah Salt Lake City, UT 84112 USA April 8, 2008 Abstract: We present three improvements to Perlin’s gradient noise algorithm. First, a small change in the permutation hash function combined with separate pseudorandom tables yields significantly better axial decorrelation. Second, a modification to the reconstruction kernel approximating a global higher-order differencing operator produces better bandlimitation. Third, the quality of 2D surfaces using solid 3D noise is improved by reconstructing the stencil projected onto a surface normal. These three techniques are mutually orthogonal, generalize to higher dimensions, and are applicable to nearly any gradient noise, including simplex noise. Combining them yields a desirable Fourier spectrum for graphics applications. SCI Institute Technical Report No. UUSCI-2008-001 Better Gradient Noise Andrew Kensler Aaron Knoll Peter Shirley SCI Institute, University of Utah SCI Institute, University of Utah NVIDIA Corporation (a) (b) (c) (d) (e) (f) (A) (B) (C) (D) (E) (F) Figure 1: Detail of images and associated Fourier transforms of (a) 2D Perlin noise with standard hash function, quintic interpolant and 256-entry gradient table, (b) 2D Perlin noise with our xor hash function from Section 2, (c) 2D noise with our extended reconstruction kernel from Section 3, (d) Slice of our 3D noise along plane normal to x = y = z, (e) Same planar slice with our projection method from Section 4, (f) Same planar slice and projection method with faster half-resolution grid. All 2D transforms computed from full repetitions.
    [Show full text]
  • Procedural Cave Generation Juncheng Cui University of Wollongong
    University of Wollongong Research Online University of Wollongong Thesis Collection University of Wollongong Thesis Collections 2011 Procedural cave generation Juncheng Cui University of Wollongong Recommended Citation Cui, Juncheng, Procedural cave generation, Master of Computer Science - Research thesis, University of Wollongong, University of Wollongong, 2011. http://ro.uow.edu.au/theses/3493 Research Online is the open access institutional repository for the University of Wollongong. For further information contact Manager Repository Services: [email protected]. i Procedural Cave Generation Juncheng CUI "This thesis is presented as part of the requirements for the award of Master of Computer Science - Research from the University of Wollongong" August 2011 ii Dedicated to Shiqing Cui and Shujuan Shi iii DECLARATION I, Juncheng Cui, declare that this thesis, submitted in partial fulfilment of the requirements for the award of Master of Computer Science – Research, in the School of Computer Science and Software Engineering, University of Wollongong, is wholly my own work unless otherwise referenced or acknowledged. The document has not been submitted for qualifications at any other academic institution. __________________ Juncheng Cui Date: iv ABSTRACT Procedural content generation is becoming an increasingly popular research area as a means of algorithmically generating scene content for virtual environments. The automated generation of such content avoids the manual labour typically associated with creating scene content, and is extremely useful in application areas such as computer graphics, virtual reality, movie production and video games. While virtual 3D caves are commonly featured in these virtual environment applications, procedural cave generation is not an area that has received much attention among the research community to date.
    [Show full text]
  • Polynomial Methods for Fast Procedural Terrain Generation
    Polynomial methods for fast Procedural Terrain Generation Yann Thorimbert Bastien Chopard [email protected] December 6, 2018 Abstract A new method is presented, allowing for the generation of 3D ter- rain and texture from coherent noise. The method is significantly faster than prevailing fractal brownian motion approaches, while producing results of equivalent quality. The algorithm is derived through a sys- tematic approach that generalizes to an arbitrary number of spatial dimensions and gradient smoothness. The results are compared, in terms of performance and quality, to fundamental and efficient gradi- ent noise methods widely used in the domain of fast terrain generation: Perlin noise and OpenSimplex noise. Finally, to objectively quantify the degree of realism of the results, a fractal analysis of the generated landscapes is performed and compared to real terrain data. 1 Introduction Procedural terrain generation (PTG) methods have grown in number in the last decades due to the increasing performances of computers; video games, movies and animation find obvious use of PTG, for terrain generation as well as for texture generation. However, a less evident use of PTG can be found in more practical domains, as for instance vehicle dynamics [7] or military training [37, 36], where accurate methods for emulating real ter- rain are of interest. More generally, one can also mention the use made of procedural coherent noise in the field of fluid animation [3, 24], which arXiv:1610.03525v4 [cs.GR] 5 Dec 2018 helps to improve performances of turbulence modeling. The main advan- tages of procedural noise compared to non-procedural noise generation is both an immensely decreased memory demand and an increased amount of content produced.
    [Show full text]
  • Rendering Algorithms
    1 Solid and procedural textures 15-468, 15-668, 15-868 Physics-based Rendering http://graphics.cs.cmu.edu/courses/15-468 Spring 2021, Lecture 6 2 Course announcements • Take-home quiz 2 posted, due next Tuesday at 23:59. • Programming assignment 1 posted, due Friday 2/26 at 23:59. - How many of you have looked at/started/finished it? - Any questions? • Weekly reading groups. - Make sure to complete the poll on Piazza: https://piazza.com/class/kklw0l5me2or4?cid=30 3 Overview of today’s lecture • Go over take-home quiz 1. • 3D textures. • Procedural textures. • Generating “realistic noise”. 4 Slide credits Most of these slides were directly adapted from: • Wojciech Jarosz (Dartmouth). 3D textures Texture is a function of (u, v, w) - can just evaluate texture at 3D surface point - good for solid materials - often defined procedurally [Wolfe SG97] 5 Procedural texturing Instead of using rasterized image data, define texture procedurally Simple example: - color = 0.5*sin(x) + 0.5 Often called “solid texturing” because texture can easily vary in all 3 dimensions. - but you can also do 2D or 1D procedural textures 6 Raster vs. procedural textures Why use procedural textures? - low memory usage - infinite resolution - solid texture: no need to parametrize surface 7 3D stripe texture color stripe(point p): if (sin(px) > 0) return c0 else return c1 8 3D stripe texture color stripe(point p, real w): if (sin(πpx/w) > 0) return c0 else return c1 9 3D stripe texture color stripe(point p, real w): t = (1 + sin(π px/w))/2 return lerp(c0, c1, t) 10 2D
    [Show full text]
  • Prime Gradient Noise
    Computational Visual Media https://doi.org/10.1007/s41095-021-0206-z Vol. 7, No. 3, September 2021, 349–362 Research Article Prime gradient noise Sheldon Taylor1,∗, Owen Sharpe1,∗, and Jiju Peethambaran1 ( ) c The Author(s) 2021. Abstract Procedural noise functions are fundamental 1 Introduction tools in computer graphics used for synthesizing virtual geometry and texture patterns. Ideally, a Visually pleasing 3D content is one of the core procedural noise function should be compact, aperiodic, ingredients of successful movies, video games, and parameterized, and randomly accessible. Traditional virtual reality applications. Unfortunately, creation lattice noise functions such as Perlin noise, however, of high quality virtual 3D content and textures exhibit periodicity due to the axial correlation induced is a labour-intensive task, often requiring several while hashing the lattice vertices to the gradients. months to years of skilled manual labour. A In this paper, we introduce a parameterized lattice relatively cheap yet powerful alternative to manual noise called prime gradient noise (PGN) that minimizes modeling is procedural content generation using a discernible periodicity in the noise while enhancing the set of rules, such as L-systems [1] or procedural algorithmic efficiency. PGN utilizes prime gradients, a noise [2]. Procedural noise has proven highly set of random unit vectors constructed from subsets of successful in creating computer generated imagery prime numbers plotted in polar coordinate system. To (CGI) consisting of 3D models exhibiting fine detail map axial indices of lattice vertices to prime gradients, at multiple scales. Furthermore, procedural noise PGN employs Szudzik pairing, a bijection F : N2 → N. is a compact, flexible, and low cost computational Compositions of Szudzik pairing functions are used in technique to synthesize a range of patterns that may higher dimensions.
    [Show full text]
  • Hardware-Accelerated Gradient Noise for Graphics
    Hardware-Accelerated Gradient Noise for Graphics Josef B. Spjut Andrew E. Kensler Erik L. Brunvand School of Computing SCI Institute School of Computing University of Utah University of Utah University of Utah [email protected] [email protected] [email protected] ABSTRACT techniques trade computation for memory. This is impor- A synthetic noise function is a key component of most com- tant since as process technology scales, compute resources puter graphics rendering systems. This pseudo-random noise will increasingly outstrip memory speeds. For texturing sur- function is used to create a wide variety of natural looking faces, the memory reduction can be two-fold: first there textures that are applied to objects in the scene. To be is the simple reduction in texture memory itself. Second, useful, the generated noise should be repeatable while ex- 3D or \solid" procedural textures can eliminate the need for hibiting no discernible periodicity, anisotropy, or aliasing. explicit texture coordinates to be stored with the models. However, noise with these qualities is computationally ex- However, in order to avoid uniformity and produce visual pensive and results in a significant fraction of the run time richness, a simple, repeatable, pseudo-random function is for scenes with rich visual complexity. We propose modifi- required. Noise functions meet this need. Simply described, a noise function in computer graphics cations to the standard algorithm for computing synthetic N noise that improve the visual quality of the noise, and a par- is an R ! R mapping used to introduce irregularity into allel hardware implementation of this improved noise func- an otherwise regular pattern.
    [Show full text]
  • Terrain Synthesis Using Noise
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Trepo - Institutional Repository of Tampere University Terrain synthesis using noise Tuomo Hyttinen University of Tampere Faculty of Natural Sciences Computer Science M.Sc. Thesis Supervisor: Timo Poranen May 2017 University of Tampere Faculty of Natural Sciences Computer Science Tuomo Hyttinen: Terrain synthesis using noise M.Sc. thesis, 51 pages May 2017 Noise functions are versatile base functions used in many procedural generation methods. They can produce natural-like patterns usable in procedural textures, models and animations. They have been extensively adapted in procedural terrain implementations in games and other applications. Noise-based procedural terrains offer many advantages over static terrain models but designing such terrains is largely unintuitive by nature. Whereas traditional terrain models can be designed, e.g., in spatial editors, procedural terrains are implemented in algorithms. The purpose of this thesis is firstly to evaluate noise functions in the context of procedural terrain generation and especially example based procedural terrain synthesis. Secondly, a novel example based procedural terrain synthesis method is presented. A prototype application implementing the method was also constructed and evaluated. The prototype is a practical solution for example based procedural terrain design, aiming to bridge the gap between intuitive virtual terrain design and the advantages of procedural terrain functions. Key words
    [Show full text]