以下の内容はhttps://simplestar-tech.hatenablog.com/entry/2018/12/24/173647より取得しました。


Unity:Mathematics Noise 動作イメージをつかむ

前書き

Unity は Mathf という一般的な数学関数ライブラリをGameObjectの計算に提供してきました
docs.unity3d.com

今後の高速化案件の Burst Compile が必要になるケースでは新しい Mathematics という数学ライブラリを使わなくてはならなくなりました。
github.com

Unity.Mathematics
A prototype of a C# math library providing vector types and math functions with a shader like syntax. Used by the burst compiler to compile C#/IL to highly efficient native code.

Mathematics の中で個人的に noise 関数がいくつか気になっています。
関数名だけ眺めても動作イメージがつかめないので一通りどういうノイズなのか調べることにしました。

読者のみなさんにも確認結果を共有します。

情報ソース

noise を作成するコードやコメントは先ほどの Git の次のページから確認できました。
Unity.Mathematics/Noise

この記事で確認したい関数は次の通りです

  • float2 cellular(float2 P) // Worley ノイズ (Steven Worley 作 in 1996年頃)
  • float cnoise(float2 P) // クラシック Perlin ノイズ( Ken Perlin 作 1980年代)
  • float snoise(float2 v) // Simplex ノイズ (Ken Perlin 作 in 2001)
  • float3 psrdnoise(float2 pos, float2 per, float rot) // Simplex ノイズ with Rotating gradients and analytical Derivative.

順に使っていきましょう。

cellular noise

参考にした解説
thebookofshaders.com

snoise とは?

Simplex noise
Simplex noise - Wikipedia

Ken Perlin designed the algorithm in 2001

Perlin さんが提供したn次元のノイズ生成アルゴリズムの名称
次元数を増やすことができ、計算量も少ないという改善版

Perlin ノイズは旧アルゴリズムという扱いでした。(初めて知った)

cnoise は Perlin ノイズ

classic noise の略だそうな

psrdnoise

よくわかりませんでした。

追記:作りたかった記事見つけた。

gametorrahod.com




以上の内容はhttps://simplestar-tech.hatenablog.com/entry/2018/12/24/173647より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14