Class HDProbe
Base class for reflection like probes.
Inherited Members
Namespace: UnityEngine.Rendering.HighDefinition
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 |
---|---|
Boolean |
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 |
---|---|
Single |
m_ObsoleteWeight
Obsolete field
Declaration
[SerializeField]
[FormerlySerializedAs("m_Weight")]
[FormerlySerializedAs("weight")]
[Obsolete("For Data Migration")]
[Range(0F, 1F)]
protected float m_ObsoleteWeight
Field Value
Type | Description |
---|---|
Single |
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
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 |
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 |
---|---|
Single |
frameSettings
Frame settings in use with this probe.
Declaration
public FrameSettings frameSettings { get; }
Property Value
Type | Description |
---|---|
FrameSettings |
frameSettingsOverrideMask
Specify the settings overriden for the frame settins
Declaration
public 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 |
---|---|
Boolean |
lightLayers
Light layer to use by this probe.
Declaration
public LightLayerEnum lightLayers { get; set; }
Property Value
Type | Description |
---|---|
LightLayerEnum |
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 |
---|---|
UInt32 |
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 |
---|---|
Single |
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 |
---|---|
Single |
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 |
---|---|
UnityEngine.Rendering.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 |
---|---|
UnityEngine.Rendering.RTHandle |
renderData
The currently used render data.
Declaration
public HDProbe.RenderData renderData { get; }
Property Value
Type | Description |
---|---|
HDProbe.RenderData |
resolution
Resolution of the 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 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 |
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 |
---|---|
Boolean |
weight
Weight for blending amongst probes (non PBR parameter).
Declaration
public float weight { get; set; }
Property Value
Type | Description |
---|---|
Single |
Methods
GetRenderData(ProbeSettings.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(ProbeSettings.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 |
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()
Request to render this probe next update.
Call this method with the mode OnDemand and the probe will be rendered the next time it will influence a camera rendering.
Declaration
public void RequestRenderNextUpdate()
SetDepthTexture(ProbeSettings.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(ProbeSettings.Mode, HDProbe.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(ProbeSettings.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 |
Explicit Interface Implementations
IVersionable<HDProbe.Version>.version
Declaration
HDProbe.Version IVersionable<HDProbe.Version>.version { get; set; }
Returns
Type | Description |
---|---|
HDProbe.Version |