Unity の Particle System で水しぶきを表現するための調べものの一部です。

今回は Unity の Particle System の粒子に割り当てるマテリアルの新規作成と、Particles カテゴリのシェーダーについて紹介します。
※ Unity のバージョンは 2021.3.25f1 Personal <DX11> です。
※表示されている 3D モデルは無料アセット「Old Sea Port」を使用しています。
関連記事
以下の記事で、Particle System をシーンに配置して、放出された粒子が水しぶきのように放物線を描いて落ちていく設定を行いました。
Unity ParticleSystemで船が進むときの波しぶきを作成1/3 | Compota-Soft-Press

Particle System 既定のマテリアル
シーンに配置した Particle System ゲームオブジェクトを選択して Inspector で下にスクロールするとマテリアルが確認できます。
Shader は Particles/Standard Unlit が選択されています。

Particle System のデフォルトのマテリアルは、粒子の周囲がぼやけていて、水滴っぽくありません。

Material の新規作成
Project ウィンドウの任意のフォルダで右クリックして、メニュー「Create」→「Material」を選択します。

作成した Material をリネームします。今回は水滴を意味する WaterDrop に変更しました。

Particles のシェーダーの種類
Project ウィンドウで、新規作成した Material を 選択して Inspector ウィンドウで設定を表示します。
上部の Shader のリストから選択できる Particles カテゴリのシェーダーは以下の 2 つです。

Particles / Standard Surface
Particles / Standard Surface シェーダーは、Metallic や NormalMap などの物理的な質感を表現できる項目を設定できるシェーダーです。
このシェーダーは、スタンダードシェーダーと同様の機能を備えていますが、特にパーティクルには効果的です。スタンダードシェーダーと同様に、物理ベースシェーディングにも適応します。動的パーティクルに適さない機能 (ライトマップなど) は含まれていません。
パーティクルのスタンダードシェーダー – Unity マニュアル

Particles / Standard Unlit
Particles / Standard Unlit シェーダーは、前述の Standard Surface シェーダーに比べて、光沢などを表現する項目はありませんが、高速な処理が期待できます。
このシンプルなシェーダーはサーフェスシェーダーよりも高速です。これは、フリップブックブレンドや歪みなどの一般的なパーティクルコントロールをすべてサポートしますが、ライティングの計算を行いません。
パーティクルのスタンダードシェーダー – Unity マニュアル

Mobile / Particles について
Mobile カテゴリの中にも Particles のカテゴリがありました。
他サイト様「マテリアルを設定して、パーティクルの表現の幅を広げよう! – Cluster Creators Guide|バーチャル空間での創作を学ぶなら」の引用です。
Mobile系シェーダーはテクスチャのみ設定でき、機能が限られている代わりに処理が軽くなるようつくられています。
マテリアルを設定して、パーティクルの表現の幅を広げよう! – Cluster Creators Guide|バーチャル空間での創作を学ぶなら
4 つの Mobile/Particles カテゴリのシェーダーを選択すると、Standard Unlit シェーダーよりもさらに項目が少ないですが、表現がこれで十分ならば、かなり高速な描画が期待できそうです。




まとめ
今回は、Unity の Particle System で放出される粒子に割り当てるマテリアルを作成するため Particles と Mobile / Particles カテゴリのシェーダー群について紹介しました。
各シェーダーをマテリアルで選択した際の、初期設定の Inspector ウィンドウのスクリーンショットも掲載しました。
参照サイト Thank You!
- Unity のリアルタイム開発プラットフォーム | 3D/2D、VR/AR のエンジン
- パーティクルシステム – Unity マニュアル
- パーティクルのスタンダードシェーダー – Unity マニュアル
- マテリアルパラメーター – Unity マニュアル
- マテリアルを設定して、パーティクルの表現の幅を広げよう! – Cluster Creators Guide|バーチャル空間での創作を学ぶなら
記事一覧 → Compota-Soft-Press
コメント