简体   繁体   English

2d Perlin噪音。 为什么我必须取位移和梯度矢量的点积?

[英]2d Perlin noise. Why do i have to take the dotproduct of displacement and gradientvector?

Taking this into account, i do not understand why i have to take the dotproduct of the gradient vector and the displacement of my point to it. 考虑到这一点 ,我不明白为什么我必须考虑梯度矢量的点积和指向该点的位移。 Can anyone explain me why i have to do that? 谁能解释我为什么要这样做? I actually understand this tutorial, where they just took a simple blur to calculate the value of the grid point (called smooth noise). 我实际上理解了教程,在教程中,他们只是进行了简单的模糊处理以计算网格点的值(称为平滑噪声)。 The linear interpolation is in both cases clear to me. 在这两种情况下,线性插值对我都很清楚。 So can anyone explain me why they take the dotproduct of the displacement and so called "gradientvector" in the first tutorial? 那么谁能解释我为什么要在第一个教程中采用位移的点积和所谓的“梯度向量”呢? What effect has it? 有什么作用?

Ok i figured it out myself now. 好吧,我现在想通了。 The first tutorials noise is a so called gradient noise, while the second tutorials one is a value noise. 第一个教程的噪声是所谓的梯度噪声,而第二个教程的噪声是值噪声。 The classic perlin noise by ken is a gradient noise (better quality and performance) while the value noise is easier to understand. ken的经典Perlin噪声是梯度噪声(质量和性能更好),而值噪声则更容易理解。 But in both cases octaves are added together n times(the gradient noise doesnt replace this procedure). 但是在这两种情况下,八度都加了n次(梯度噪声不能代替此过程)。 See: 看到:

http://en.m.wikipedia.org/wiki/Value_noise http://en.m.wikipedia.org/wiki/Value_noise

http://en.m.wikipedia.org/wiki/Gradient_noise http://en.m.wikipedia.org/wiki/Gradient_noise

Gradient noise seeds a grid with random vectors of the length 1. These vectors are placed with a distance of 1 to each other. 渐变噪声为长度为1的随机向量的网格设置了种子。这些向量彼此之间的距离为1。 Taking the dotproduct of the displacementvector from the 4 nearest gridpoints to my wanted point and the seeded gradient vectors at these 4 points will then result in a value between -1 and 1 for each of these 4 points. 取位移矢量从4个最近的网格点到我想要的点的点积,以及在这4个点处播种的梯度矢量,对于这4个点中的每一个,结果将在-1和1之间。 These values can then be interpolated to get the actual points value. 然后可以对这些值进行插值以获得实际的点值。

Value noise generates random values in real time for every gridpoint, wich are placed with a distance between them of 1. These values are generated with a seed, wich allowS me to get the same value over and over again. 值噪声为每个网格点实时生成随机值,它们之间的距离为1。这些值是通过种子生成的,允许我一遍又一遍地获得相同的值。 When i pick my square wich surrounds my point i want to get, i generate the random value in realtion to my passed coordinates (the algorithm for such a generator can be seen in the 2nd tut) and then blur it with the surrounding gridpoints to get a smooth noise. 当我选择要获取的点周围的平方根时,我会根据所传递的坐标实时生成随机值(可以在第二个tut中看到此类生成器的算法),然后使用周围的网格点对其进行模糊处理以获得平稳的声音。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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