Version: 2022.3
言語: 日本語

ReflectionProbe

class in UnityEngine

/

継承:Behaviour

マニュアルに切り替える

説明

リフレクションプローブは周囲の環境を、シェーダーに渡されるテクスチャへとキャプチャし、反射を表現するために使用される技術です。

プロパティーはインスペクターの値と完全に一致しています。

このクラスは 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; } }

Static 変数

defaultTextureThe surface texture of the default reflection probe that captures the environment contribution. Read only.
defaultTextureHDRDecodeValuesHDR decode values of the default reflection probe texture.

変数

backgroundColorリフレクションプローブのテクスチャが内容を決めるのに使用する色
bakedTextureリフレクションプローブの周囲にあるベイクされたテクスチャへの参照
blendDistanceブレンドで周囲にあるプローブを使用する距離(遅延プローブで使用されます)
boundsThe probe's world space axis-aligned bounding box in which the probe can contribute to reflections (Read Only).
boxProjectionこのリフレクションプローブがボックスプロジェクションを使用するかどうか
centerThe 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プローブを描画するカメラから最も近い距離
realtimeTextureReference 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.
renderDynamicObjectsSpecifies 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プローブをレンダリングするときに影も描画する距離
sizeThe size of the probe's bounding box in which the probe can contribute to reflections. The size is in world space.
textureリフレクションプローブ付近にある、オブジェクトのシェーダーに渡されるテクスチャ(読み取り専用)
textureHDRDecodeValuesHDR decode values of the reflection probe texture.
timeSlicingModeプローブの time-slicing モードを設定します。See Also: ReflectionProbeTimeSlicingMode.

Public 関数

IsFinishedRenderingプローブが time-slice モードの描画を終えたかをチェックします。
RenderProbeプローブのキューブマップを更新します。
ResetRevert all ReflectionProbe parameters to default.

Static 関数

BlendCubemap2つのキューブマップをブレンドして、ターゲットレンダーテクスチャにするためのユーティリティーメソッドです。
UpdateCachedStateUpdates 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.

Events

defaultReflectionSetAdds a delegate to get notifications when the default specular Cubemap is changed.
defaultReflectionTextureAdds a delegate to get notifications when the default specular Cubemap is changed.
reflectionProbeChangedAdds a delegate to get notifications when a Reflection Probe is added to a Scene or removed from a Scene.

継承メンバー

変数

enabled有効であれば更新され、無効であれば更新されません。
isActiveAndEnabledReports whether a GameObject and its associated Behaviour is active and enabled.
gameObjectこのコンポーネントはゲームオブジェクトにアタッチされます。コンポーネントはいつもゲームオブジェクトにアタッチされています。
tagゲームオブジェクトのタグ
transformThe Transform attached to this GameObject.
hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameオブジェクト名

Public 関数

BroadcastMessageゲームオブジェクトまたは子オブジェクトにあるすべての MonoBehaviour を継承したクラスにある methodName 名のメソッドを呼び出します。
CompareTagChecks the GameObject's tag against the defined tag.
GetComponentGets a reference to a component of type T on the same GameObject as the component specified.
GetComponentInChildrenGets a reference to a component of type T on the same GameObject as the component specified, or any child of the GameObject.
GetComponentInParentGets a reference to a component of type T on the same GameObject as the component specified, or any parent of the GameObject.
GetComponentsGets references to all components of type T on the same GameObject as the component specified.
GetComponentsInChildrenGets references to all components of type T on the same GameObject as the component specified, and any child of the GameObject.
GetComponentsInParentGets 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 と名付けたメソッドを呼び出します
TryGetComponentGets the component of the specified type, if it exists.
GetInstanceIDGets the instance ID of the object.
ToStringReturns the name of the object.

Static 関数

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindAnyObjectByTypeRetrieves any active loaded object of Type type.
FindFirstObjectByTypeRetrieves the first active loaded object of Type type.
FindObjectOfTypeタイプ type から最初に見つけたアクティブのオブジェクトを返します
FindObjectsByTypeRetrieves a list of all loaded objects of Type type.
FindObjectsOfTypeGets a list of all loaded objects of Type type.
Instantiateoriginal のオブジェクトをクローンします

Operator

boolオブジェクトが存在するかどうか
operator !=二つのオブジェクトが異なるオブジェクトを参照しているか比較します
operator ==2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。