Sign in to follow this  

2D Perlin Noise

This topic is 2047 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to create perlin noise but I'm having trouble understanding how interpolation works. I understand how to do it in a single dimension but can't wrap my head around it in two. Right now I have this for an octave:

[img]http://i.imgur.com/XDuly.png[/img]

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

[img]http://i.imgur.com/sgwcJ.png[/img]

Most sources such as [url="http://freespace.virgin.net/hugo.elias/models/m_perlin.htm"]this[/url] 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 [u]linear[/u] interpolation works in two dimensions?

Thanks.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote name='JTippetts' timestamp='1336344285' post='4937893']
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.
[/quote]

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

Share this post


Link to post
Share on other sites
Take a look at the Diamond Square Algorithm. The concept of 2D noise didn't properly gel with me until I read about that, and I ended up implementing it without any problems.

Share this post


Link to post
Share on other sites
To start, don't worry about octaves. Just worry about a single layer of noise.

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.

Share this post


Link to post
Share on other sites
Hello,

2d interpolation is called biinear interpolation

You can find the all the details here:

[url="http://en.wikipedia.org/wiki/Bilinear_interpolation"]http://en.wikipedia.org/wiki/Bilinear_interpolation[/url]

Share this post


Link to post
Share on other sites
[quote name='ProgrammerGuy123' timestamp='1336322883' post='4937805']
[img]http://i.imgur.com/XDuly.png[/img]

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

[img]http://i.imgur.com/sgwcJ.png[/img]
[/quote]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.
But ok, if you want to make it look like perlin noise, at least please use the correct interpolator function.
Some more correct sources:
[url="http://mrl.nyu.edu/~perlin/noise/"]Improved perlin noise implementation[/url]. 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.
[url="http://http.developer.nvidia.com/GPUGems/gpugems_ch05.html"]Implementing improved perlin noise[/url]. New interpolant. Further explanations on multi-linear interpolation.

Share this post


Link to post
Share on other sites

This topic is 2047 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this