noise


noise ​

lattice based noise ​

value noise ​

FBM ​

FBM(p)=∑i=0n−1ai⋅noise(fi⋅p)

domain warp: fbm+fbm ​

linear rnd 上下限符号难打....? x下

noise(x)=hash([x]下)+(x−[x]下)∗(hash([x]上)−hash([x]下))

lerp(hash[x]下, hash[x]上,x - [x]下 ) smoothstep: f(x-[x]下)作为系数部分

2d: noise(x, y) hash() n01 = hash([x]下, [y]上) n11 = hash([x]上, [y]上) n00 = hash([x]下,[y]下) n10 = hash([x]上, [y]下) lerp(n00, n10, x-[x]下) lerp(n01, n11, x-[x]下) lerp((lerp(n00, n10, x-[x]下)), (lerp(n01, n11, x-[x]下)), y - [y]下) (filter mode: bilinear)

gradient noise->perlin noise(each vertex random gradient vector??不是这怎么取四随机向量?) g = <[-1,1],[-1,1]> dot(g01, d01)...夹角?但问题是g01, g02, g03, g04这些随机梯度向量

md
lerp(lerp(dot(g00, d00), dot(g01, d01), x-[x]下),lerp(dot(g10, d10), dot(g11, d11), x-[x]下, y-[y]下))

。好吧很我想的一样那个g的随机性生成确实有问题, 某种办法:球坐标生成随机单位向量再转笛卡尔输出,其他方法应该就是图形学问题...

vec3 RandGradVector(uint seed) { float theta = acos(2.0 * rand(seed) - 1); float phi = 2.0 * rand(seed + 2) * PI;

float x = cos(phi) * sin(theta);

float y = sin(phi) * sin(theta);

float z = cos(theta); return vec3(x,y,z);

}

或者预定义一组梯度向量。

或者什么中心差分法求导,,或者直接求导而不是求近似,二阶导数要连续。