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
Name | Description |
---|---|
k_DefaultAreaLightIntensity | The default intensity value for area lights in Lumen |
k_DefaultDirectionalLightIntensity | The default intensity value for directional lights in Lux |
k_DefaultPunctualLightIntensity | The default intensity value for punctual lights in Lumen |
k_DefaultShadowResolution | Default shadow resolution |
k_MaxAspectRatio | Maximum aspect ratio for pyramid spot lights |
k_MaxSpotAngle | Maximum value for the spot light angle |
k_MaxViewBiasScale | Maximum shadow map view bias scale |
k_MinAreaWidth | Minimum area light size |
k_MinAspectRatio | Minimum aspect ratio for pyramid spot lights |
k_MinSpotAngle | Minimum value for the spot light angle |
k_MinViewBiasScale | Minimum shadow map view bias scale |
Properties
Name | Description |
---|---|
CustomViewCallbackEvent | Change the View matrix for Spot Light |
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 |
affectDiffuse | Controls whether the light affects the diffuse or not |
affectSpecular | Controls whether the light affects the specular or not |
affectsVolumetric | True if the light affects volumetric fog, false otherwise |
alwaysDrawDynamicShadows | Whether cached shadows will always draw dynamic shadow casters. |
angularDiameter | Angular diameter of the emissive celestial body represented by the light as seen from the camera (in degrees). Used to render the sun/moon disk. |
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. |
areaLightCookie | Get/Set cookie texture for area lights. |
areaLightEmissiveMeshLayer | Change the Layer of the generated emissive mesh for Area Light |
areaLightEmissiveMeshMotionVectorGenerationMode | Change the Motion Vector Generation Mode of the generated emissive mesh for Area Light |
areaLightEmissiveMeshShadowCastingMode | Change the Shadow Casting Mode of the generated emissive mesh for Area Light |
areaLightShadowCone | Get/Set area light shadow cone value. |
areaLightShape | Control the shape of the spot light. |
aspectRatio | Get/Set the aspect ratio of a pyramid light |
barnDoorAngle | Get/Set the angle so that it behaves like a barn door. |
barnDoorLength | Get/Set the length for the barn door sides. |
blockerSampleCount | Controls the number of samples used to detect blockers for PCSS shadows. |
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. |
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. |
color | Color of the light. |
colorShadow | Enable color shadows on the light. |
customSpotLightShadowCone | Get/Set the custom spot shadow cone value. |
displayAreaLightEmissiveMesh | If enabled, display an emissive mesh rect synchronized with the intensity and color of the light. |
distance | Distance from the camera to the emissive celestial body represented by the light. |
enableSpotReflector | Get/Set the Spot Reflection option on spot lights. |
evsmBlurPasses | Controls the number of blur passes used for EVSM shadows. |
evsmExponent | Controls the exponent used for EVSM shadows. |
evsmLightLeakBias | Controls the light leak bias value for EVSM shadows. |
evsmVarianceBias | Controls the variance bias used for EVSM shadows. |
fadeDistance | Get/Set the light fade distance. |
filterSampleCount | Controls the number of samples used to filter for PCSS shadows. |
filterSizeTraced | Control the size of the filter used for ray traced shadows |
filterTracedShadow | Toggle the filtering of ray traced shadows. |
flareFalloff | The falloff rate of flare intensity as the angle from the light increases. |
flareSize | Size the flare around the celestial body (in degrees). |
flareTint | Tints the flare of the celestial body. |
includeForRayTracing | Controls if the light is enabled when the camera has the RayTracing frame setting enabled. |
innerSpotPercent | Get/Set the inner spot radius in percent. |
innerSpotPercent01 | Get the inner spot radius between 0 and 1. |
intensity | Get/Set the intensity of the light using the current light unit. |
interactsWithSky | Controls if the directional light affect the Physically Based sky. This have no effect on other skies. |
kernelSize | Controls the kernel size for IMSM shadows. |
lightAngle | Controls the light angle for IMSM shadows. |
lightDimmer | Get/Set the light dimmer / multiplier, between 0 and 16. |
lightShadowRadius | Angular size of the sun in degree. |
lightUnit | Get/Set the light unit. When changing the light unit, the intensity will be converted to match the previous intensity in the new unit. |
lightlayersMask | Controls which layer will be affected by this light |
lightmapBakeType | [Editor Only] Set the lightmap bake type. |
linkShadowLayers | Controls if we want to synchronize shadow map light layers and light layers or not. |
luxAtDistance | Set/Get the distance for spot lights where the emission intensity is matches the value set in the intensity property. |
maxDepthBias | Controls the max depth bias for IMSM shadows. |
maxSmoothness | Get/Set the maximum smoothness of a punctual or directional light. |
minFilterSize | Controls the minimum filter size of PCSS shadows. |
nonLightmappedOnly | Only used when the shadow masks are enabled, control if the we use ShadowMask or DistanceShadowmask for this light. |
normalBias | Get/Set the normal bias of the shadow maps. |
numRayTracingSamples | Controls the number of sample used for the ray traced shadows. |
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. |
penumbraTint | Controls if we want to ray trace the contact shadow. |
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. |
range | The range of the light. |
rayTraceContactShadow | Controls if we want to ray trace the contact shadow. |
semiTransparentShadow | Enable semi-transparent shadows on the light. |
shadowDimmer | Get/Set the shadow dimmer. |
shadowFadeDistance | Get/Set the shadow fade distance. |
shadowNearPlane | Controls the near plane distance of the shadows. |
shadowResolution | Retrieve the scalable setting for shadow resolution. Use the SetShadowResolution function to set a custom resolution. |
shadowTint | Controls the tint of the shadows. |
shadowUpdateMode | Get/Set the shadow update mode. |
shapeHeight | Control the height of an area, a box spot light or a directional light cookie. |
shapeRadius | Get/Set the radius of a light |
shapeWidth | Control the width of an area, a box spot light or a directional light cookie. |
slopeBias | Get/Set the slope bias of the shadow maps. |
softnessScale | Get/Set the scale factor applied to shape radius or angular diameter for the softness calculation. |
spotIESCutoffPercent | Get/Set the spot ies cutoff. |
spotIESCutoffPercent01 | Get the inner spot radius between 0 and 1. |
spotLightShape | Control the shape of the spot light. |
sunLightConeAngle | Angular size of the sun in degree. |
surfaceTexture | Texture of the surface of the celestial body. Acts like a multiplier. |
surfaceTint | Tints the surface of the celestial body. |
type | The type of light used. This handle some internal conversion in Light component for culling purpose. |
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). |
useContactShadow | Retrieve the scalable setting to use/ignore contact shadows. Toggle the use contact shadow using @override property of the ScalableSetting. |
useCustomSpotLightShadowCone | Toggle the custom spot light shadow cone. |
useRayTracedShadows | Controls if we use ray traced shadows. |
useScreenSpaceShadows | Controls if we resolve the directional light shadows in screen space (ray tracing only). |
volumetricDimmer | Get/Set the light dimmer / multiplier on volumetric effects, between 0 and 16. |
volumetricFadeDistance | Get/Set the light fade distance for volumetrics. |
volumetricShadowDimmer | Get/Set the volumetric shadow dimmer value, between 0 and 1. |
Methods
Name | Description |
---|---|
CopyTo(HDAdditionalLightData) | Copy all field from this to an additional light data |
EnableColorTemperature(bool) | Toggle the usage of color temperature. |
EnableShadows(bool) | Enable shadows on a light. |
GetLightLayers() | Returns a mask of light layers as uint and handle the case of Everything as being 0xFF and not -1 |
GetLightTypeAndShape() | Get the HD condensed light type and its shape. |
GetShadowLayers() | Returns a mask of shadow light layers as uint and handle the case of Everything as being 0xFF and not -1 |
GetSupportedLightUnits() | Get the list of supported light units depending on the current light type. |
GetSupportedLightUnits(HDLightType, SpotLightShape) | Give the supported lights unit for the given parameters |
InitDefaultHDAdditionalLightData(HDAdditionalLightData) | Initialize an HDAdditionalLightData that have just beeing created. |
IsValidLightUnitForType(HDLightType, SpotLightShape, LightUnit) | Check if the given type is supported by this type and shape. |
RequestShadowMapRendering() | Request shadow map rendering when Update Mode is set to On Demand. |
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). |
SetAreaLightSize(Vector2) | Set the area light size. |
SetBoxSpotSize(Vector2) | Set the box spot light size. |
SetColor(Color, float) | Set the color of the light. |
SetCookie(Texture) | Set light cookie. |
SetCookie(Texture, Vector2) | Set light cookie. Note that the texture must have a power of two size. |
SetCullingMask(int) | Set the light culling mask. |
SetDirectionalShadowTint(Color) | Set the Shadow tint for the directional light. |
SetIntensity(float) | Set the intensity of the light using the current unit. |
SetIntensity(float, LightUnit) | Set the intensity of the light using unit in parameter. |
SetLayerShadowCullDistances(float[]) | Set the light layer shadow cull distances. |
SetLightDimmer(float, float) | Set the dimmer for light and volumetric light. |
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. |
SetLightTypeAndShape(HDLightTypeAndShape) | Set the type of the light and its shape. Note: this will also change the unit of the light if the current one is not supported by the new light type. |
SetLightUnit(LightUnit) | Set the light unit. |
SetPCSSParams(int, int, float, float) | Set parameters for PCSS shadows. |
SetRange(float) | Set the range of the light. |
SetShadowDimmer(float, float) | Set the shadow dimmer. |
SetShadowFadeDistance(float) | Shadow fade distance in meter. |
SetShadowLightLayer(RenderingLayerMask) | Set the shadow map light layer masks. The feature must be enabled in the HDRP asset in norder to work. |
SetShadowNearPlane(float) | Set the near plane of the shadow. |
SetShadowResolution(int) | Set the shadow resolution. |
SetShadowResolutionLevel(int) | Set the shadow resolution quality level. |
SetShadowResolutionOverride(bool) | Set whether the shadow resolution use the override value. |
SetShadowUpdateMode(ShadowUpdateMode) | Set the shadow update mode. |
SetSpotAngle(float, float) | Set the spot light angle and inner spot percent. We don't use Light.innerSpotAngle. |
SetSpotLightLuxAt(float, float) | For Spot Lights only, set the intensity that the spot should emit at a certain distance in meter |
UpdateAllLightValues() | Synchronize all the HD Additional Light values with the Light component. |