**1**

###
#1
Members - Reputation: **127**

Posted 06 May 2012 - 10:48 AM

Obviously this is not coherent and I need to interpolate to get something similar to this:

Most sources such as this explain how to do it one dimension but don't in two. Quote: "You can, of course, do the same in 2 dimensions." So could someone explain the concept of how linear interpolation works in two dimensions?

Thanks.

###
#2
Moderators - Reputation: **11854**

Posted 06 May 2012 - 04:44 PM

###
#3
Members - Reputation: **127**

Posted 06 May 2012 - 05:02 PM

You interpolate the top-left and top-right corner values based on the x coordinate, interpolate the bottom-left and bottom-right corners based on the x coordinate, then interpolate these two intermediate values based on the y coordinate.

What do you mean by "corner values"? The octaves are made up of multiple squares. Am I getting the corner values of those squares? Wouldnt they be the same value then? Could you explain what you mean by this?

**Edited by ProgrammerGuy123, 06 May 2012 - 05:03 PM.**

###
#4
Members - Reputation: **1416**

Posted 06 May 2012 - 09:46 PM

###
#5
Moderators - Reputation: **11854**

Posted 06 May 2012 - 10:02 PM

Imagine a 2d lattice of points. Each grid lattice intersection is assigned some value of noise (how this value is generated is irrelevant; it could be Perlin's gradient noise, it could be value noise like in the Hugo Elias page, whatever). Now, for any real-value coordinate location on the 2D plane, you can find the 4 grid lattice points that form a square enclosing that point. Interpolate these 4 values to get the value for the point under consideration.

Once you can generate a single layer of noise, then you can start summing/multiplying/whatever multiple octaves of noise to generate a fractal.

###
#6
Members - Reputation: **125**

Posted 07 May 2012 - 11:01 AM

2d interpolation is called biinear interpolation

You can find the all the details here:

http://en.wikipedia.org/wiki/Bilinear_interpolation

###
#7
Crossbones+ - Reputation: **4888**

Posted 08 May 2012 - 12:26 AM

Perhaps I'm being just nitpicky but this does not appear to be perlin noise at all. The source you mentioned uses the term "perlin noise" but it in fact writes about random noise and FBM. Noise has to be interpolated, perlin noise does not, as it is completely continuous function.

Obviously this is not coherent and I need to interpolate to get something similar to this:

But ok, if you want to make it look like perlin noise, at least please use the correct interpolator function.

Some more correct sources:

Improved perlin noise implementation. Let's leave out simplex noise for a second as it's mathematical details are still beyond me.This has linear interpolation and weight computing function using the old interpolant.

Implementing improved perlin noise. New interpolant. Further explanations on multi-linear interpolation.

Previously "Krohm"