Version: 2022.1
言語: 日本語
リフレクションプローブ
Using Reflection Probes

Types of Reflection Probe

Reflection probes come in three basic types as chosen by the Type property in the inspector (see the component reference page for further details).

  • Baked probes store a reflection cubemap generated (“baked”) within the editor. You can trigger the baking by clicking either the Bake button at the bottom of the Reflection Probe inspector or the Build button in the Lighting window. If you have Auto enabled in the Lighting window then baked probes will be updated automatically as you place objects in the Scene view. The reflection from a baked probe can only show objects marked as Reflection Probe Static in the inspector. This indicates to Unity that the objects will not move at runtime.
  • Realtime probes create the cubemap at runtime in the player rather than the editor. This means that the reflections are not limited to static objects and can be updated in real time to show changes in the scene. However, it takes considerable processing time to refresh the view of a probe so it is wise to manage the updates carefully. Unity allows you to trigger updates from a script so you can control exactly when they happen. Also, there is an option to apply timeslicing to probe updates so that they can take place gradually over a few frames.
  • カスタム (Custom) のプローブタイプも使用可能です。これらのプローブを使用すると、ベイクしたプローブと同様に、エディターでビューをベイクできます。しかし、リフレクション用のカスタムキューブマップを使用することもできます。カスタムプローブは、ランタイムに更新することはできません。

上記の 3 タイプの詳細を説明します。

Baked and Custom Reflection Probes

A Baked Reflection Probe is one whose reflection cubemap is captured in the Unity editor and stored for subsequent usage in the player (see the Reflection Probes Introduction for further information). Once the capture process is complete, the reflections are “frozen” and so baked probes can’t react to runtime changes in the scene caused by moving objects. However, they come with a much lower processing overhead than Realtime Probes (which do react to changes) and are acceptable for many purposes. For example, if there is only a single moving reflective object then it need only reflect its static surroundings.

Using Baked probes

You should set the probe’s Type property to Baked or Custom in order to make it behave as a baked probe (see below for the additional features offered by Custom probes).

The reflections captured by baked probes can only include scene objects marked as Reflection Probe Static (using the Static menu at the top left of the inspector panel for all objects). You can further refine the objects that get included in the reflection cubemap using the Culling Mask and Clipping Planes properties, which work the same way as for a Camera (the probe is essentially like a camera that is rotated to view each of the six cubemap faces).

When the Auto option is switched on (from the Lighting window), the baked reflections will update automatically as you position objects in the scene. If you are not making use of auto baking then you will need to click the Bake button in the Reflection Probe inspector to update the probes. (The Build button in the Lighting window will also trigger the probes to update.)

自動または手動のベイクを使うかどうかにかかわらず、エディターで作業を続ける間、ベイク処理は非同期に行われます。ただし、静的オブジェクトを移動したり、それらのマテリアルを変更したり、あるいは、他の方法でその外観を変更すると、ベイク処理が再開されます。

Custom Probes

デフォルトでは、カスタムプローブはベイクしたプローブと同じように動作しますが、動作を変更する追加のオプションもあります。

The Dynamic Objects property on a custom probe’s inspector allows objects that are not marked as Reflection Probe Static to be included in the reflection cubemap.

Note: The positions of these objects are still “frozen” in the reflection at the time of baking.

The Cubemap property allows you to assign your own cubemap to the probe and therefore make it completely independent of what it can “see” from its view point. You could use this, say, to set a skybox or a cubemap generated from your 3D modelling app as the source for reflections.

Realtime Probes

ベイクしたプローブはさまざまな場面で有用であり、ランタイムのパフォーマンスが優れていますが、それらは、プレイヤー内をリアルタイムで更新しないという欠点があります。つまり、オブジェクトのリフレクションが一緒に移動しなくても、オブジェクトはシーン内を移動できます。これがあまりに制約となる場合は、リアルタイム プローブを使うことができます。リアルタイム プローブはランタイムにリフレクションキューブマップを更新します。この効果は、より高い処理オーバーヘッドとなりますが、よりリアルな外観を実現できます。

Using Realtime Probes

To enable a probe to update at runtime, you should set its Type property to Realtime in the Reflection Probe Inspector. You don’t need to mark objects as Reflection Probe Static to capture their reflections (as you would with a baked probe). However, you can selectively exclude objects from the reflection cubemap using the Culling Mask and Clipping Planes properties, which work the same way as for a Camera (the probe is essentially like a camera that is rotated to view each of the six cubemap faces).

In the editor, real-time probes have much the same workflow as baked probes, although they tend to render more quickly.

Note: Currently, real-time probes will only update their reflections in the Scene view when Reflection Probe Static objects are moved or change their appearance. This means that moving dynamic objects won’t cause an update even though those objects appear in the reflection. You should choose the Bake Reflection Probes option from the Build button popup on the Lighting window to update reflections when a dynamic object is changed.

リフレクションプローブ
Using Reflection Probes