English 中文(简体)
Perlin 噪音梯度功能
原标题:Perlin noise gradient function

我想把3D Perlin噪声算法 调整到较低的维度, 但我对梯度功能有问题, 因为我不完全理解推理。

原始 Perlin 梯度函数需要四个参数: < code> hash 和三维坐标 < code> (x, y, z) 。 函数的结果根据以下所列 hash mod 16 的值返回。

  • 0: x + y
  • 1: -x + y
  • 2: x - y
  • 3: -x - y
  • 4: x + z
  • 5: -x + z
  • 6: x - z
  • 7: -x - z
  • 8: y + z
  • 9: -y + z
  • 10: y - z
  • 11: -y - z
  • 12: y + x
  • 13: -y + z
  • 14: y - x
  • 15: -y - z

0 11 的返回值是一种模式, 因为每个组合都代表一次。 但是最后四个是重复的。 为什么选择它们来匹配最后四个返回值? 具有两个 (x, y) 和一个 (x) 维度的 aralgous 案例会是什么?

最佳回答

. 迟答复比不回答好吗?-)

“改良噪音”实施中的grad函数计算矢量 x、y、z 和假随机梯度矢量之间的点产值。

In this implementation, the gradient vector is selected from 12 options. They drop uniformity of the selection and add numbers 12 to 15, because it is faster to do hash & 15 than hash % 12

对于2D每端噪音来说,我只使用了4个梯度矢量,没有任何明显的问题,例如:

return ((hash & 1) ? x : -x) + ((hash & 2) ? y : -y);
问题回答

暂无回答




相关问题
3D Perlin noise analytical derivative

I am currently implementing a 3D Perlin noise bump mapping using Shader Model 4 (DirectX 10 HLSL). Generating the noise itself is not a big problem (there are tons of tutorials and codes around) but ...

Perlin s Noise with OpenGL

I was studying Perlin s Noise through some examples @ http://dindinx.net/OpenGL/index.php?menu=exemples&submenu=shaders and couldn t help to notice that his make3DNoiseTexture() in perlin.c uses ...

Random / noise functions for GLSL

As the GPU driver vendors don t usually bother to implement noiseX in GLSL, I m looking for a "graphics randomization swiss army knife" utility function set, preferably optimised to use within GPU ...

Perlin noise algorithm [closed]

I m having difficulty understanding a lot of the highly mathematical papers available online describing how Perlin noise generation works, and I m wondering if anyone could point me in the direction ...

Good Perlin noise resources/implementation?

Are there any good resources out there detailing Perlin noise generation? I understand that most languages have noise generating libraries available, but I m interested in creating my own for fun/...

Offloading to HLSL/GPU without displaying?

As far as I know, certain mathematical functions like FFTs and perlin noise, etc. can be much faster when done on the GPU as a pixel shader. My question is, if I wanted to exploit this to calculate ...

How to generate Perlin Noise on an iPhone

I want to create an animated perlin noise on the iPhone, so I can ultimately do something like this: http://dl.dropbox.com/u/1977230/example.png I ve looked and looked, but can t find anything ...

热门标签