IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    [原]CoherentNoise(相干噪声)

    qp120291570发表于 2016-05-17 00:47:57
    love 0

    Coherent noise定义

    Coherent noise is a function f (x) , such as any two values f (x0) and f (x1) are close together when x0 and x1 are close together, but donot correlate when x0 and x1 are far apart.


    value noise


    只在一些Lattice Point(整数点)生成随机数,然后将这些随机数缩放到(-1,1),Lattice点的中间部分用插值来获取。


    插值的方式有很多种,线性,Cosine,立方等等...




    Coherent noise 通常使用后面三种来生成噪声,这样的噪声看起来会比较平滑。

    这里的Lattice Point间隔称为噪声的频率。


    gradient noise

    这样的噪声有一个很明显的问题,就是局部的最大最小值都在整数的位置,一种改善的方法就是使用 gradient noise,也就是perlin noise。具体的做法是:整数点的函数值都是0,随机数生成的是那一点的gradient,中间的值有插值获得,得到的值如下所示。




    这种噪声虽然也有些小问题,就是整数点的值都为0,但看上去比value noise 好很多。


    Value-gradient Noise

    Value-gradient Noise是上面两种noise的结合,这样就把上面的问题解决了。





    Combining Noise

    单个的噪声比较单调,通常在实际使用中会将噪声和普通函数相叠加或者多个噪声叠加来获得理想的效果。

    比如




    这里的叠加函数是这样

    p(x)= f ( x+noise( x))


    也有这样的叠加方式


    这就是传说中的fractal noist,其中noise1的频率是1, noise2的频率是2, noise4的频率是4....




    真正的Fractal Noise有着无数的项,但是实际使用中并不会加那么多项。



    参考

    Coherent Noise user menual











沪ICP备19023445号-2号
友情链接