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, IVersionable<HDAdditionalLightData.Version>, ISerializationCallbackReceiver, IAdditionalData
Fields
CustomViewCallbackEvent
Change the View matrix for Spot Light
Declaration
public HDAdditionalLightData.CustomViewCallback CustomViewCallbackEvent
Field Value
Type | Description |
---|---|
HDAdditionalLightData.CustomViewCallback |
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 |
Properties
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 emissive 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
Control the shape of the spot light.
Declaration
public AreaLightShape areaLightShape { get; set; }
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 |
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
Get/Set the Spot Reflection option on spot lights.
Declaration
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 |
flareFalloff
The falloff rate of flare intensity as the angle from the light increases.
Declaration
public float flareFalloff { get; set; }
Property Value
Type | Description |
---|---|
float |
flareSize
Size the flare around the celestial body (in degrees).
Declaration
public float flareSize { get; set; }
Property Value
Type | Description |
---|---|
float |
flareTint
Tints the flare of the celestial body.
Declaration
public Color flareTint { get; set; }
Property Value
Type | Description |
---|---|
Color |
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
Get/Set the intensity of the light using the current light unit.
Declaration
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
Get/Set the light unit. When changing the light unit, the intensity will be converted to match the previous intensity in the new unit.
Declaration
public LightUnit lightUnit { get; set; }
Property Value
Type | Description |
---|---|
LightUnit |
lightlayersMask
Controls which layer will be affected by this light
Declaration
public LightLayerEnum lightlayersMask { get; set; }
Property Value
Type | Description |
---|---|
LightLayerEnum |
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
Set/Get the distance for spot lights where the emission intensity is matches the value set in the intensity property.
Declaration
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
Control the shape of the spot light.
Declaration
public SpotLightShape spotLightShape { get; set; }
Property Value
Type | Description |
---|---|
SpotLightShape |
sunLightConeAngle
Angular size of the sun in degree.
Declaration
public float sunLightConeAngle { get; set; }
Property Value
Type | Description |
---|---|
float |
surfaceTexture
2D (disk) texture of the surface of the celestial body. Acts like a multiplier.
Declaration
public Texture2D surfaceTexture { get; set; }
Property Value
Type | Description |
---|---|
Texture2D |
surfaceTint
Tints the surface of the celestial body.
Declaration
public Color surfaceTint { get; set; }
Property Value
Type | Description |
---|---|
Color |
type
The type of light used. This handle some internal conversion in Light component for culling purpose.
Declaration
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()
Get the HD condensed light type and its shape.
Declaration
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()
Get the list of supported light units depending on the current light type.
Declaration
public LightUnit[] GetSupportedLightUnits()
Returns
Type | Description |
---|---|
LightUnit[] |
GetSupportedLightUnits(HDLightType, SpotLightShape)
Give the supported lights unit for the given parameters
Declaration
public static LightUnit[] GetSupportedLightUnits(HDLightType type, SpotLightShape spotLightShape)
Parameters
Type | Name | Description |
---|---|---|
HDLightType | type | The type of the light |
SpotLightShape | spotLightShape | the shape of the spot.You can put anything in case it is not a spot light. |
Returns
Type | Description |
---|---|
LightUnit[] | Array of supported units |
InitDefaultHDAdditionalLightData(HDAdditionalLightData)
Initialize an HDAdditionalLightData that have just beeing created.
Declaration
public static void InitDefaultHDAdditionalLightData(HDAdditionalLightData lightData)
Parameters
Type | Name | Description |
---|---|---|
HDAdditionalLightData | lightData |
IsValidLightUnitForType(HDLightType, SpotLightShape, LightUnit)
Check if the given type is supported by this type and shape.
Declaration
public static bool IsValidLightUnitForType(HDLightType type, SpotLightShape spotLightShape, LightUnit unit)
Parameters
Type | Name | Description |
---|---|---|
HDLightType | type | The type of the light |
SpotLightShape | spotLightShape | the shape of the spot.You can put anything in case it is not a spot light. |
LightUnit | unit | The unit to check |
Returns
Type | Description |
---|---|
bool | True: this unit is supported |
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)
Set the intensity of the light using the current unit.
Declaration
public void SetIntensity(float intensity)
Parameters
Type | Name | Description |
---|---|---|
float | intensity |
SetIntensity(float, LightUnit)
Set the intensity of the light using unit in parameter.
Declaration
public void SetIntensity(float intensity, LightUnit unit)
Parameters
Type | Name | Description |
---|---|---|
float | 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(LightLayerEnum, LightLayerEnum)
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(LightLayerEnum lightLayerMask, LightLayerEnum shadowLayerMask)
Parameters
Type | Name | Description |
---|---|---|
LightLayerEnum | lightLayerMask | Layer mask for receiving light |
LightLayerEnum | shadowLayerMask | Layer mask for shadow rendering |
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.
Declaration
public void SetLightTypeAndShape(HDLightTypeAndShape typeAndShape)
Parameters
Type | Name | Description |
---|---|---|
HDLightTypeAndShape | typeAndShape |
SetLightUnit(LightUnit)
Set the light unit.
Declaration
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(LightLayerEnum)
Set the shadow map light layer masks. The feature must be enabled in the HDRP asset in norder to work.
Declaration
public void SetShadowLightLayer(LightLayerEnum shadowLayerMask)
Parameters
Type | Name | Description |
---|---|---|
LightLayerEnum | 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 |
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)
For Spot Lights only, set the intensity that the spot should emit at a certain distance in meter
Declaration
public void SetSpotLightLuxAt(float luxIntensity, float distance)
Parameters
Type | Name | Description |
---|---|---|
float | luxIntensity | |
float | distance |
UpdateAllLightValues()
Synchronize all the HD Additional Light values with the Light component.
Declaration
public void UpdateAllLightValues()