Live data from Hacker News

Fractional Brownian Motion for Terrain Generation

iquilezles.org

11–20 of 29 posts

Re: Fractional Brownian Motion for Terrain Generation

#11
post #7

I'm surprised that he does not mention that, if you can compute FFT really fast, then you can implement all these textures without a loop along the octaves, by simply specifying the spectral decay and using random phases.

do you mean ifft?

Re: Fractional Brownian Motion for Terrain Generation

#13
post #7

I'm surprised that he does not mention that, if you can compute FFT really fast, then you can implement all these textures without a loop along the octaves, by simply specifying the spectral decay and using random phases.

do you mean ifft?

yes, but it's the same algorithm

Re: Fractional Brownian Motion for Terrain Generation

#14

> These movements define paths that are random yet (statistically) selfsimilar, ie, a zoomed-in version of the path resembles the whole path This goes a bit against my intuition of self-similar, but I guess I should interpret "resembles" as *statistically resembles" here as well? Does it mean something like the distribution being the same at all zoom levels?

Yeah if you were to discretize it, then you'd get random walks with the only difference being the variance of movement from the last point. Wish I could find this one source that talked about continuous time noise processes - it was pretty interesting. If you assign a random variable to every point t on a continuum, it's not a real process (in terms of the definitions set forth in Measure Theory), so you have to use other methods to define them, like limits of discrete processes.

Re: Fractional Brownian Motion for Terrain Generation

#15
post #9

If anyone isn't aware of who Iniqo Quilez is, then explore the entire site and follow it up by looking at his work over at Shadertoy (username: iq) and any of his demoscene contributions at http://www.pouet.net and maybe read this fascinating article about his work with Pixar on Brave: http://www.cgw.com/Publications/CGW/2012/Volume-35-Issue-4-J...

Note that Shadertoy could very well crash your browser.

Re: Fractional Brownian Motion for Terrain Generation

#16

Earlier quoted context omitted.

do you mean ifft?

yes, but it's the same algorithm

yes but i'm asking about what you were really trying to say - are you trying to say one can generate these textures by specifying a filter (transfer function or whatever you want to call it) with a random phase component? and then take ifft to get the definition in space?

Re: Fractional Brownian Motion for Terrain Generation

#17

Earlier quoted context omitted.

yes, but it's the same algorithm

yes but i'm asking about what you were really trying to say - are you trying to say one can generate these textures by specifying a filter (transfer function or whatever you want to call it) with a random phase component? and then take ifft to get the definition in space?

If I understand this correctly, it's not even a matter of using a filter, just a case of summing some random sinusoids with an appropriate weighting for each according to the frequency. You can do this by starting off with noise in the frequency domain and shaping it before doing an iFFT.

Re: Fractional Brownian Motion for Terrain Generation

#19
The code examples have me confused because they return a single sample at a time, but if noise is to have the kind of different characteristics discussed at different scales, individual sample values cannot be independent of previous sample values.

I guess the provided code examples must return values which are ordered somehow by properties of the `noise` function, which must involve some memory of previously given values. But this function is described as:

>some noise function of our choice... the choice doesn't matter much

The nature of that function is really essential, if it has any independent random distribution, the examples will just return values with an independent random distribution that is bell or triangular or spike shaped.

The basic method of creating a sequence which has different variability at difference scales is to create separate random walks, scale (resample) them and then sum them together. This can be optimized by generating the component walks (with different scales) on the fly, but there is no way to create such a sequence on the fly from a function which returns values which are independent of the sequences previous values.

Re: Fractional Brownian Motion for Terrain Generation

#20
This reminds me of the time I generated (2d) terrain for a game by toggling a random bit every time I computed a new value in the height map. The bit controlled the second derivative of the height map; 1 for +1, 0 for -1. Also every time the terrain height fell outside the clamp bounds, it would "bounce" (its first derivative would switch sign). It produced decent "rocky" terrain for a cave which is what I was going for.
Post reply on HN