Class HDAdditionalLightData
HDRP Additional light data component. It contains the light API and fields used by HDRP.
Implements
Inherited Members
Namespace: UnityEngine.Rendering.HighDefinition
Assembly: Unity.RenderPipelines.HighDefinition.Runtime.dll
Syntax
[AddComponentMenu("")]
[DisallowMultipleComponent]
[RequireComponent(typeof(Light))]
[ExecuteAlways]
public class HDAdditionalLightData : MonoBehaviour, ISerializationCallbackReceiver, IAdditionalData, IVersionable<HDAdditionalLightData.Version>
Fields
celestialBodyShadingSource
Shading source of the celestial body.
Declaration
[SerializeField]
[FormerlySerializedAs("m_EmissiveLightSource")]
public HDAdditionalLightData.CelestialBodyShadingSource celestialBodyShadingSource
Field Value
Type | Description |
---|---|
HDAdditionalLightData.CelestialBodyShadingSource |
diameterMultiplerMode
Angular diameter mode to use.
Declaration
[SerializeField]
[FormerlySerializedAs("m_DiameterMultiplerMode")]
public bool diameterMultiplerMode
Field Value
Type | Description |
---|---|
bool |
diameterMultiplier
Multiplier for the angular diameter of the celestial body used only when rendering the sun disk.
Declaration
[SerializeField]
[Min(0)]
[FormerlySerializedAs("m_DiameterMultiplier")]
public float diameterMultiplier
Field Value
Type | Description |
---|---|
float |
diameterOverride
Override for the angular diameter of the celestial body used only when rendering the sun disk.
Declaration
[SerializeField]
[Min(0)]
[FormerlySerializedAs("m_DiameterOverride")]
public float diameterOverride
Field Value
Type | Description |
---|---|
float |
earthshine
The intensity of the sunlight reflected from the planet onto the moon.
Declaration
[SerializeField]
[Min(0)]
[FormerlySerializedAs("m_Earthshine")]
public float earthshine
Field Value
Type | Description |
---|---|
float |
flareFalloff
The falloff rate of flare intensity as the angle from the light increases.
Declaration
[SerializeField]
[Min(0)]
[FormerlySerializedAs("m_FlareFalloff")]
public float flareFalloff
Field Value
Type | Description |
---|---|
float |
flareMultiplier
Intensity of the flare.
Declaration
[SerializeField]
[Range(0, 1)]
public float flareMultiplier
Field Value
Type | Description |
---|---|
float |
flareSize
Size the flare around the celestial body (in degrees).
Declaration
[SerializeField]
[Range(0, 90)]
[FormerlySerializedAs("m_FlareSize")]
public float flareSize
Field Value
Type | Description |
---|---|
float |
flareTint
Tints the flare of the celestial body.
Declaration
[SerializeField]
[FormerlySerializedAs("m_FlareTint")]
public Color flareTint
Field Value
Type | Description |
---|---|
Color |
k_DefaultAreaLightIntensity
The default intensity value for area lights in Lumen
Declaration
public const float k_DefaultAreaLightIntensity = 200
Field Value
Type | Description |
---|---|
float |
k_DefaultDirectionalLightIntensity
The default intensity value for directional lights in Lux
Declaration
public const float k_DefaultDirectionalLightIntensity = 3.1415927
Field Value
Type | Description |
---|---|
float |
k_DefaultPunctualLightIntensity
The default intensity value for punctual lights in Lumen
Declaration
public const float k_DefaultPunctualLightIntensity = 600
Field Value
Type | Description |
---|---|
float |
k_DefaultShadowResolution
Default shadow resolution
Declaration
public const int k_DefaultShadowResolution = 512
Field Value
Type | Description |
---|---|
int |
k_MaxAspectRatio
Maximum aspect ratio for pyramid spot lights
Declaration
public const float k_MaxAspectRatio = 20
Field Value
Type | Description |
---|---|
float |
k_MaxSpotAngle
Maximum value for the spot light angle
Declaration
public const float k_MaxSpotAngle = 179
Field Value
Type | Description |
---|---|
float |
k_MaxViewBiasScale
Maximum shadow map view bias scale
Declaration
public const float k_MaxViewBiasScale = 15
Field Value
Type | Description |
---|---|
float |
k_MinAreaWidth
Minimum area light size
Declaration
public const float k_MinAreaWidth = 0.01
Field Value
Type | Description |
---|---|
float |
k_MinAspectRatio
Minimum aspect ratio for pyramid spot lights
Declaration
public const float k_MinAspectRatio = 0.05
Field Value
Type | Description |
---|---|
float |
k_MinSpotAngle
Minimum value for the spot light angle
Declaration
public const float k_MinSpotAngle = 1
Field Value
Type | Description |
---|---|
float |
k_MinViewBiasScale
Minimum shadow map view bias scale
Declaration
public const float k_MinViewBiasScale = 0
Field Value
Type | Description |
---|---|
float |
moonPhase
The percentage of moon that receives sunlight.
Declaration
[SerializeField]
[Range(0, 1)]
[FormerlySerializedAs("m_MoonPhase")]
public float moonPhase
Field Value
Type | Description |
---|---|
float |
moonPhaseRotation
The rotation of the moon phase.
Declaration
[SerializeField]
[Range(0, 360)]
[FormerlySerializedAs("m_MoonPhaseRotation")]
public float moonPhaseRotation
Field Value
Type | Description |
---|---|
float |
sunLightOverride
The Directional light that should illuminate this celestial body.
Declaration
[SerializeField]
public Light sunLightOverride
Field Value
Type | Description |
---|---|
Light |
surfaceTexture
Texture of the surface of the celestial body. Acts like a multiplier.
Declaration
[SerializeField]
[FormerlySerializedAs("m_SurfaceTexture")]
public Texture surfaceTexture
Field Value
Type | Description |
---|---|
Texture |
surfaceTint
Tints the surface of the celestial body.
Declaration
[SerializeField]
[FormerlySerializedAs("m_SurfaceTint")]
public Color surfaceTint
Field Value
Type | Description |
---|---|
Color |
Properties
CustomViewCallbackEvent
Change the View matrix for Spot Light
Declaration
public HDAdditionalLightData.CustomViewCallback CustomViewCallbackEvent { get; set; }
Property Value
Type | Description |
---|---|
HDAdditionalLightData.CustomViewCallback |
IESTexture
IES texture for Point, Spot or Rectangular lights. For Point lights, this must be a cubemap. For Spot or Rectangle lights, this must be a 2D texture
Declaration
public Texture IESTexture { get; set; }
Property Value
Type | Description |
---|---|
Texture |
affectDiffuse
Controls whether the light affects the diffuse or not
Declaration
public bool affectDiffuse { get; set; }
Property Value
Type | Description |
---|---|
bool |
affectSpecular
Controls whether the light affects the specular or not
Declaration
public bool affectSpecular { get; set; }
Property Value
Type | Description |
---|---|
bool |
affectsVolumetric
True if the light affects volumetric fog, false otherwise
Declaration
public bool affectsVolumetric { get; set; }
Property Value
Type | Description |
---|---|
bool |
alwaysDrawDynamicShadows
Whether cached shadows will always draw dynamic shadow casters.
Declaration
public bool alwaysDrawDynamicShadows { get; set; }
Property Value
Type | Description |
---|---|
bool |
angularDiameter
Angular diameter of the celestial body represented by the light as seen from the camera (in degrees). Used to render the sun/moon disk.
Declaration
public float angularDiameter { get; set; }
Property Value
Type | Description |
---|---|
float |
applyRangeAttenuation
If enabled, apply a smooth attenuation factor so at the end of the range, the attenuation is 0. Otherwise the inverse-square attenuation is used and the value never reaches 0.
Declaration
public bool applyRangeAttenuation { get; set; }
Property Value
Type | Description |
---|---|
bool |
areaLightCookie
Get/Set cookie texture for area lights.
Declaration
public Texture areaLightCookie { get; set; }
Property Value
Type | Description |
---|---|
Texture |
areaLightEmissiveMeshLayer
Change the Layer of the generated emissive mesh for Area Light
Declaration
public int areaLightEmissiveMeshLayer { get; set; }
Property Value
Type | Description |
---|---|
int |
areaLightEmissiveMeshMotionVectorGenerationMode
Change the Motion Vector Generation Mode of the generated emissive mesh for Area Light
Declaration
public MotionVectorGenerationMode areaLightEmissiveMeshMotionVectorGenerationMode { get; set; }
Property Value
Type | Description |
---|---|
MotionVectorGenerationMode |
areaLightEmissiveMeshShadowCastingMode
Change the Shadow Casting Mode of the generated emissive mesh for Area Light
Declaration
public ShadowCastingMode areaLightEmissiveMeshShadowCastingMode { get; set; }
Property Value
Type | Description |
---|---|
ShadowCastingMode |
areaLightShadowCone
Get/Set area light shadow cone value.
Declaration
public float areaLightShadowCone { get; set; }
Property Value
Type | Description |
---|---|
float |
areaLightShape
This property has been deprecated, and the area light shapes now exist as separate members in the
UnityEngine.LightType
enum. So hdAdditionalLightData.areaLightShape = AreaLightShape.Rectangle
should
now be written as light.type = LightType.Rectangle
.
Declaration
[Obsolete("This property has been deprecated. Use the UnityEngine.Light.type property instead.", false)]
public AreaLightShape areaLightShape { get; }
Property Value
Type | Description |
---|---|
AreaLightShape |
aspectRatio
Get/Set the aspect ratio of a pyramid light
Declaration
public float aspectRatio { get; set; }
Property Value
Type | Description |
---|---|
float |
barnDoorAngle
Get/Set the angle so that it behaves like a barn door.
Declaration
public float barnDoorAngle { get; set; }
Property Value
Type | Description |
---|---|
float |
barnDoorLength
Get/Set the length for the barn door sides.
Declaration
public float barnDoorLength { get; set; }
Property Value
Type | Description |
---|---|
float |
blockerSampleCount
Controls the number of samples used to detect blockers for PCSS shadows.
Declaration
public int blockerSampleCount { get; set; }
Property Value
Type | Description |
---|---|
int |
cachedShadowAngleUpdateThreshold
If any transform angle of the light is over this threshold (in degrees) since last update, a cached shadow which is set to update upon light movement (updateUponLightMovement from script or Update on Light Movement in UI) is updated.
Declaration
public float cachedShadowAngleUpdateThreshold { get; set; }
Property Value
Type | Description |
---|---|
float |
cachedShadowTranslationUpdateThreshold
Controls the position threshold over which a cached shadow which is set to update upon light movement (updateUponLightMovement from script or Update on Light Movement in UI) triggers an update.
Declaration
public float cachedShadowTranslationUpdateThreshold { get; set; }
Property Value
Type | Description |
---|---|
float |
color
Color of the light.
Declaration
public Color color { get; set; }
Property Value
Type | Description |
---|---|
Color |
colorShadow
Enable color shadows on the light.
Declaration
public bool colorShadow { get; set; }
Property Value
Type | Description |
---|---|
bool |
customSpotLightShadowCone
Get/Set the custom spot shadow cone value.
Declaration
public float customSpotLightShadowCone { get; set; }
Property Value
Type | Description |
---|---|
float |
dirLightPCSSBlockerSampleCount
Controls the number of samples used to detect blockers for directional lights PCSS shadows.
Declaration
public int dirLightPCSSBlockerSampleCount { get; set; }
Property Value
Type | Description |
---|---|
int |
dirLightPCSSBlockerSamplingClumpExponent
Affects how blocker search samples are distributed. Samples distance to center is elevated to this power. A clump exponent of 1 means uniform distribution on the sampling disk. A clump exponent of 2 means distance from center of the uniform distribution are squared (clumped toward center)
Declaration
public float dirLightPCSSBlockerSamplingClumpExponent { get; set; }
Property Value
Type | Description |
---|---|
float |
dirLightPCSSBlockerSearchAngularDiameter
Angular diameter to use for blocker search, will include blockers outside of the light cone when greater than m_AngularDiameter to reduce light bleeding. Increasing this value too much may result in self-shadowing artifacts. A value below m_AngularDiameter will get clamped to m_AngularDiameter
Declaration
public float dirLightPCSSBlockerSearchAngularDiameter { get; set; }
Property Value
Type | Description |
---|---|
float |
dirLightPCSSFilterSampleCount
Controls the number of samples used to filter for directional lights PCSS shadows.
Declaration
public int dirLightPCSSFilterSampleCount { get; set; }
Property Value
Type | Description |
---|---|
int |
dirLightPCSSMaxPenumbraSize
Maximum penumbra size (in world space), limiting blur filter kernel size Measured against a receiving surface perpendicular to light direction (penumbra may get wider for different angles) Very large kernels may affect GPU performance and/or produce undesirable artifacts close to caster
Declaration
public float dirLightPCSSMaxPenumbraSize { get; set; }
Property Value
Type | Description |
---|---|
float |
dirLightPCSSMaxSamplingDistance
Maximum distance from the receiver PCSS shadow sampling occurs, this is to avoid light bleeding due to distant blockers hiding the cone apex and leading to missing occlusion, the lower the least light bleeding but too low will cause self-shadowing Note that the algorithm will also clamp the sampling distance in function of the blocker distance, to avoid light bleeding with very close blockers
Declaration
public float dirLightPCSSMaxSamplingDistance { get; set; }
Property Value
Type | Description |
---|---|
float |
dirLightPCSSMinFilterMaxAngularDiameter
Maximum angular diameter to use to reach minimum filter size, this makes a wider cone at the apex So that we quickly reach minimum filter size while avoiding self-shadowing
Declaration
public float dirLightPCSSMinFilterMaxAngularDiameter { get; set; }
Property Value
Type | Description |
---|---|
float |
dirLightPCSSMinFilterSizeTexels
Minimum PCSS filter size (in shadowmap texels) to avoid aliasing
Declaration
public float dirLightPCSSMinFilterSizeTexels { get; set; }
Property Value
Type | Description |
---|---|
float |
displayAreaLightEmissiveMesh
If enabled, display an emissive mesh rect synchronized with the intensity and color of the light.
Declaration
public bool displayAreaLightEmissiveMesh { get; set; }
Property Value
Type | Description |
---|---|
bool |
distance
Distance from the camera to the emissive celestial body represented by the light.
Declaration
public float distance { get; set; }
Property Value
Type | Description |
---|---|
float |
enableSpotReflector
This property has been deprecated and moved to Light.
Declaration
[Obsolete("This property has been deprecated. Use Light.enableSpotReflector instead.", false)]
public bool enableSpotReflector { get; set; }
Property Value
Type | Description |
---|---|
bool |
evsmBlurPasses
Controls the number of blur passes used for EVSM shadows.
Declaration
public int evsmBlurPasses { get; set; }
Property Value
Type | Description |
---|---|
int |
evsmExponent
Controls the exponent used for EVSM shadows.
Declaration
public float evsmExponent { get; set; }
Property Value
Type | Description |
---|---|
float |
evsmLightLeakBias
Controls the light leak bias value for EVSM shadows.
Declaration
public float evsmLightLeakBias { get; set; }
Property Value
Type | Description |
---|---|
float |
evsmVarianceBias
Controls the variance bias used for EVSM shadows.
Declaration
public float evsmVarianceBias { get; set; }
Property Value
Type | Description |
---|---|
float |
fadeDistance
Get/Set the light fade distance.
Declaration
public float fadeDistance { get; set; }
Property Value
Type | Description |
---|---|
float |
filterSampleCount
Controls the number of samples used to filter for PCSS shadows.
Declaration
public int filterSampleCount { get; set; }
Property Value
Type | Description |
---|---|
int |
filterSizeTraced
Control the size of the filter used for ray traced shadows
Declaration
public int filterSizeTraced { get; set; }
Property Value
Type | Description |
---|---|
int |
filterTracedShadow
Toggle the filtering of ray traced shadows.
Declaration
public bool filterTracedShadow { get; set; }
Property Value
Type | Description |
---|---|
bool |
includeForPathTracing
Controls if the light is enabled when the camera has Path Tracing enabled.
Declaration
public bool includeForPathTracing { get; set; }
Property Value
Type | Description |
---|---|
bool |
includeForRayTracing
Controls if the light is enabled when the camera has the RayTracing frame setting enabled.
Declaration
public bool includeForRayTracing { get; set; }
Property Value
Type | Description |
---|---|
bool |
innerSpotPercent
Get/Set the inner spot radius in percent.
Declaration
public float innerSpotPercent { get; set; }
Property Value
Type | Description |
---|---|
float |
innerSpotPercent01
Get the inner spot radius between 0 and 1.
Declaration
public float innerSpotPercent01 { get; }
Property Value
Type | Description |
---|---|
float |
intensity
This property has been deprecated and moved to Light.
Declaration
[Obsolete("This property has been deprecated. Use Light.intensity instead.", false)]
public float intensity { get; set; }
Property Value
Type | Description |
---|---|
float |
interactsWithSky
Controls if the directional light affect the Physically Based sky. This have no effect on other skies.
Declaration
public bool interactsWithSky { get; set; }
Property Value
Type | Description |
---|---|
bool |
kernelSize
Controls the kernel size for IMSM shadows.
Declaration
public int kernelSize { get; set; }
Property Value
Type | Description |
---|---|
int |
lightAngle
Controls the light angle for IMSM shadows.
Declaration
public float lightAngle { get; set; }
Property Value
Type | Description |
---|---|
float |
lightDimmer
Get/Set the light dimmer / multiplier, between 0 and 16.
Declaration
public float lightDimmer { get; set; }
Property Value
Type | Description |
---|---|
float |
lightShadowRadius
Angular size of the sun in degree.
Declaration
public float lightShadowRadius { get; set; }
Property Value
Type | Description |
---|---|
float |
lightUnit
This property has been deprecated and moved to Light.
Declaration
[Obsolete("This property has been deprecated. Use Light.lightUnit instead.", false)]
public LightUnit lightUnit { get; set; }
Property Value
Type | Description |
---|---|
LightUnit |
lightlayersMask
Controls which layer will be affected by this light
Declaration
public RenderingLayerMask lightlayersMask { get; set; }
Property Value
Type | Description |
---|---|
RenderingLayerMask |
lightmapBakeType
[Editor Only] Set the lightmap bake type.
Declaration
public LightmapBakeType lightmapBakeType { get; set; }
Property Value
Type | Description |
---|---|
LightmapBakeType |
linkShadowLayers
Controls if we want to synchronize shadow map light layers and light layers or not.
Declaration
public bool linkShadowLayers { get; set; }
Property Value
Type | Description |
---|---|
bool |
luxAtDistance
This property has been deprecated and moved to Light.
Declaration
[Obsolete("This property has been deprecated. Use Light.luxAtDistance instead.", false)]
public float luxAtDistance { get; set; }
Property Value
Type | Description |
---|---|
float |
maxDepthBias
Controls the max depth bias for IMSM shadows.
Declaration
public float maxDepthBias { get; set; }
Property Value
Type | Description |
---|---|
float |
maxSmoothness
Get/Set the maximum smoothness of a punctual or directional light.
Declaration
public float maxSmoothness { get; set; }
Property Value
Type | Description |
---|---|
float |
minFilterSize
Controls the minimum filter size of PCSS shadows.
Declaration
public float minFilterSize { get; set; }
Property Value
Type | Description |
---|---|
float |
nonLightmappedOnly
Only used when the shadow masks are enabled, control if the we use ShadowMask or DistanceShadowmask for this light.
Declaration
public bool nonLightmappedOnly { get; set; }
Property Value
Type | Description |
---|---|
bool |
normalBias
Get/Set the normal bias of the shadow maps.
Declaration
public float normalBias { get; set; }
Property Value
Type | Description |
---|---|
float |
numRayTracingSamples
Controls the number of sample used for the ray traced shadows.
Declaration
public int numRayTracingSamples { get; set; }
Property Value
Type | Description |
---|---|
int |
onDemandShadowRenderOnPlacement
If the shadow update mode is set to OnDemand, this parameter controls whether the shadows are rendered the first time without needing an explicit render request. If this properties is false, the OnDemand shadows will never be rendered unless a render request is performed explicitly.
Declaration
public bool onDemandShadowRenderOnPlacement { get; set; }
Property Value
Type | Description |
---|---|
bool |
penumbraTint
Controls if we want to ray trace the contact shadow.
Declaration
public bool penumbraTint { get; set; }
Property Value
Type | Description |
---|---|
bool |
preserveCachedShadow
Controls whether the cached shadow maps for this light is preserved upon disabling the light. If this field is set to true, then the light will maintain its space in the cached shadow atlas until it is destroyed.
Declaration
public bool preserveCachedShadow { get; set; }
Property Value
Type | Description |
---|---|
bool |
range
The range of the light.
Declaration
public float range { get; set; }
Property Value
Type | Description |
---|---|
float |
rayTraceContactShadow
Controls if we want to ray trace the contact shadow.
Declaration
public bool rayTraceContactShadow { get; set; }
Property Value
Type | Description |
---|---|
bool |
semiTransparentShadow
Enable semi-transparent shadows on the light.
Declaration
public bool semiTransparentShadow { get; set; }
Property Value
Type | Description |
---|---|
bool |
shadowDimmer
Get/Set the shadow dimmer.
Declaration
public float shadowDimmer { get; set; }
Property Value
Type | Description |
---|---|
float |
shadowFadeDistance
Get/Set the shadow fade distance.
Declaration
public float shadowFadeDistance { get; set; }
Property Value
Type | Description |
---|---|
float |
shadowNearPlane
Controls the near plane distance of the shadows.
Declaration
public float shadowNearPlane { get; set; }
Property Value
Type | Description |
---|---|
float |
shadowResolution
Retrieve the scalable setting for shadow resolution. Use the SetShadowResolution function to set a custom resolution.
Declaration
public IntScalableSettingValue shadowResolution { get; }
Property Value
Type | Description |
---|---|
IntScalableSettingValue |
shadowTint
Controls the tint of the shadows.
Declaration
public Color shadowTint { get; set; }
Property Value
Type | Description |
---|---|
Color |
shadowUpdateMode
Get/Set the shadow update mode.
Declaration
public ShadowUpdateMode shadowUpdateMode { get; set; }
Property Value
Type | Description |
---|---|
ShadowUpdateMode |
shapeHeight
Control the height of an area, a box spot light or a directional light cookie.
Declaration
public float shapeHeight { get; set; }
Property Value
Type | Description |
---|---|
float |
shapeRadius
Get/Set the radius of a light
Declaration
public float shapeRadius { get; set; }
Property Value
Type | Description |
---|---|
float |
shapeWidth
Control the width of an area, a box spot light or a directional light cookie.
Declaration
public float shapeWidth { get; set; }
Property Value
Type | Description |
---|---|
float |
slopeBias
Get/Set the slope bias of the shadow maps.
Declaration
public float slopeBias { get; set; }
Property Value
Type | Description |
---|---|
float |
softnessScale
Get/Set the scale factor applied to shape radius or angular diameter for the softness calculation.
Declaration
public float softnessScale { get; set; }
Property Value
Type | Description |
---|---|
float |
spotIESCutoffPercent
Get/Set the spot ies cutoff.
Declaration
public float spotIESCutoffPercent { get; set; }
Property Value
Type | Description |
---|---|
float |
spotIESCutoffPercent01
Get the inner spot radius between 0 and 1.
Declaration
public float spotIESCutoffPercent01 { get; }
Property Value
Type | Description |
---|---|
float |
spotLightShape
This property has been deprecated, and the spot light shapes now exist as separate members in the
UnityEngine.LightType
enum. So hdAdditionalLightData.spotLightShape = SpotLightShape.Pyramid
should now
be written as light.type = LightType.Pyramid
.
Declaration
[Obsolete("This property has been deprecated. Use the UnityEngine.Light.type property instead.", false)]
public SpotLightShape spotLightShape { get; }
Property Value
Type | Description |
---|---|
SpotLightShape |
sunLightConeAngle
Angular size of the sun in degree.
Declaration
public float sunLightConeAngle { get; set; }
Property Value
Type | Description |
---|---|
float |
type
This property has been deprecated, and light types that existed only in HDRP have been moved into
the UnityEngine.LightType
instead. So hdAdditionalLightData.type = HDLightType.Point
should now be
written as light.type = LightType.Point
Declaration
[Obsolete("This property has been deprecated. Use the UnityEngine.Light.type property instead.", false)]
public HDLightType type { get; set; }
Property Value
Type | Description |
---|---|
HDLightType |
updateUponLightMovement
Whether a cached shadow map will be automatically updated when the light transform changes (more than a given threshold set via cachedShadowTranslationUpdateThreshold and cachedShadowAngleUpdateThreshold).
Declaration
public bool updateUponLightMovement { get; set; }
Property Value
Type | Description |
---|---|
bool |
useContactShadow
Retrieve the scalable setting to use/ignore contact shadows. Toggle the use contact shadow using @override property of the ScalableSetting.
Declaration
public BoolScalableSettingValue useContactShadow { get; }
Property Value
Type | Description |
---|---|
BoolScalableSettingValue |
useCustomSpotLightShadowCone
Toggle the custom spot light shadow cone.
Declaration
public bool useCustomSpotLightShadowCone { get; set; }
Property Value
Type | Description |
---|---|
bool |
useRayTracedShadows
Controls if we use ray traced shadows.
Declaration
public bool useRayTracedShadows { get; set; }
Property Value
Type | Description |
---|---|
bool |
useScreenSpaceShadows
Controls if we resolve the directional light shadows in screen space (ray tracing only).
Declaration
public bool useScreenSpaceShadows { get; set; }
Property Value
Type | Description |
---|---|
bool |
volumetricDimmer
Get/Set the light dimmer / multiplier on volumetric effects, between 0 and 16.
Declaration
public float volumetricDimmer { get; set; }
Property Value
Type | Description |
---|---|
float |
volumetricFadeDistance
Get/Set the light fade distance for volumetrics.
Declaration
public float volumetricFadeDistance { get; set; }
Property Value
Type | Description |
---|---|
float |
volumetricShadowDimmer
Get/Set the volumetric shadow dimmer value, between 0 and 1.
Declaration
public float volumetricShadowDimmer { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
CopyTo(HDAdditionalLightData)
Copy all field from this to an additional light data
Declaration
public void CopyTo(HDAdditionalLightData data)
Parameters
Type | Name | Description |
---|---|---|
HDAdditionalLightData | data | Destination component |
EnableColorTemperature(bool)
Toggle the usage of color temperature.
Declaration
public void EnableColorTemperature(bool enable)
Parameters
Type | Name | Description |
---|---|---|
bool | enable |
EnableShadows(bool)
Enable shadows on a light.
Declaration
public void EnableShadows(bool enabled)
Parameters
Type | Name | Description |
---|---|---|
bool | enabled |
GetLightLayers()
Returns a mask of light layers as uint and handle the case of Everything as being 0xFF and not -1
Declaration
public uint GetLightLayers()
Returns
Type | Description |
---|---|
uint |
GetLightTypeAndShape()
This method has been deprecated. Getting the type of the light is now much simpler, and done
completely via the UnityEngine.Light
monobehavior. So
var type = hdAdditionalLightData.GetLightTypeAndShape()
should now be written as
var type = light.type
.
Declaration
[Obsolete("This method has been deprecated. Use Light.type instead.", false)]
public HDLightTypeAndShape GetLightTypeAndShape()
Returns
Type | Description |
---|---|
HDLightTypeAndShape |
GetShadowLayers()
Returns a mask of shadow light layers as uint and handle the case of Everything as being 0xFF and not -1
Declaration
public uint GetShadowLayers()
Returns
Type | Description |
---|---|
uint |
GetSupportedLightUnits()
This method has been deprecated.
Declaration
[Obsolete("This function has been deprecated. Use LightUnitUtils.IsLightUnitSupported(LightType, LightUnit) instead.", false)]
public LightUnit[] GetSupportedLightUnits()
Returns
Type | Description |
---|---|
LightUnit[] | Array of supported units |
GetSupportedLightUnits(LightType)
This method has been deprecated.
Declaration
[Obsolete("This function has been deprecated. Use LightUnitUtils.IsLightUnitSupported(LightType, LightUnit) instead.", false)]
public static LightUnit[] GetSupportedLightUnits(LightType type)
Parameters
Type | Name | Description |
---|---|---|
LightType | type | The type of the light |
Returns
Type | Description |
---|---|
LightUnit[] | Array of supported units |
GetSupportedLightUnits(HDLightType, SpotLightShape)
This method has been deprecated.
Declaration
[Obsolete("This method has been deprecated. Use the GetSupportedLightUnits(LightType) overload instead.", false)]
public static LightUnit[] GetSupportedLightUnits(HDLightType type, SpotLightShape spotLightShape)
Parameters
Type | Name | Description |
---|---|---|
HDLightType | type | |
SpotLightShape | spotLightShape |
Returns
Type | Description |
---|---|
LightUnit[] |
InitDefaultHDAdditionalLightData(HDAdditionalLightData)
Initialize an HDAdditionalLightData that have just beeing created.
Declaration
public static void InitDefaultHDAdditionalLightData(HDAdditionalLightData lightData)
Parameters
Type | Name | Description |
---|---|---|
HDAdditionalLightData | lightData |
IsValidLightUnitForType(LightType, LightUnit)
This method has been deprecated. Use the equivalent function LightUnitUtils.IsLightUnitSupported(...) instead.
Declaration
[Obsolete("This function has been deprecated. Use LightUnitUtils.IsLightUnitSupported(LightType, LightUnit) instead.", false)]
public static bool IsValidLightUnitForType(LightType type, LightUnit unit)
Parameters
Type | Name | Description |
---|---|---|
LightType | type | The type of the light |
LightUnit | unit | The unit to check |
Returns
Type | Description |
---|---|
bool | True: this unit is supported |
IsValidLightUnitForType(HDLightType, SpotLightShape, LightUnit)
This method has been dperecated.
Declaration
[Obsolete("This method has been deprecated. Use LightUnitUtils.IsLightUnitSupported(LightType, LightUnit) instead.", false)]
public static bool IsValidLightUnitForType(HDLightType type, SpotLightShape spotLightShape, LightUnit unit)
Parameters
Type | Name | Description |
---|---|---|
HDLightType | type | |
SpotLightShape | spotLightShape | |
LightUnit | unit |
Returns
Type | Description |
---|---|
bool |
RequestShadowMapRendering()
Request shadow map rendering when Update Mode is set to On Demand.
Declaration
public void RequestShadowMapRendering()
RequestSubShadowMapRendering(int)
Some lights render more than one shadow maps (e.g. cascade shadow maps or point lights). This method is used to request the rendering of specific shadow map when Update Mode is set to On Demand. For example, to request the update of a second cascade, shadowIndex should be 1. Note: if shadowIndex is a 0-based index and it must be lower than the number of shadow maps a light renders (i.e. cascade count for directional lights, 6 for point lights).
Declaration
public void RequestSubShadowMapRendering(int shadowIndex)
Parameters
Type | Name | Description |
---|---|---|
int | shadowIndex | The index of the subshadow to update. |
SetAreaLightSize(Vector2)
Set the area light size.
Declaration
public void SetAreaLightSize(Vector2 size)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | size |
SetBoxSpotSize(Vector2)
Set the box spot light size.
Declaration
public void SetBoxSpotSize(Vector2 size)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | size |
SetColor(Color, float)
Set the color of the light.
Declaration
public void SetColor(Color color, float colorTemperature = -1)
Parameters
Type | Name | Description |
---|---|---|
Color | color | Color |
float | colorTemperature | Optional color temperature |
SetCookie(Texture)
Set light cookie.
Declaration
public void SetCookie(Texture cookie)
Parameters
Type | Name | Description |
---|---|---|
Texture | cookie | Cookie texture, must be 2D for Directional, Spot and Area light and Cubemap for Point lights |
SetCookie(Texture, Vector2)
Set light cookie. Note that the texture must have a power of two size.
Declaration
public void SetCookie(Texture cookie, Vector2 directionalLightCookieSize)
Parameters
Type | Name | Description |
---|---|---|
Texture | cookie | Cookie texture, must be 2D for Directional, Spot and Area light and Cubemap for Point lights |
Vector2 | directionalLightCookieSize | area light |
SetCullingMask(int)
Set the light culling mask.
Declaration
public void SetCullingMask(int cullingMask)
Parameters
Type | Name | Description |
---|---|---|
int | cullingMask |
SetDirectionalShadowTint(Color)
Set the Shadow tint for the directional light.
Declaration
public void SetDirectionalShadowTint(Color tint)
Parameters
Type | Name | Description |
---|---|---|
Color | tint |
SetIntensity(float)
This method has been deprecated. If you need to set a light's intensity measured by some light unit, you should use the ConvertIntensity(...) method in LightUnitUtils and set Light.intensity directly.
Declaration
[Obsolete("This method has been deprecated. Use LightUnitUtils.ConvertIntensity(...) & directly set Light.intensity instead.", false)]
public void SetIntensity(float intensity)
Parameters
Type | Name | Description |
---|---|---|
float | intensity | Light intensity |
SetIntensity(float, LightUnit)
This method has been deprecated. If you need to set a light's intensity measured by some light unit, you should use the ConvertIntensity(...) method in LightUnitUtils and set Light.intensity directly. If you need to change the unit, set Light.lightUnit directly.
Declaration
[Obsolete("This property has been deprecated. Use LightUnitUtils.ConvertIntensity(...) & directly set Light.lightUnit + Light.intensity instead.", false)]
public void SetIntensity(float intensity, LightUnit unit)
Parameters
Type | Name | Description |
---|---|---|
float | intensity | Light intensity |
LightUnit | unit | Unit must be a valid Light Unit for the current light type |
SetLayerShadowCullDistances(float[])
Set the light layer shadow cull distances.
Declaration
public float[] SetLayerShadowCullDistances(float[] layerShadowCullDistances)
Parameters
Type | Name | Description |
---|---|---|
float[] | layerShadowCullDistances |
Returns
Type | Description |
---|---|
float[] |
SetLightDimmer(float, float)
Set the dimmer for light and volumetric light.
Declaration
public void SetLightDimmer(float dimmer = 1, float volumetricDimmer = 1)
Parameters
Type | Name | Description |
---|---|---|
float | dimmer | Dimmer for the light |
float | volumetricDimmer | Dimmer for the volumetrics |
SetLightLayer(RenderingLayerMask, RenderingLayerMask)
Set the light layer and shadow map light layer masks. The feature must be enabled in the HDRP asset in norder to work.
Declaration
public void SetLightLayer(RenderingLayerMask lightLayerMask, RenderingLayerMask shadowLayerMask)
Parameters
Type | Name | Description |
---|---|---|
RenderingLayerMask | lightLayerMask | Layer mask for receiving light |
RenderingLayerMask | shadowLayerMask | Layer mask for shadow rendering |
SetLightTypeAndShape(HDLightTypeAndShape)
This method has been deprecated. Setting the type of the light is now much simpler, and done
completely in the UnityEngine.Light
monobehavior. So
hdAdditionalLightData.SetLightTypeAndShape(HDLightTypeAndShape.PyramidSpot)
should now be written as
light.type = LightType.Pyramid
.
Declaration
[Obsolete("This method has been deprecated. Set the UnityEngine.Light.type property instead.", false)]
public void SetLightTypeAndShape(HDLightTypeAndShape typeAndShape)
Parameters
Type | Name | Description |
---|---|---|
HDLightTypeAndShape | typeAndShape |
SetLightUnit(LightUnit)
This method has been deprecated.
Declaration
[Obsolete("This property has been deprecated. Directly set Light.lightUnit instead.", false)]
public void SetLightUnit(LightUnit unit)
Parameters
Type | Name | Description |
---|---|---|
LightUnit | unit | Unit of the light |
SetPCSSParams(int, int, float, float)
Set parameters for PCSS shadows.
Declaration
public void SetPCSSParams(int blockerSampleCount = 16, int filterSampleCount = 24, float minFilterSize = 0.01, float radiusScaleForSoftness = 1)
Parameters
Type | Name | Description |
---|---|---|
int | blockerSampleCount | Number of samples used to detect blockers |
int | filterSampleCount | Number of samples used to filter the shadow map |
float | minFilterSize | Minimum filter intensity |
float | radiusScaleForSoftness | Scale applied to shape radius or angular diameter in the softness calculations. |
SetRange(float)
Set the range of the light.
Declaration
public void SetRange(float range)
Parameters
Type | Name | Description |
---|---|---|
float | range |
SetShadowDimmer(float, float)
Set the shadow dimmer.
Declaration
public void SetShadowDimmer(float shadowDimmer = 1, float volumetricShadowDimmer = 1)
Parameters
Type | Name | Description |
---|---|---|
float | shadowDimmer | Dimmer between 0 and 1 |
float | volumetricShadowDimmer | Dimmer between 0 and 1 for volumetrics |
SetShadowFadeDistance(float)
Shadow fade distance in meter.
Declaration
public void SetShadowFadeDistance(float distance)
Parameters
Type | Name | Description |
---|---|---|
float | distance |
SetShadowLightLayer(RenderingLayerMask)
Set the shadow map light layer masks. The feature must be enabled in the HDRP asset in norder to work.
Declaration
public void SetShadowLightLayer(RenderingLayerMask shadowLayerMask)
Parameters
Type | Name | Description |
---|---|---|
RenderingLayerMask | shadowLayerMask |
SetShadowNearPlane(float)
Set the near plane of the shadow.
Declaration
public void SetShadowNearPlane(float nearPlaneDistance)
Parameters
Type | Name | Description |
---|---|---|
float | nearPlaneDistance |
SetShadowResolution(int)
Set the shadow resolution.
Declaration
public void SetShadowResolution(int resolution)
Parameters
Type | Name | Description |
---|---|---|
int | resolution | Must be between 16 and 16384 but we will allow 0 to turn off the shadow |
SetShadowResolutionLevel(int)
Set the shadow resolution quality level.
Declaration
public void SetShadowResolutionLevel(int level)
Parameters
Type | Name | Description |
---|---|---|
int | level | The quality level to use |
SetShadowResolutionOverride(bool)
Set whether the shadow resolution use the override value.
Declaration
public void SetShadowResolutionOverride(bool useOverride)
Parameters
Type | Name | Description |
---|---|---|
bool | useOverride | True to use the override value, false otherwise. |
SetShadowUpdateMode(ShadowUpdateMode)
Set the shadow update mode.
Declaration
public void SetShadowUpdateMode(ShadowUpdateMode updateMode)
Parameters
Type | Name | Description |
---|---|---|
ShadowUpdateMode | updateMode |
SetSpotAngle(float, float)
Set the spot light angle and inner spot percent. We don't use Light.innerSpotAngle.
Declaration
public void SetSpotAngle(float angle, float innerSpotPercent = 0)
Parameters
Type | Name | Description |
---|---|---|
float | angle | inner spot angle in degree |
float | innerSpotPercent | inner spot angle in percent |
SetSpotLightLuxAt(float, float)
This method has been deprecated. If you need to set a light's intensity measured by some light unit, you should use the ConvertIntensity(...) method in LightUnitUtils and set Light.intensity directly. If you need to change the unit, set Light.lightUnit directly. If you need to change lux at distance, set light.luxAtDistance directly.
Declaration
[Obsolete("This method has been deprecated. Use LightUnitUtils.ConvertIntensity(...) & directly set Light.luxAtDistance + Light.lightUnit + Light.intensity instead.", false)]
public void SetSpotLightLuxAt(float luxIntensity, float distance)
Parameters
Type | Name | Description |
---|---|---|
float | luxIntensity | Lux intensity |
float | distance | Lux at distance |
UpdateAllLightValues()
Synchronize all the HD Additional Light values with the Light component.
Declaration
public void UpdateAllLightValues()