简体   繁体   中英

Perlin Noise for 1D?

Try as hard as I can, I cannot find any real tutorials on Perlin\\Samplex Noise in 1D.

I've searched all around the internet but just cannot find anything. Any sites I do come across mentioning 1D perlin noise are usually very unclear or just shows the code

I know this is an old question but here is one of the clearest explanations about the interpolation between fixed points that makes up 1d Perlin noisehttp://webstaff.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf

One of the most important things to know, useful in all programming is the interpolation function...

http://paulbourke.net/miscellaneous/interpolation/

once you have random points with smoothstep interpolation, you have a kind of smooth 1d noise function.

see smoothstep on wiki. a lot of on the topic via google. https://en.wikipedia.org/wiki/Smoothstep

apparently the hyperlink is unstable, here it is again:

Simplex noise demystified

Ken Perlin presented “simplex noise”, a replacement for his classic noise algorithm. Classic “Perlin noise” won him an academy award and has become an ubiquitous procedural primitive for computer graphics over the years, but in hindsight it has quite a few limitations. Ken Perlin himself designed simplex noise specifically to overcome those limitations, and he spent a lot of good thinking on it. Therefore, it is a better idea than his original algorithm.

A few of the more prominent advantages are:

• Simplex noise has a lower computational complexity and requires fewer multiplications.

• Simplex noise scales to higher dimensions (4D, 5D and up) with much less computational cost, the complexity is for dimensions instead of the of classic Noise.

• Simplex noise has no noticeable directional artifacts.

• Simplex noise has a well-defined and continuous gradient everywhere that can be computed quite cheaply.

• Simplex noise is easy to implement in hardware.

Sadly, even now in early 2005 very few people seem to understand simplex noise, and almost nobody uses it, which is why I wrote this. I will try to explain the algorithm a little more thoroughly than Ken Perlin had time to do in his course notes from Siggraph 2001 and 2002, and hopefully make it clear that it is not as difficult to grasp as it first seems. From what I've learned, what confuses people the most is the impenetrable nature of Ken Perlin's reference implementation in Java. He presents very compact and uncommented code to demonstrate the principle, but that code is clearly not meant to be read as a tutorial. After a few attempts I gave up on the code and read his paper instead, which was a lot more clear.

Not crystal clear, though, as he presents the algorithm mostly in words and code snippets. I would have appreciated some graphs and figures and a few helpful equations, and that's what I try to provide here, to make it easier for others to understand the greatness and beauty of simplex noise. I will also explain things in one and two dimensions first to make things easier to explain with graphs and images, and then move on to three and four dimensions. Classic noise In order to explain simplex noise, it is helpful to have a good understanding of classic Perlin noise. I have seen quite a few bad and misinformed explanations in this area, so to make sure that you have the necessary groundwork done, I will present classic Perlin noise first.

Perlin noise is a so-called gradient noise, which means that you set a pseudo-random gradient at regularly spaced points in space, and interpolate a smooth function between those points. To generate Perlin noise in one dimension, you associate a pseudo-random gradient (or slope) for the noise function with each integer coordinate, and set the function value at each integer coordinate to zero.

For a given point somewhere between two integer points, the value is interpolated between two values, namely the values that would have been the result if the closest linear slopes from the left and from the right had been extrapolated to the point in question. This interpolation is a smoothstep algo.

Late to the party, but it is proven, that a function like below is never periodic.

sin (2 * x) + sin(pi * x)

曲线演示 sin (2 * x) + sin(pi * x)

You can adopt the function in general, eg changing the 2 to 3, squashing the graph in y direction, scaling the x-frequency/periods of the individual sine's, you can also move the individual period by x. Many things, I've made a playground in the link below at geogebra, so you can play around with configurations, see what looks best, etc. The green graph would be the result, the purple graph is if you want the entire function to grow to a theoretical infinity, the orange doted graph is a constant configuration of the function that we see red above, and the yellow lined graph is everything without the scalings. Enjoy!

Hint: You don't need two irrational numbers for a non-periodic function. You could also use the square root of two for example.

https://www.geogebra.org/graphing/yzgxvd8q

您可以使用图表配置什么。

我知道这个问题很旧并且已经得到回答,但是您难道不能只是从2D Perlin噪声中剔除线条,例如,对于x或y始终使用0?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM