一维柏林噪声?

发布于 2024-12-26 01:06:05 字数 107 浏览 1 评论 0原文

尽我所能,我找不到任何关于一维 Perlin\Samplex 噪声的真正教程。

我在互联网上进行了搜索,但找不到任何东西。我遇到的任何提到一维柏林噪声的网站通常都非常不清楚或只显示代码

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

泛泛之交 2025-01-02 01:06:05

虽然迟到了,但事实证明,像下面这样的函数从来都不是周期性的。

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

展示罪恶的曲线(2 * x) + sin(pi * x)

您可以采用一般的函数,例如将 2 更改为 3、在 y 方向上压缩图形、缩放 x -频率/周期对于单个正弦值,您还可以将单个周期移动x。很多事情,我在 geogebra 下面的链接中创建了一个游乐场,因此您可以尝试配置,看看什么看起来最好,等等。绿色图将是结果,紫色图是如果您希望整个函数增长到理论上的无穷大,橙色点图是我们在上面看到的红色函数的常量配置,黄色线图是没有缩放的所有内容。享受!

提示:非周期函数不需要两个无理数。例如,您还可以使用二的平方根。

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

你可以做什么使用图表进行配置。

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

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

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

You can adopt the function in general, e.g. 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

What you Can Configure using the graph.

挽你眉间 2025-01-02 01:06:05

我知道这是一个老问题,但这是关于构成一维柏林噪声的固定点之间插值的最清晰的解释之一 http://webstaff.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf

最重要的事情之一是要知道,在所有编程中有用的是插值函数...

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

一旦你有了使用 smoothstep 插值的随机点,你就拥有了一种平滑的一维噪声函数。

请参阅 wiki 上的 smoothstep。通过谷歌有很多关于这个话题的内容。 https://en.wikipedia.org/wiki/Smoothstep

显然超链接不稳定,在这里又是:

单纯形噪声揭秘

Ken Perlin 提出了“单纯形噪声”,替代了他的经典噪声算法。
经典的“柏林噪音”为他赢得了奥斯卡奖,并已成为无处不在的程序
多年来,它一直是计算机图形学的原始方法,但事后看来,它有相当多的局限性。
Ken Perlin 自己专门设计了单纯形噪声来克服这些限制,他
花了很多心思。因此,这是一个比他原来的算法更好的想法。

几个
其中更突出的优点是:

• 单纯形噪声具有较低的计算复杂性并且需要较少的乘法。

• 单纯形噪声可扩展到更高维度(4D、5D 及以上),计算成本要低得多,复杂性针对维度而不是经典噪声。

• 单纯形噪声没有明显的方向性伪影。

• 单纯形噪声在任何地方都有一个定义明确且连续的梯度,可以计算
相当便宜。

• 单纯形噪声很容易在硬件中实现。

可悲的是,即使在 2005 年初,似乎也很少有人理解单纯形噪声,而且几乎
没有人使用它,这就是我写这篇文章的原因。我会尝试更彻底地解释该算法
Ken Perlin 没有时间在 Siggraph 2001 和 2002 的课程笔记中做这些,并且
希望大家能够明白,它并不像乍看起来那么难掌握。
据我所知,最让人困惑的是肯·佩林的难以捉摸的本质
Java 中的参考实现。他向我们展示了非常紧凑且未注释的代码
演示了原理,但该代码显然不适合作为教程来阅读。几经之后
我放弃了代码的尝试,转而阅读他的论文,这篇论文更加清晰。

不是水晶
不过,很清楚,因为他主要用文字和代码片段来介绍该算法。我会
感谢一些图表和数字以及一些有用的方程式,这就是我试图提供的
在这里,为了让其他人更容易理解单纯形噪声的伟大和美丽。我会
还首先在一维和二维中解释事物,以便更容易用图表来解释事物
和图像,然后转向三维和四维。
经典噪音
为了解释单纯形噪声,很好地理解经典的 Perlin 是有帮助的
噪音。我在这个领域看到了很多不好的和误导性的解释,所以为了确保
既然你已经完成了必要的基础工作,我将首先介绍经典的柏林噪音。

Perlin噪声是所谓的梯度噪声,也就是说你设置了一个伪随机梯度
在空间中规则间隔的点处,并在这些点之间插入平滑函数。到
生成一维柏林噪声,您可以将伪随机梯度(或斜率)关联到
噪声函数与每个整数坐标,并设置每个整数坐标处的函数值
为零。

对于两个整数点之间的给定点,该值插值在
两个值,即如果最接近的线性斜率从
左侧和右侧已推断到所讨论的点。该插值是平滑步算法。

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 noise http://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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文