リフレクションプローブは周囲の環境を、シェーダーに渡されるテクスチャへとキャプチャし、反射を表現するために使用される技術です。
プロパティーはインスペクターの値と完全に一致しています。
このクラスは reflection probe コンポーネントのためのスクリプトインターフェースです。
リフレクションプローブは通常、エディターで作成するものですがスクリプトから作成したいときもあるかもしれません。
using UnityEngine; using UnityEditor;
public class ProbeCreator { [MenuItem("ReflectionProbe/CreateRealtimeProbe")] public static void RealtimeProbe() { // Add a GameObject with a ReflectionProbe component GameObject probeGameObject = new GameObject("Realtime Reflection Probe"); ReflectionProbe probeComponent = probeGameObject.AddComponent<ReflectionProbe>(); // The probe will contribute to reflections inside a box of size 10x10x10 centered on the position of the probe probeComponent.size = new Vector3(10, 10, 10);
// Set the type to realtime and refresh the probe every frame probeComponent.mode = UnityEngine.Rendering.ReflectionProbeMode.Realtime; probeComponent.refreshMode = UnityEngine.Rendering.ReflectionProbeRefreshMode.EveryFrame; } }
| defaultTexture | The surface texture of the default reflection probe that captures the environment contribution. Read only. |
| defaultTextureHDRDecodeValues | HDR decode values of the default reflection probe texture. |
| backgroundColor | リフレクションプローブのテクスチャが内容を決めるのに使用する色 |
| bakedTexture | リフレクションプローブの周囲にあるベイクされたテクスチャへの参照 |
| blendDistance | ブレンドで周囲にあるプローブを使用する距離(遅延プローブで使用されます) |
| bounds | The probe's world space axis-aligned bounding box in which the probe can contribute to reflections (Read Only). |
| boxProjection | このリフレクションプローブがボックスプロジェクションを使用するかどうか |
| center | The center of the probe's bounding box in which the probe can contribute to reflections. The center is relative to the position of the probe. |
| clearFlags | リフレクションプローブが背景をどのように決定するか |
| cullingMask | これはリフレクションプローブの周囲にあるものを選択的に描画するために使用されます。 |
| customBakedTexture | リフレクションプローブの周囲にあるベイクされたテクスチャへの参照。カスタムリフレクションのテクスチャを割り当てるために使用します。 |
| farClipPlane | プローブを描画するカメラから最も遠い距離 |
| hdr | 現在のリフレクションプローブが HDR レンダリングを使用するかどうか |
| importance | リフレクションプローブの重要度 |
| intensity | リフレクションプローブのテクスチャをシェーダーにどれだけ適用するか。 |
| mode | リフレクションプローブテクスチャをエディターで生成するか (ReflectionProbeMode.Baked) 、プローブがカスタム特定テクスチャを使用するか (ReflectionProbeMode.Custom) |
| nearClipPlane | プローブを描画するカメラから最も近い距離 |
| realtimeTexture | Reference to the real-time texture of the reflection probe's surroundings. Use this to assign a RenderTexture to use for real-time reflection. |
| refreshMode | プローブのリフレッシュ方法を設定します。See Also: ReflectionProbeRefreshMode. |
| renderDynamicObjects | Specifies whether Unity should render non-static GameObjects into the Reflection Probe. If you set this to true, Unity renders non-static GameObjects into the Reflection Probe. If you set this to false, Unity does not render non-static GameObjects into the Reflection Probe. Unity only takes this property into account if the Reflection Probe's Type is Custom. |
| resolution | 根幹をなすリフレクションテクスチャをピクセル数で表した解像度 |
| shadowDistance | プローブをレンダリングするときに影も描画する距離 |
| size | The size of the probe's bounding box in which the probe can contribute to reflections. The size is in world space. |
| texture | リフレクションプローブ付近にある、オブジェクトのシェーダーに渡されるテクスチャ(読み取り専用) |
| textureHDRDecodeValues | HDR decode values of the reflection probe texture. |
| timeSlicingMode | プローブの time-slicing モードを設定します。See Also: ReflectionProbeTimeSlicingMode. |
| IsFinishedRendering | プローブが time-slice モードの描画を終えたかをチェックします。 |
| RenderProbe | プローブのキューブマップを更新します。 |
| Reset | Revert all ReflectionProbe parameters to default. |
| BlendCubemap | 2つのキューブマップをブレンドして、ターゲットレンダーテクスチャにするためのユーティリティーメソッドです。 |
| UpdateCachedState | Updates the culling system with the ReflectionProbe's current state. This ensures that Unity correctly culls the ReflectionProbe during rendering if you implement your own runtime reflection system. |
| defaultReflectionSet | Adds a delegate to get notifications when the default specular Cubemap is changed. |
| defaultReflectionTexture | Adds a delegate to get notifications when the default specular Cubemap is changed. |
| reflectionProbeChanged | Adds a delegate to get notifications when a Reflection Probe is added to a Scene or removed from a Scene. |
| enabled | 有効であれば更新され、無効であれば更新されません。 |
| isActiveAndEnabled | Reports whether a GameObject and its associated Behaviour is active and enabled. |
| gameObject | このコンポーネントはゲームオブジェクトにアタッチされます。コンポーネントはいつもゲームオブジェクトにアタッチされています。 |
| tag | ゲームオブジェクトのタグ |
| transform | The Transform attached to this GameObject. |
| hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
| name | オブジェクト名 |
| BroadcastMessage | ゲームオブジェクトまたは子オブジェクトにあるすべての MonoBehaviour を継承したクラスにある methodName 名のメソッドを呼び出します。 |
| CompareTag | Checks the GameObject's tag against the defined tag. |
| GetComponent | Gets a reference to a component of type T on the same GameObject as the component specified. |
| GetComponentInChildren | Gets a reference to a component of type T on the same GameObject as the component specified, or any child of the GameObject. |
| GetComponentInParent | Gets a reference to a component of type T on the same GameObject as the component specified, or any parent of the GameObject. |
| GetComponents | Gets references to all components of type T on the same GameObject as the component specified. |
| GetComponentsInChildren | Gets references to all components of type T on the same GameObject as the component specified, and any child of the GameObject. |
| GetComponentsInParent | Gets references to all components of type T on the same GameObject as the component specified, and any parent of the GameObject. |
| SendMessage | ゲームオブジェクトにアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します |
| SendMessageUpwards | ゲームオブジェクトと親(の親、さらに親 ... )にアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します |
| TryGetComponent | Gets the component of the specified type, if it exists. |
| GetInstanceID | Gets the instance ID of the object. |
| ToString | Returns the name of the object. |
| Destroy | Removes a GameObject, component or asset. |
| DestroyImmediate | Destroys the object obj immediately. You are strongly recommended to use Destroy instead. |
| DontDestroyOnLoad | Do not destroy the target Object when loading a new Scene. |
| FindAnyObjectByType | Retrieves any active loaded object of Type type. |
| FindFirstObjectByType | Retrieves the first active loaded object of Type type. |
| FindObjectOfType | タイプ type から最初に見つけたアクティブのオブジェクトを返します |
| FindObjectsByType | Retrieves a list of all loaded objects of Type type. |
| FindObjectsOfType | Gets a list of all loaded objects of Type type. |
| Instantiate | original のオブジェクトをクローンします |
| bool | オブジェクトが存在するかどうか |
| operator != | 二つのオブジェクトが異なるオブジェクトを参照しているか比較します |
| operator == | 2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。 |