Flare (フレア) オブジェクトは、Lens Flare によって使用されるソースアセットです。フレア自体は、テクスチャファイルと、フレアの動作を決定する特定の情報の組み合わせです。そのため、シーン でフレアを使用したい場合は、ゲームオブジェクト にアタッチされた LensFlare コンポーネント から特定のフレアを参照します。
Standard Assets パッケージにはいくつかのサンプルフレアがあります。これらの 1 つをシーンに加えたい場合は、ゲームオブジェクトに Lens Flare コンポーネントをアタッチし、マテリアル を Mesh Renderer に割り当てるのと同じように、使用したいフレアを Lens Flare の Flare プロパティにドラッグします。
フレアは、単一の テクスチャ にいくつかのフレア Element (要素) を加えて使用します。Flare インスペクターで、任意のテクスチャから加えたい Element を選択できます。
プロパティ | 機能 |
---|---|
Elements | フレア内に含まれるフレア画像の数。 |
Image Index | この要素の Flare Texture から使用するフレア画像。詳細については、下の Flare Textures を参照してください。 |
Position | 含まれるゲームオブジェクトの位置から画面中央を通る線に沿った要素のオフセット。0 = ゲームオブジェクトの位置、1 = 画面中央 |
Size | 要素のサイズ。 |
Color | 要素の色。 |
Use Light Color | フレアをライトに設定する場合、これを有効にすると、フレアの色がライトの色になります。 |
Rotate | 有効にすると、要素の底部が常に画面の中央を向き、Lens Flare が画面上を移動するのに伴い、要素は回転します。 |
Zoom | 有効にすると、表示したときに要素が拡大され、無効にすると、再度縮小します。 |
Fade | 有効にすると、表示したときに要素がフェードインし、無効にすると、フェードアウトします。 |
Flare Texture | このフレアの Element が使用する画像を含むテクスチャ。Texture Layout オプションのいずれかで配置する必要があります。 |
Texture Layout | Flare Texture 内での個々のフレア Element の画像の配置方法 (詳細は、後述の Texture Layouts を参照してください)。 |
Use Fog | 有効にすると、フレアは遠くにあるフォグとともに消えていきます。一般に小さいフレアに使用されます。 |
フレアは、線に沿って配置された複数の Element で構成されます。この線は、レンズフレアを含むゲームオブジェクトの位置と、画面の中心を比較して計算されます。線は、含まれているゲームオブジェクトと画面の中心を超えて伸びています。フレアの Element はすべてこの線上に並べられます。
パフォーマンス上の理由から、1 つのフレアのすべての Element は、同じテクスチャを共有する必要があります。このテクスチャには、1 つのフレア内の Element として使用できるさまざまな画像の集合が含まれています。Texture Layout は、Flare Texture 内で Element がどのように配置されるかを定義します。
フレアの Texture Layout (テクスチャレイアウト) には 様々な種類があります。画像内の数字は、各 Element に対する Image Index プロパティに対応しています。
太陽からのフレアような、大きいフレア向けに設計され、Element の 1 つが他の要素よりも高い忠実度を持つ必要があります。縦の長さが横の 2 倍のテクスチャで使用するよう設計されています。
1 つの高解像度画像、2 つの中サイズの画像と 8 つの小サイズ画像を必要とする複雑なフレア向けに設計されています。これは、Standard Assets に含まれる 50mm Zoom Flare で使用されており、2 つの中サイズ画像の Element は虹色の円です。縦の長さが横の 2 倍のテクスチャで使用するよう設計されています。
1 つの画像。
2x2 グリッド。
3x3 グリッド。
4x4 グリッド。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.