0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Niagara System 最適化検証 同じNiagaraSystemを1つにまとめるモジュールの作成

Posted at

今回は、CEDEC2025で紹介されていた、複数の同じNiagaraSystemを1つにまとめることで処理負荷を下げる対応について実装検証を行います。

講演では、同じNiagara Systemを複数設置する場合、1つのシステムにまとめることでEmitter数を大幅に削減できるそうです。この手法は、Emitter数が多いほど効果的であり、CPU負荷やDraw Callの削減に繋がります。

image.png

鉄拳8の資料によると、対策を行うことで約12個のEmitterを1つに統合した場合、負荷が約2倍近く削減されています。

作成方法

◇ User Parameterの作成

今回の例では、SpawnRateを使用しているEmitter(Fountain)を題材にします。
Niagara System「Fountain」にUser Parameterを作成します。

image.png

  • Parameter TypeVector Array を使用してください。
  • 適用したいパラメータが増えた場合は、ここに追加でVector Arrayを作成します。

◇ Moduleの作成

今回は2つのModuleを作成します。

  1. Niagara System用モジュール(配列サイズ取得)
  2. Niagara Emitter用モジュール(Spawn Rate改造)

⚠️ 注意
Module作成時は、Editorの言語設定をEnglishに変更してください。日本語UIでは一部ノードが検索できない場合があります。

■ 配列サイズ獲得モジュール

User Parameterに登録した配列の長さを取得し、Systemに渡すモジュールです。

image.png

  • 処理内容

    • モジュール入力にVector Arrayを登録
    • Lengthノードで配列の長さを取得
    • MapSetでSystemに値を保存(Emitterで利用可能になる)

■ Spawn Rate改造モジュール

次に、既存のSpawn Rate Moduleを複製・改造します。

image.png

  • 手順

    1. Engineフォルダ内のSpawn Rate Moduleを複製
    2. Spawn Rate処理部分にVector Arrayを入力として追加
    3. Lengthで配列のサイズを取得し、Spawn Rateに反映

→ これにより、配列の数が増えてもエフェクトが薄くならず、各配列位置に均等にパーティクルが生成されます。

◇ Niagara Systemへの適用

■ システムにモジュールを追加

作成した「配列サイズ獲得モジュール」をSystemのSpawn部分に追加します。
追加後、User Parameterの値を指定してください。

image.png

■ EmitterのSpawn Rate差し替え

Emitter(Fountain)の既存のSpawn Rateを、作成したSpawn Rate改造モジュールに置き換えます。
置き換えたら、User Parameterから配列長を渡してください。

image.png

◇ Partition Particleモジュールの追加

次に、Emitter内部でパーティクルを分割・グループ化するためのPartition Particleモジュールを追加します。
これにより、複数Emitterを使うよりもパフォーマンス改善が見込めます

image.png

  • 設定例

    • Partition Mode:Sequential
    • Count Mode:Fixed
    • Number Of Partitions:Position Array Length(配列サイズを利用)

◇ Init Position処理への適用

最後に、Init位置の設定でUser Parameterの配列を参照します。

image.png

  • Position Offset

    • Select Vector from Array を使用
    • Direct Array IndexPartition
    • Vector Selection Array → User Parameter

これらの設定をし、UserParameterのVector Arrayの配列を増やすことで、Foutainの数を増やせると思います。
UserParameterはBPやC++で値を操作することが出来るので、BPでVectorArrayの値をいじって1つのNiagaraのインスタンスで複数のエフェクト配置ができるなど効率的に配置が出来そうです。

まとめ

今回は、「鉄拳8 UnrealEngine5 Niagaraによる開発事例と最適化」に関する資料の一部について実践した資料を記載いたしました。
最適化の検証は別資料で上げますが、最適化効果は絶大なので開発しているゲームでRenderThreadが重かったりしたらこちらの実装を試してみるといいと思います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?