Marek's blog

Random faults algorithm applied to sphere on GPU using CUDA

Comparison of performance of CPU and GPU implementations of random faults algorithm for random terrain generation. Speedup of GPU over CPU is over 700x. Project uses shared VBO's to avoid CPU-GPU data transfer which makes it an interactive experience.

Figure 1: Examples from this project

Summary

Random faults is an algorithm which was developed for creation of random realistically-looking terrain. It is based on surprisingly simple idea. Chop space by a plane into two parts and displace them by a little bit (slide them). This process will make a step on the terrain that does not look very realistic but interestingly enough if you repeat this chopping process long enough and chopping planes are random, the terrain will eventually look realistic. There will be some mountains, some valleys and even some flat parts.

Random faults algorithm can be applied on nearly any primitive. Usually it is a plane but I decided to apply in on a sphere hoping that I will model some kind of Earth-looking planet. The only problem with Earth it that its diameter is much larger than elevation of mountains (you can't see any mountains from the space). However, the main goal was to measure performance of this algorithm so I am leaving visual evaluation up to you.

Unfortunately, I have never got time to write a detailed article about this project nor upload the code so this is all you get, sorry!

This post is licensed under CC BY 4.0 by the author.

© Marek Fiser. Some rights reserved.

Inspired by the Chirpy theme despite not using Jekyll.