Giter Club home page Giter Club logo

animatablevolumecomponent's Introduction

▶ Animatable Volume Component

Animatable Volume Component provides an interface for animating the URP/HDRP PostProcessing Volumes. Use this component to give your game more interactive and dynamic look.
For English README, please take a look at: 👉 README_EN.md

Animatable Volume Component は、URP 及び HDRP のポストプロセス Volume をアニメーションさせるためのインターフェースを提供します。
このパッケージを使用して、より臨場感のあるシーンや演出を作ることができます。



特徴

Animatable Volume Component 以下の特徴があります:

  1. 各ポストプロセスのパラメータに対して、いつもの操作で簡単にアニメーションのキーを打ち、再生させることが出来る
  2. コード分析・自動生成により、
    • Unity のバージョンごとのパラメータ変更を吸収できる
    • カスタムな VolumeComponent に対してもアニメーションさせることができる
  3. ツール導入前後、アニメーション時以外の Volume の操作は一切変わらない

導入

Github レポジトリ の右サイドバーの Releases から、最新版の unitypackage をダウンロードして、プロジェクトにインポートしてください。

使い方

この節では、 Animatable Volume Component を使用して、ポストプロセスの各パラメータをアニメーションさせる方法を説明します。

下記の手順でアニメーションを作成します:

  1. (一度のみ)アニメーション用の補助コンポーネントの自動生成
    • 生成後は特に意識して使う必要はありません
  2. アニメーション用の補助コンポーネントを Volume のゲームオブジェクトにアタッチ
  3. アニメーションキーイング

0. (下準備) 補助コンポーネントの自動生成

本コンポーネントの UnityPackage を導入後、メニューの Tools > Animatable Volume > Animatable Volume Wizard を選択します。下記のようなポップアップが表示されます。

 Wizard_1

プロジェクト内に存在する VolumeComponent のリスト


アニメーションさせたい VolumeComponent にチェックを入れ、[生成]ボタンを押して、VolumeComponent に対応した補助コンポーネント(Animatable + 元のコンポーネント名)を生成します。

 Wizard_2

これでアニメーションをさせるための下準備は完了です。


1. 補助コンポーネントのアタッチ

アニメーションをさせたい Volume のゲームオブジェクトに、Animator 及び AnimatableVolumeHelper をアタッチします。

 Helper_1


AnimatableVolumeHelper のインスペクターの[Add Corresponding Animatable Component]を押して、各 VolumeComponent に対応した補助コンポーネントを追加します。

 Helper_2-all


補助コンポーネントはランタイムの Profile にのみ作動するので、AnimatableVolumeHelper の[Create Runtime Profile]を押して、Profile アセットのコピーを生成します。 (自動で生成される場合があります)

 Helper_3-all


※ 備考:AnimatableVolumeHelperStart() 時に自動でランタイムの Profile を生成しますので、[Create Runtime Profile]はエディターで編集する時のみ必要です。 ※ 備考2:補助コンポーネントは主にアニメーション記録用ですので、アタッチ後は特に操作は必要ありません


2. アニメーションキーイング

補助コンポーネントをアタッチ後、後はいつものアニメーションの付け方と同じです。
アニメーションウィンドウを開き、アニメーションさせたい時間点に、Profile の値を設定して、キーを打っていきます。

 AnimationKeying


キーを打ち終わった後、アニメーションをプレビューして、出来を確認します。

 AnimationPreview


アニメーションに問題が無ければ、アニメーションをアニメーターコントローラーに組み込んで、ゲームを実行すると再生されます。

実装詳細

この節では、AnimatableVolumeComponent の実装について説明します。

URP 及び HDRP のポストプロセスのパラメータをアニメーションする際の難点として、パラメータを保持する VolumeProfile 及び各ポストプロセスの VolumeComponent は ScriptableObject のため、技術上 Animation でキーが打てません。

これに対処するために、このパッケージは各 VolumeComponent の MonoBehaviour 版の補助コンポーネントを自動で生成します。例えば、Bloom を検出したら、AnimatableBloom という MonoBehaviour を生成します。

MonoBehaviour はアニメーションができますので、MonoBehaviour にアニメーションをさせ、LateUpdate() 時に VolumeComponent に反映させることで、間接的に VolumeComponent のパラメータをアニメーションさせることができます。

制限

Animatable Volume Component は下記の既知の制限があります:

  1. AnimationCurve を始め、class のパラメータをアニメーションさせることは出来ません
    • Unity のアニメーションシステムの制限です。カスタムポストプロセスの場合、class の代わりに struct を使用してください

  2. URP 及び HDRP のポストプロセス LiftGammaGain のアニメーションキーを打つ時に、時々画面がチラチラすることがあります
    • LiftGammaGain のエディタとの相性が悪いようです。再生時は問題ありません

animatablevolumecomponent's People

Contributors

cji3bp62000 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.