CALIFORNIA STATE UNIVERSITY, NORTHRIDGE Procedural
Total Page:16
File Type:pdf, Size:1020Kb
CALIFORNIA STATE UNIVERSITY, NORTHRIDGE Procedural Generation of Planetary-Scale Terrains in Virtual Reality A thesis submitted in partial fulfillment of the requirements For the degree of Master of Science in Software Engineering By Ryan J. Vitacion December 2018 The thesis of Ryan J. Vitacion is approved: __________________________________________ _______________ Professor Kyle Dewey Date __________________________________________ _______________ Professor Taehyung Wang Date __________________________________________ _______________ Professor Li Liu, Chair Date California State University, Northridge ii Acknowledgment I would like to express my sincere gratitude to my committee chair, Professor Li Liu, whose guidance and enthusiasm were invaluable in the development of this thesis. I would also like to thank Professor George Wang and Professor Kyle Dewey for agreeing to be a part of my committee and for their support throughout this research endeavor. iii Dedication This work is dedicated to my parents, Alex and Eppie, whose endless love and support made this thesis possible. I would also like to dedicate this work to my sister Jessica, for her constant encouragement and advice along the way. I love all of you very dearly, and I simply wouldn’t be where I am today without you by my side. iv Table of Contents Signature Page.....................................................................................................................ii Acknowledgment................................................................................................................iii Dedication...........................................................................................................................iv List of Tables.....................................................................................................................vii List of Figures...................................................................................................................viii List of Illustrations..............................................................................................................ix Abstract................................................................................................................................x Chapter 1: Introduction........................................................................................................1 Background..............................................................................................................1 Objective..................................................................................................................3 Chapter 2: Overview of Procedural Terrain Generation......................................................4 Heightmaps..............................................................................................................5 Noise........................................................................................................................6 Chapter 3: Procedurally Generating a Planet.......................................................................9 Spherical Terrains....................................................................................................9 Chapter 4:Noise Algorithms Tested...................................................................................12 Value Noise............................................................................................................12 Cubic Noise............................................................................................................13 Perlin Noise............................................................................................................14 Simplex Noise........................................................................................................15 Diamond Square Algorithm...................................................................................16 v Chapter 5: Technical Approach.........................................................................................18 Chapter 6: Noise Benchmarking........................................................................................20 The NoiseBenchmark Program..............................................................................20 Testing Methodology.............................................................................................22 Chapter 7: Benchmark Results...........................................................................................25 Computational Complexity....................................................................................25 Memory Usage.......................................................................................................30 Hardware Dependence...........................................................................................35 Overall Recommendations.....................................................................................44 Chapter 8: Rendering Procedural Planets in VR................................................................45 Achieving Planetary Scale.....................................................................................45 The Rendering Prototype.......................................................................................49 Output Quality Samples.........................................................................................51 Chapter 9: Conclusion........................................................................................................58 Further Work..........................................................................................................59 References..........................................................................................................................61 Appendix: Data Averages..................................................................................................63 vi List of Tables Table 1: NoiseBenchmark Parameters...............................................................................21 Table 2: Test System Specifications..................................................................................35 Table 3: Hardware Dependence Summary........................................................................43 Table 4: Output Quality Comparison.................................................................................57 vii List of Figures Figure 1: Generation Time vs. Octaves.............................................................................26 Figure 2: Generation Time vs. Resolution.........................................................................28 Figure 3: Memory Usage vs. Resolution...........................................................................31 Figure 4: Heightmap Memory Usage as Percentage of Heap............................................33 Figure 5: Value Noise Hardware Comparison...................................................................36 Figure 6: Cubic Noise Hardware Comparison...................................................................37 Figure 7: Perlin Noise Hardware Comparison...................................................................39 Figure 8: Simplex Noise Hardware Comparison...............................................................40 Figure 9: Diamond Square Hardware Comparison............................................................42 viii List of Illustrations Illustration 1: A Procedurally Generated Terrain With the Mesh Visible...........................4 Illustration 2: White Noise vs. Coherent Noise...................................................................6 Illustration 3: Mandelbrot Fractal vs. Satellite Image of the Nile River.............................8 Illustration 4: Icosahedral Approximation of a Sphere......................................................10 Illustration 5: Value Noise.................................................................................................12 Illustration 6: Cubic Noise.................................................................................................13 Illustration 7: Perlin Noise.................................................................................................14 Illustration 8: Simplex Noise.............................................................................................15 Illustration 9: Diamond Square Noise................................................................................16 Illustration 10: The NoiseBenchmark GUI........................................................................20 Illustration 11: Simplex, 4 Octaves vs Diamond Square...................................................27 Illustration 12: Varying Levels of Detail...........................................................................46 Illustration 13: Quadtree Parent Node With Two Children...............................................47 Illustration 14: Pole Compression and Edge Seams..........................................................50 Illustration 15: Value Noise VR Sample...........................................................................52 Illustration 16: Cubic Noise VR Sample...........................................................................53 Illustration 17: Perlin Noise VR Sample...........................................................................54 Illustration 18: Simplex Noise VR Sample........................................................................55 Illustration 19: Diamond Square VR Sample....................................................................56