Class HDProbe
Base class for reflection like probes.
Implements
Inherited Members
Namespace: UnityEngine.Rendering.HighDefinition
Assembly: Unity.RenderPipelines.HighDefinition.Runtime.dll
Syntax
[ExecuteAlways]
public abstract class HDProbe : MonoBehaviour, IVersionable<HDProbe.Version>
Fields
k_Migration
The migration steps for HDProbes
Declaration
protected static readonly MigrationDescription<HDProbe.Version, HDProbe> k_Migration
Field Value
| Type | Description |
|---|---|
| MigrationDescription<HDProbe.Version, HDProbe> |
m_ObsoleteInfiniteProjection
Obsolete field
Declaration
[SerializeField]
[FormerlySerializedAs("m_InfiniteProjection")]
[Obsolete("For Data Migration")]
protected bool m_ObsoleteInfiniteProjection
Field Value
| Type | Description |
|---|---|
| bool |
m_ObsoleteInfluenceVolume
Obsolete field
Declaration
[SerializeField]
[FormerlySerializedAs("m_InfluenceVolume")]
[Obsolete("For Data Migration")]
protected InfluenceVolume m_ObsoleteInfluenceVolume
Field Value
| Type | Description |
|---|---|
| InfluenceVolume |
m_ObsoleteMode
Obsolete field
Declaration
[SerializeField]
[FormerlySerializedAs("m_Mode")]
[Obsolete("For Data Migration")]
protected ProbeSettings.Mode m_ObsoleteMode
Field Value
| Type | Description |
|---|---|
| ProbeSettings.Mode |
m_ObsoleteMultiplier
Obsolete field
Declaration
[SerializeField]
[FormerlySerializedAs("m_Multiplier")]
[FormerlySerializedAs("dimmer")]
[FormerlySerializedAs("m_Dimmer")]
[FormerlySerializedAs("multiplier")]
[Obsolete("For Data Migration")]
protected float m_ObsoleteMultiplier
Field Value
| Type | Description |
|---|---|
| float |
m_ObsoleteWeight
Obsolete field
Declaration
[SerializeField]
[FormerlySerializedAs("m_Weight")]
[FormerlySerializedAs("weight")]
[Obsolete("For Data Migration")]
[Range(0, 1)]
protected float m_ObsoleteWeight
Field Value
| Type | Description |
|---|---|
| float |
m_ProbeSettings
Backed values of the probe settings. Don't use directly this except for migration code.
Declaration
[SerializeField]
protected ProbeSettings m_ProbeSettings
Field Value
| Type | Description |
|---|---|
| ProbeSettings |
Properties
ExposureControlEnabled
Set and used by the pipeline, depending on the resolved configuration of a probe.
Declaration
public bool ExposureControlEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
bakedRenderData
The render data of the last bake
Declaration
public HDProbe.RenderData bakedRenderData { get; set; }
Property Value
| Type | Description |
|---|---|
| HDProbe.RenderData |
bakedTexture
The baked texture. Can be null if the probe was never baked.
Most of the time, you do not need to set this value yourself. You can set this property in situations where you want to manually assign data that differs from what Unity generates.
Declaration
public Texture bakedTexture { get; set; }
Property Value
| Type | Description |
|---|---|
| Texture |
boundingSphere
The bounding sphere of the influence
Declaration
public BoundingSphere boundingSphere { get; }
Property Value
| Type | Description |
|---|---|
| BoundingSphere |
bounds
The bounding box of the influence
Declaration
public Bounds bounds { get; }
Property Value
| Type | Description |
|---|---|
| Bounds |
cubeResolution
Resolution of the cube probe.
Declaration
public CubeReflectionResolution cubeResolution { get; }
Property Value
| Type | Description |
|---|---|
| CubeReflectionResolution |
customRenderData
The render data of the custom mode
Declaration
public HDProbe.RenderData customRenderData { get; set; }
Property Value
| Type | Description |
|---|---|
| HDProbe.RenderData |
customTexture
Texture used in custom mode.
Declaration
public Texture customTexture { get; set; }
Property Value
| Type | Description |
|---|---|
| Texture |
fadeDistance
The distance at which reflections smoothly fade out before HDRP cut them completely.
Declaration
public float fadeDistance { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
frameSettings
Frame settings in use with this probe.
Declaration
public ref FrameSettings frameSettings { get; }
Property Value
| Type | Description |
|---|---|
| FrameSettings |
frameSettingsOverrideMask
Specify the settings overriden for the frame settins
Declaration
public ref FrameSettingsOverrideMask frameSettingsOverrideMask { get; }
Property Value
| Type | Description |
|---|---|
| FrameSettingsOverrideMask |
influenceVolume
InfluenceVolume of the probe.
Declaration
public InfluenceVolume influenceVolume { get; }
Property Value
| Type | Description |
|---|---|
| InfluenceVolume |
isProjectionInfinite
Is the projection at infinite? Value could be changed by Proxy mode.
Declaration
public bool isProjectionInfinite { get; }
Property Value
| Type | Description |
|---|---|
| bool |
lightLayers
Light layer to use by this probe.
Declaration
public RenderingLayerMask lightLayers { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderingLayerMask |
lightLayersAsUInt
This function return a mask of light layers as uint and handle the case of Everything as being 0xFF and not -1
Declaration
public uint lightLayersAsUInt { get; }
Property Value
| Type | Description |
|---|---|
| uint |
mode
The capture mode.
Declaration
public ProbeSettings.Mode mode { get; set; }
Property Value
| Type | Description |
|---|---|
| ProbeSettings.Mode |
multiplier
Multiplier factor of reflection (non PBR parameter).
Declaration
public float multiplier { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
proxyExtents
The extents of the proxy volume
Declaration
public Vector3 proxyExtents { get; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
proxyVolume
ProxyVolume currently used by this probe.
Declaration
public ReflectionProxyVolumeComponent proxyVolume { get; set; }
Property Value
| Type | Description |
|---|---|
| ReflectionProxyVolumeComponent |
rangeCompressionFactor
The result of the rendering of the probe will be divided by this factor. When the probe is read, this factor is undone as the probe data is read. This is to simply avoid issues with values clamping due to precision of the storing format.
Declaration
public float rangeCompressionFactor { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
realtimeDepthTexture
The allocated realtime depth texture. Can be null if the probe never rendered with the realtime mode.
Most of the time, you do not need to set this value yourself. You can set this property in situations where you want to manually assign data that differs from what Unity generates.
Declaration
public RenderTexture realtimeDepthTexture { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderTexture |
realtimeDepthTextureRTH
Returns an RThandle reference to the realtime texture where the depth result of the probe is stored.
Declaration
public RTHandle realtimeDepthTextureRTH { get; }
Property Value
| Type | Description |
|---|---|
| RTHandle |
realtimeMode
The realtime mode of the probe
Declaration
public ProbeSettings.RealtimeMode realtimeMode { get; set; }
Property Value
| Type | Description |
|---|---|
| ProbeSettings.RealtimeMode |
realtimeRenderData
The render data of the last realtime rendering
Declaration
public HDProbe.RenderData realtimeRenderData { get; set; }
Property Value
| Type | Description |
|---|---|
| HDProbe.RenderData |
realtimeTexture
The allocated realtime texture. Can be null if the probe never rendered with the realtime mode.
Most of the time, you do not need to set this value yourself. You can set this property in situations where you want to manually assign data that differs from what Unity generates.
Declaration
public RenderTexture realtimeTexture { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderTexture |
realtimeTextureRTH
Returns an RThandle reference to the realtime texture where the color result of the probe is stored.
Declaration
public RTHandle realtimeTextureRTH { get; }
Property Value
| Type | Description |
|---|---|
| RTHandle |
renderData
The currently used render data.
Declaration
public HDProbe.RenderData renderData { get; }
Property Value
| Type | Description |
|---|---|
| HDProbe.RenderData |
resolution
Resolution of the planar probe.
Declaration
public PlanarReflectionAtlasResolution resolution { get; }
Property Value
| Type | Description |
|---|---|
| PlanarReflectionAtlasResolution |
settings
Use this property to get the settings used for calculations.
To edit the settings of the probe, use the unsanitized version of this property: settingsRaw.
Declaration
public ProbeSettings settings { get; }
Property Value
| Type | Description |
|---|---|
| ProbeSettings |
settingsRaw
To read the settings of this probe, most of the time you should use the sanitized version of this property: settings. Use this property to read the settings of the probe only when it is important that you read the raw data.
Declaration
public ref ProbeSettings settingsRaw { get; }
Property Value
| Type | Description |
|---|---|
| ProbeSettings |
texture
The texture used during lighting for this probe.
Declaration
public Texture texture { get; }
Property Value
| Type | Description |
|---|---|
| Texture |
timeSlicing
Whether the realtime probe uses time slicing
Declaration
public bool timeSlicing { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
type
The probe type
Declaration
public ProbeSettings.ProbeType type { get; protected set; }
Property Value
| Type | Description |
|---|---|
| ProbeSettings.ProbeType |
useInfluenceVolumeAsProxyVolume
Use the influence volume as the proxy volume if this is true.
Declaration
public bool useInfluenceVolumeAsProxyVolume { get; }
Property Value
| Type | Description |
|---|---|
| bool |
weight
Weight for blending amongst probes (non PBR parameter).
Declaration
public float weight { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
GetRenderData(Mode)
Get the render data of a specific mode.
Note: The HDProbe stores only one RenderData per mode, even for view dependent probes with multiple viewers. In that case, make sure that you have set the RenderData relative to the expected viewer before rendering. Otherwise the data retrieved by this function will be wrong.
Declaration
public HDProbe.RenderData GetRenderData(ProbeSettings.Mode targetMode)
Parameters
| Type | Name | Description |
|---|---|---|
| ProbeSettings.Mode | targetMode | The mode to query |
Returns
| Type | Description |
|---|---|
| HDProbe.RenderData | The requested render data |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | When the mode is invalid |
GetTexture(Mode)
Get the texture for a specific mode.
Declaration
public Texture GetTexture(ProbeSettings.Mode targetMode)
Parameters
| Type | Name | Description |
|---|---|---|
| ProbeSettings.Mode | targetMode | The mode to query. |
Returns
| Type | Description |
|---|---|
| Texture | The texture for this specified mode. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | When the |
IsTurnedOff()
Checks weather the current probe is set to off.
Declaration
public bool IsTurnedOff()
Returns
| Type | Description |
|---|---|
| bool | Returns true if the the selected probe has its resolution set to off. |
PrepareCulling()
Prepare the probe for culling. You should call this method when you update the influenceVolume parameters during runtime.
Declaration
public virtual void PrepareCulling()
RequestRenderNextUpdate()
Requests that Unity renders this Reflection Probe during the next update.
Declaration
public void RequestRenderNextUpdate()
Remarks
If the Reflection Probe uses OnDemand mode, Unity renders the probe the next time the probe influences a Camera rendering.
If the Reflection Probe doesn't have an attached HDAdditionalReflectionData component, calling this function has no effect.
Note: If any part of a Camera's frustum intersects a Reflection Probe's influence volume, the Reflection Probe influences the Camera.
SetDepthTexture(Mode, Texture)
Set the depth texture for a specific target mode.
Declaration
public Texture SetDepthTexture(ProbeSettings.Mode targetMode, Texture texture)
Parameters
| Type | Name | Description |
|---|---|---|
| ProbeSettings.Mode | targetMode | The mode to update. |
| Texture | texture | The texture to set. |
Returns
| Type | Description |
|---|---|
| Texture | The texture that was set. |
SetRenderData(Mode, RenderData)
Set the render data for a specific mode.
Note: The HDProbe stores only one RenderData per mode, even for view dependent probes with multiple viewers. In that case, make sure that you have set the RenderData relative to the expected viewer before rendering.
Declaration
public void SetRenderData(ProbeSettings.Mode targetMode, HDProbe.RenderData renderData)
Parameters
| Type | Name | Description |
|---|---|---|
| ProbeSettings.Mode | targetMode | The mode to update |
| HDProbe.RenderData | renderData | The data to set |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | When the mode is invalid |
SetTexture(Mode, Texture)
Set the texture for a specific target mode.
Declaration
public Texture SetTexture(ProbeSettings.Mode targetMode, Texture texture)
Parameters
| Type | Name | Description |
|---|---|---|
| ProbeSettings.Mode | targetMode | The mode to update. |
| Texture | texture | The texture to set. |
Returns
| Type | Description |
|---|---|
| Texture | The texture that was set. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | When the texture is invalid. |
| ArgumentOutOfRangeException | When the mode is invalid |