Voxel-Space Shape Grammars

Voxel-Space Shape Grammars

Voxel-Space Shape Grammars by Zacharia Crumley Supervisors: Patrick Marais James Gain A thesis submitted to THE DEPARTMENT OF COMPUTER SCIENCE, FACULTY OF SCIENCE, UNIVERSITY OF CAPE TOWN in fulfillment of the requirements for the degree of MASTER OF SCIENCE August 28, 2012 Plagiarism Declaration I know the meaning of Plagiarism and declare that all of the work in this doc- ument, save for that which is properly acknowledged, is my own. i Abstract The field of Procedural Generation is being increasingly used in modern content generation for its ability to significantly decrease the cost and time involved. One such area of Procedural Generation is Shape Grammars, a type of formal grammar that operates on geometric shapes instead of symbols. Conventional shape grammar implementations use mesh representations of shapes, but this has two significant drawbacks. Firstly, mesh representations make Boolean geometry operations on shapes difficult to accomplish. Boolean geometry operations allow us to combine shapes using Boolean operators (and, or, not), producing complex, composite shapes. A second drawback is that sub-, or trans-shape detailing is challenging to achieve. To address these two problems with conventional mesh-based shape grammars, we present a novel extension to shape grammars, in which a voxel representation of the generated shapes is used. We outline a five stage algorithm for using these extensions and discuss a number of optional enhancements and optimizations. The final output of the algorithm is a detailed mesh model, suitable for use in real-time or offline graph- ics applications. We also test our extension's performance and range of output with three categories of testing: performance testing, output range testing, and variation testing. The results of the testing with our proof-of-concept implementation show that our unoptimized algorithm is slower than conventional shape grammar implementations, with a running time that is O(N 3) for an N 3 voxel grid. However, there is scope for further optimization to our algorithm, which would significantly reduce running times and memory consumption. We outline and discuss several such avenues for performance enhancement. Additionally, testing reveals that our algorithm is able to successfully pro- duce a broad range of detailed outputs, exhibiting many features that would be very difficult to accomplish using mesh-based shape grammar implementations. This range of 3D models includes fractals, skyscraper buildings, space ships, castles, and more. Further, stochastic rules can be used to produce a variety of models that share a basic archetype, but differ noticeably in their details. Keywords • Procedural Generation • Shape Grammar • Voxel • Boolean geometry ii Acknowledgements The thankfulness I have towards my family for all their support and assistance along the way can't really be adequately conveyed in words, so I won't try. There were bumps in the road, but with family at your back, it's a much easier journey. James and Patrick: Thank you for the guidance, wisdom, and occasional whip cracking when my chronic laziness infection acted up. A big thank you to my classmates for the camaraderie, technical assistance, help with my algorithms, pub lunches, and providing opportunities to avoid doing work. I would like to thank the anonymous examiners for their suggestions and feed- back on my thesis. The financial assistance of the National Research Foundation (NRF) towards this research is hereby acknowledged. Opinions expressed and conclusions ar- rived at, are those of the authors and are not necessarily to be attributed to the NRF. Funding assistance for this research was also provided by the University of Cape Town. Some of the diagrams and images in this thesis were created by others, licensed under the creative commons licenses, or released into the public domain. Full attribution for these images is included in a section at the end of this thesis, on page 110. The original creators do not necessarily endorse me, this thesis, or my use of their work. I thank the original creators for releasing their images under these licenses, which allow me to make use of their work, saving considerable time that would otherwise have been spent wrestling with Inkscape to make diagrams. Thanks to the developers of the many open source applications that were used along the way in this masters. Your contributions to the Open Source movement are appreciated. iii Contents 1 Introduction 1 1.1 Procedural Generation . .1 1.2 Shape Grammars . .2 1.3 Shape Grammar Deficiencies . .3 1.4 Aims . .5 1.5 Voxels . .5 1.6 Voxel-Space Shape Grammars . .7 1.7 Research Questions and Contributions . .9 1.8 Overview of Thesis . .9 2 Background and Related Work 10 2.1 Procedural Generation . 10 2.1.1 L-systems . 16 2.1.2 Terrain Generation . 18 2.1.3 Texture Creation . 19 2.1.4 Random Level Generation . 22 2.2 Shape Grammars . 23 2.3 Voxels . 26 2.3.1 Voxel Storage . 26 2.3.2 Terrain Representation . 31 2.3.3 3D Texture Generation . 32 2.4 Summary . 32 3 Voxel-Space Shape Grammars 34 3.1 Framework Overview . 34 3.2 Shape Grammar Interpretation . 36 3.2.1 Grammar Interpretation Details . 36 3.2.2 Supported Shapes . 39 3.2.3 Grammar Enhancements and Extensions . 39 3.2.4 Output . 43 3.3 Shape Voxelization . 44 3.3.1 Voxel Storage . 45 3.3.2 Shape Tag Handling . 48 3.3.3 Order of Shape Addition . 48 3.3.4 Manual Editing . 49 3.4 Voxel Detailing . 50 3.4.1 Shape Tag Dependence . 54 3.4.2 Performance . 56 iv CONTENTS v 3.5 Mesh Generation . 56 3.6 Mesh Post-Processing . 58 3.7 Implementation and Optimizations . 60 3.7.1 Voxelization . 60 3.7.2 Voxel Detailing . 61 3.7.3 Storage of Shape Tags and Detailing Information . 61 3.7.4 Mesh Conversion . 62 3.7.5 Large Scale Generation . 62 3.8 Summary . 63 4 Testing and Results 64 4.1 Performance Testing . 65 4.1.1 Testing Setup . 65 4.1.2 Algorithm Running Time . 67 4.1.3 Memory Usage . 71 4.2 Variation Testing . 74 4.3 Output Range Testing . 77 4.4 Limitations . 82 4.4.1 Voxel Grid Size Requirements . 82 4.4.2 Curves and Very Fine Detailing . 83 4.5 Summary . 83 5 Conclusion 85 5.1 Discussion . 86 5.2 Future Work . 87 References 93 A Additional Performance Testing Graphs 94 B Stochastic Shape Grammars 99 B.1 Castle . 99 B.2 Space Station . 103 B.3 Tank . 106 Attribution of Re-used Images 110 List of Figures 1.1 Simple Shape Grammar Example . .3 1.2 Mesh Overview . .4 1.3 Voxel Data Set Example . .6 1.4 Mesh vs. Voxel Comparison . .6 1.5 Boolean Geometry Comparison . .8 2.1 A scene produced by SpeedTree. 11 2.2 A screenshot of the CityEngine software. 12 2.3 Landscape created by Terragen. 12 2.4 Demoscene Example 1 . 13 2.5 Demoscene Example 2 . 14 2.6 Creatures From Spore . 15 2.7 L-System Example . 17 2.8 Perlin noise. 20 2.9 Reaction-diffusion Patterns . 20 2.10 Voronoi Diagram . 21 2.11 Texture Synthesis Example . 22 2.12 Random Dungeon Generated by NetHack . 23 2.13 Example of Bokeloh et al.'s Work . 25 2.14 Space Saving Qualities of Trees for Voxel Storage . 27 2.15 Example Octree . 28 2.16 Point-Region Octree Example . 29 2.17 kd-Tree Example . 30 2.18 R-Tree Example . 30 2.19 3D Voxel Terrain Generated by Minecraft. 31 3.1 Algorithm Overview . 35 3.2 Example of Shape Grammar Interpretation . 37 3.3 Example of Shape Grammar Output . 38 3.4 Symmetry Examples . 42 3.5 Example Shape Grammar: Spiral . 44 3.6 Voxelization Example . 45 3.7 CSG Order Dependency Example . 49 3.8 Example Shape Grammar and Output: Priorities . 50 3.9 Voxel Detailing Example . 51 3.10 Different Detailing Comparison . 54 3.11 Mesh Generation Example . 57 3.12 Mesh Smoothing Comparison . 59 vi LIST OF FIGURES vii 4.1 Grammar Interpretation Times . 68 4.2 Total Algorithm Running Times . 69 4.3 Cumulative Running Times . 70 4.4 Peak Memory Usage . 72 4.5 Average Memory Usage . 73 4.6 Variation Examples 1 . 75 4.7 Variation Examples 2 . 76 4.8 Space Station . 78 4.9 Enterprise Detailed with Rule 110 . 78 4.10 Rectangle Detailed with Rule 30 . 79 4.11 Fractal Tree . 79 4.12 Skyscraper . ..

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    121 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us