Perlin Noise算法

ref

https://youtu.be/ZsEnnB2wrbI?si=ER9o5ccmvAKEzCen

Step Intro

 

噪声本质是随机性的表现


白噪声:像素点0-1之间随机赋值

 噪声的类型

 为了得到更平滑的噪声,有一种算法——Perlin noise:将随机的数字序列变为平滑连接的明暗板块

 步骤1 获得随机的数字序列,将地图分割为一系列方块

 步骤2 在网格每个顶点处放置一个随机数作为梯度向量值的参考

步骤3 计算网格内像素点得到的偏移向量和网格顶点对应的梯度向量的点积

步骤4 使用平滑函数将四个梯度得到的贴图叠加,得到柏林噪声的一个八度

步骤5 可以进一步细分网格,得到更高阶八度

步骤6 将各级八度混合,得到分形柏林噪声

Step Details 

1.generate a pseudo-random number generator(伪随机数生成器)

2.divide map up with a grid and each cell of the grid will be referred to as a chunk

 3.assign an influence vector to each corner of this grid

4.ensure one number will correspond to one angle

5.for games ,the direction can be easier for them to go in any direction they want

6.To solve the sharp jump along its borders, we can blend pairs of map in a particular sequence by horizontally then vertically

6.1 Lerping 

6.2 Smooth Stepping

PS 

3D perlin noise

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值