I was looking at this method of generating complex procedural terrains using the GPU: Generating Complex Procedural Terrains Using the GPU.

Has anyone had any luck actually using the algorithm ? If so how do I add the capability to create holes or caves in the terrain at runtime ?

I would think that all that would be needed is to convey to the GPU some information about where the density function should be ignored so as to create gaps or voids, probably via textures.

  • 1
    \$\begingroup\$ How easy something is is a subjective question. If you have a more concrete question about deforming procedural terrain, you should ask that. \$\endgroup\$
    – House
    May 25, 2014 at 15:05
  • \$\begingroup\$ I have reworded it. \$\endgroup\$ May 25, 2014 at 19:44
  • \$\begingroup\$ You probably wouldn't tell the GPU to "ignore" the density field, but rather modify that field itself with a function. Check out Iñigo Quilez's work for some ideas for how you can sculpt a world using mathematical functions. iquilezles.org/www/material/nvscene2008/nvscene2008.htm iquilezles.org/www/index.htm \$\endgroup\$
    – DMGregory
    May 25, 2014 at 20:04

1 Answer 1


The algorithm defined in the document you linked is for generating terrain on the GPU. The data isn't stored in an array that can be easily modified and re-rendered.

Without access to raw data you can manipulate, you're not going to be able to modify the terrain at run time. It's certainly possible to modify the code that generates the terrain, thus changing the terrain. However, it's far more difficult to see the relation between what's being generated on screen and lines of code, than it is to see a tool like a 3D paint brush modifying the terrain directly.

You could heavily modify this code to accept additional parameters that would allow you to create areas of modified density. However, if you're going to be storing data on the CPU side you may as well store everything there, and send the raw data to the GPU to be rendered.

Either way, modifying this existing code to allow for dynamic generation will be a fairly significant undertaking, and you might be better off pursuing alternative methods for procedural generation that don't rely so heavily on the GPU.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .