noise

Houdiniのnoise関数をまとめた。ノイズの値はMayaの様に-1～1と固定されていると使いやすいが、Houdiniは関数毎に値の範囲がバラバラで非常に使いずらい。マニュアルに0-1と記載されているものもあるが偏りがあり実際の範囲は異なる。
以下は、freqencyを200ぐらいにした時の最大値と最小値である。０を基準におおよそ-1～1の範囲にフィットさせてみた。

[HIPファイル](https://github.com/DefultVFX/houdini/blob/master/noiseVEX.v1.hipnc)

###Alligator Noise
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/615517/d8404f3c-509b-967d-52bd-f164136484d8.png)

```
float freq = ch("freq");
float offset = ch("offset");
int turb = 5;
float rough = 0.5;
float atten = 1;
vector noise = anoise(@P*freq - set(offset,0,0), turb, rough, atten);
@P = set(@P.x, noise.y, @P.z);
```
###Curlnoise
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/615517/fdeff86a-4ea6-145e-bc1b-2ac03a3d4827.png)

```
float freq = ch("freq");
float offset = ch("offset");
vector noise = curlnoise(@P*freq - set(offset,0,0));
@P = set(@P.x, noise.y, @P.z);
```
###Perlin Flow Noise
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/615517/3c61f754-a219-8559-b07f-80e31d0d35a9.png)

```
float freq = ch("freq");
float offset = ch("offset");
vector noise = flownoise(@P*freq, offset);
@P = set(@P.x, noise.y, @P.z);

```
###Perlin noise
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/615517/a8090459-b95a-1e9b-0bc4-50efcdcfb1e3.png)

```
float freq = ch("freq");
float offset = ch("offset");
vector noise = noise(@P*freq - set(offset,0,0));
@P = set(@P.x, noise.y, @P.z);
```
###Original perlin noise
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/615517/d145d52a-1e83-39e3-67ec-27b4f3d00c74.png)

```
float freq = ch("freq");
float offset = ch("offset");
int turb = 5;
float rough = 0.5;
float atten = 1;
vector noise = onoise(@P*freq - set(offset,0,0), turb, rough, atten);
@P = set(@P.x, noise.y, @P.z);
```
###Simplex noise
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/615517/07ebb587-bfa8-1d92-4198-d92f5c13fbbf.png)

```
float freq = ch("freq");
float offset = ch("offset");
vector noise = xnoise(@P*freq - set(offset,0,0));
@P = set(@P.x, noise.y, @P.z);
```
###Sparse Convolution noise
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/615517/c214f96d-6387-2720-8b4f-57bcb50ba5bf.png)

```
float freq = ch("freq");
float offset = ch("offset");
int turb = 5;
float rough = 0.5;
float atten = 1;
vector noise = snoise(@P*freq - set(offset,0,0), turb, rough, atten);
@P = set(@P.x, noise.y, @P.z);
```
###Voronoi noise
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/615517/5187902d-2337-2fa6-d4be-dc2b5113674b.png)

```
float freq = ch("freq");
float offset = ch("offset");
int seed;
float f1, f2;
vector v1, v2;
vnoise((@P*freq - set(offset,0,0)),1,seed,f1, f2, v1, v2);
@P = set(@P.x, f1, @P.z);
```
###Worley noise
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/615517/dee1acdb-aafd-786c-caf2-7f28517a30a0.png)

```
float freq = ch("freq");
float offset = ch("offset");
int seed; 
float f1, f2, f3, f4;
wnoise((@P*freq - set(offset,0,0)),seed,f1, f2, f3, f4);
@P = set(@P.x, f1, @P.z);
```
###Worley (cellular) noise using a Chebyshev distance metric noise
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/615517/1d8b96d7-707a-bc54-99af-4b59c1f141cb.png)

```
float freq = ch("freq");
float offset = ch("offset");
int seed; 
float f1, f2, f3, f4;
cwnoise((@P*freq - set(offset,0,0)),seed,f1, f2, f3, f4);
@P = set(@P.x, f1, @P.z);
```