目录
Noise generators
noise
pnoise
onoise
snoise
anoise
xnoise
wnoise
vnoise
curlnoise
flownoise
Random number generators
random
nrandom
rand
hscript_rand
Noise generators
每个噪波相对成本:
- Perlin noise(noise),1;
- Original perlin noise(onoise),1.1;
- worley noise(wnoise),1.8;
- Sparse Convolution noise(snoise),2.1;
- Alligator noise(anoise),2.3;
noise
相当于:
- VOP内 Turbulent Noise / Perlin Noise;
- VOP内 Periodic Noise / Perlin Noise;
//基于1D位置 float noise(float pos) vector noise(float pos) //基于2D位置 float noise(float posx, float posy) vector noise(float posx, float posy) //基于3D位置 float noise(vector pos) vector noise(vector pos) //基于4D位置 float noise(vector4 pos) vector noise(vector4 pos)
pnoise
相当于:
- VOP内 Turbulent Noise / Perlin Noise;
- VOP内 Periodic Noise / Perlin Noise;
float|vector pnoise(float x, int px) float|vector pnoise(vector x, vector p) float|vector pnoise(vector4 xyzt, vector4 p) float|vector pnoise(float x, float y, int px, int py) float|vector pnoise(vector xyz, int px, int py, int pz) float|vector pnoise(vector4 xyzt, int px, int py, int pz, int pt)
onoise
相当于:VOP内 Turbulent Noise / Original Perlin Noise;
float onoise(vector pos) vector onoise(vector pos) float onoise(vector pos, int turbulence, float rough, float atten) vector onoise(vector pos, int turbulence, float rough, float atten) float onoise(vector pos, int periodX, int periodY, int periodZ) vector onoise(vector pos, int periodX, int periodY, int periodZ) float onoise(vector pos, int periodX, int periodY, int periodZ, int turbulence, float rough, float atten) vector onoise(vector pos, int periodX, int periodY, int periodZ, int turbulence, float rough, float atten)
snoise
相当于:VOP内 Turbulent Noise / Sparse Convolution Noise;
float snoise(vector pos) vector snoise(vector pos) float snoise(vector pos, int turbulence, float rough, float atten) vector snoise(vector pos, int turbulence, float rough, float atten) float snoise(vector pos, int periodX, int periodY, int periodZ) vector snoise(vector pos, int periodX, int periodY, int periodZ) float snoise(vector pos, int periodX, int periodY, int periodZ, int turbulence, float rough, float atten) vector snoise(vector pos, int periodX, int periodY, int periodZ, int turbulence, float rough, float atten)
anoise
相当于:VOP内 Turbulent Noise / Alligator Noise;
float anoise(vector pos) vector anoise(vector pos) float anoise(vector pos, int turbulence, float rough, float atten) vector anoise(vector pos, int turbulence, float rough, float atten) float anoise(vector pos, int periodX, int periodY, int periodZ) vector anoise(vector pos, int periodX, int periodY, int periodZ) float anoise(vector pos, int periodX, int periodY, int periodZ, int turbulence, float rough, float atten) vector anoise(vector pos, int periodX, int periodY, int periodZ, int turbulence, float rough, float atten)
xnoise
相当于:
- VOP内 Turbulent Noise / Simplex Noise;
- VOP内 Periodic Noise / Simplex;
float xnoise(float x) vector xnoise(float x) float xnoise(float x, float y) vector xnoise(float x, float y) float xnoise(vector xyz) vector xnoise(vector xyz) float xnoise(vector4 xyzt) vector xnoise(vector4 xyzt)
wnoise
相当于:
- VOP内 Worley Noise;
//生成1D noise void wnoise(float position, int &seed, float &f1, float &f2) void wnoise(float position, int &seed, float &f1, float &f2, float &f3, float &f4) //生成周期1D noise void wnoise(float position, int &seed, float &f1, float &f2, int peiod) void wnoise(float position, int &seed, float &f1, float &f2, float &f4, float &f4, int period) //生成2D noise void wnoise(float posx, float posy, int &seed, float &f1, float &f2) void wnoise(float posx, float posy, int &seed, float &f1, float &f2, float &f3, float &f4) //生成周期2D noise void wnoise(float posx, float posy, int &seed, float &f1, float &f2, int periodx, int periody) void wnoise(float posx, float posy, int &seed, float &f1, float &f2, float &f3, float &f4, int periodx, int periody) //生成2D noise void wnoise(vector2 position, int &seed, float &f1, float &f2) void wnoise(vector2 position, int &seed, float &f1, float &f2, float &f3, float &f4) //生成周期2D noise void wnoise(vector2 position, int &seed, float &f1, float &f2, int periodx, int periody) void wnoise(vector2 position, int &seed, float &f1, float &f2, float &f3, float &f4, int periodx, int periody) //生成3D noise void wnoise(vector position, int &seed, float &f1, float &f2) void wnoise(vector position, int &seed, float &f1, float &f2, float &f3, float &f4) //生成周期3D noise void wnoise(vector position, int &seed, float &f1, float &f2, int periodx, int periody, int periodx) void wnoise(vector position, int &seed, float &f1, float &f2, float &f3, float &f4, int periodx, int periody, int periodz) //生成4D noise void wnoise(vector4 position, int &seed, float &f1, float &f2) void wnoise(vector4 position, int &seed, float &f1, float &f2, float &f3, float &f4) //生成周期4D noise void wnoise(vector4 position, int &seed, float &f1, float &f2, int periodx, int periody, int periodz, int periodw) void wnoise(vector4 position, int &seed, float &f1, float &f2, float &f3, float &f4, int periodx, int periody, int periodz, int periodw)
vnoise
相当于:
- VOP内 Voronoi Noise;
//生成1D noise void vnoise(float position, float jitter, int &seed, float &f1, float &f2, float &pos1, float &pos2) //生成周期1D noise void vnoise(float position, float jitter, int &seed, float &f1, float &f2, float &pos1, float &pos2, int period) //生成2D noise void vnoise(float posx, float posy, float jittx, float jitty, int &seed, float &f1, float &f2, float &pos1x, float &pos1y, float &pos2x, float &pos2y) //生成周期2D noise void vnoise(float posx, float posy, float jittx, float jitty, int &seed, float &f1, float &f2, float &pos1x, float &pos1y, float &pos2x, float &pos2, int periodx, int periody) //生成3D noise void vnoise(vector position, vector jitter, int &seed, float &f1, float &f2, vector &pos1, vector &pos2) //生成周期3D noise void vnoise(vector position, vector jitter, int &seed, float &f1, float &f2, vector &pos1, vector &pos2, int periodx, int periody, int periodz) void vnoise(vector position, vector jitter, int &seed, float &f1, float &f2, vector &pos1, vector &pos2, vector period) //生成4D noise void vnoise(vector4 position, vector4 jitter, int &seed, float &f1, float &f2, vector4 &pos1, vector4 &pos2) //生成周期4D noise void vnoise(vector4 position, vector4 jitter, int &seed, float &f1, float &f2, vector4 &pos1, vector4 &pos2, int periodx, int periody, int periodz, int periodw) void vnoise(vector4 position, vector4 jitter, int &seed, float &f1, float &f2, vector4 &pos1, vector4 &pos2, vector4 period)
curlnoise
vector curlnoise(vector xyz) vector curlnoise(vector4 xyzt)
flownoise
相当于:
- VOP内 Flow Noise;
float flownoise(vector xyz, float flow) vector flownoise(vector xyz, float flow) float flownoise(vector4 xyzt, float flow) vector flownoise(vector4 xyzt, float flow) float flownoise(float x, float y, float flow) vector flownoise(float x, float y, float flow)
Random number generators
random
//基于1D位置,生成对应噪波 float random(float|int position) vector random(float|int position) vector2 random(int position) vector4 random(float|int position) //基于2D位置,生成对应噪波 float random(float|int xpos, float|int ypos) vector random(float|int xpos, float|int ypos) vector4 random(float|int xpos, float|int ypos) //基于3D位置,生成对应噪波 float random(vector position) vector random(vector position) vector4 random(vector position) //基于4D位置,生成对应噪波 float random(vector4 position) vector random(vector4 position) vector4 random(vector4 position)
nrandom
float nrandom(...) vector2 nrandom(...) vector nrandom(...) vector4 nrandom(...)
//修改给定变量值,随机值0~1 void nrandom(float &x, float &y, ...)
rand
float rand(float seed) vector2 rand(float seed) vector rand(float seed) vector4 rand(float seed) float rand(float seed, float seed2) vector2 rand(float seed, float seed2) vector rand(float seed, float seed2) vector4 rand(float seed, float seed2) float rand(vector2 seed) vector2 rand(vector2 seed) vector rand(vector2 seed) vector4 rand(vector2 seed) float rand(vector seed) vector2 rand(vector seed) vector rand(vector seed) vector4 rand(vector seed) float rand(vector4 seed) vector2 rand(vector4 seed) vector rand(vector4 seed) vector4 rand(vector4 seed)
注,如需统一各个分量,可使用float()进行转化;
vector pos = 1; float seed = 0; pos *= float(rand(seed));
hscript_rand
float|vector|vector4 hscript_rand(float seed)