Monday, March 12, 2012

More Cities: GPU Final Project Proposal

Procedurally Generating an Infinite City

Procedural generation has always been a topic of interest for me. In the previous year I worked on procedurally generating cities on the CPU (in Maya), and now I feel that this project is a good opportunity to experiment with something similar on the GPU.

Currently there is not much work on generating view-dependent cities, and existing
implementations of GPU-based city generation are limited to commercial software such
as CityEngine. For my project, I plan on writing an application that generates buildings on the fly based on view parameters (and a maximum view distance that will be covered by fog or shadows), basically creating an infinite city.

At the moment I am considering two approaches. The first method would procedurally
generate buildings in CUDA, where the threads are positioned in 2D blocks and each
thread calculates the vertices of the building based on the block and thread indices. These are pushed into vertex buffers, which are shared along with textures with OpenGL for rendering. For each frame, the vertex buffers are sorted from front to back. New buildings are generated when needed, replacing the most distant building when a free vertex buffer is needed. Building height can be randomized using a fractal algorithm, such as the Diamond Square Algorithm which is commonly used in procedural Terrain Generation.

The alternate approach is to ray-march distance fields in a fragment shader using GLSL. In this case, a viewport-aligned quad is rendered using two triangles. No additional geometry is generated; instead, the fragment shader is used to march a ray through each pixel and into a scene described by distance functions across the entire window.

The first step for my project would be to explore both these methods and choose one
that produces the best results. The rest of the project will focus more on the procedural generation and less on individual building, although I hope to add more details as time allows.

References:
Terrain Generation and Smoothing
Experiment: Cityscape with Raymarching
Raymarching Distance Fields
Modeling with Distance Functions
Email correspondence with Patrick

2 comments:

  1. This is definitely getting bookmarked! thanks for the much needed info!Software Project Proposal Template

    ReplyDelete
  2. selection of final project is to be done carefully because selecting wrong project can take lengthy time and can be frustration VU final term Papers

    ReplyDelete