Class HDAdditionalLightData
HDRP Additional light data component. It contains the light API and fields used by HDRP.
Namespace: UnityEngine.Rendering.HighDefinition
Syntax
public class HDAdditionalLightData : MonoBehaviour, ISerializationCallbackReceiver, IVersionable<HDAdditionalLightData.Version>
Fields
k_DefaultAreaLightIntensity
The default intensity value for area lights in Lumen
Declaration
public const float k_DefaultAreaLightIntensity = null
Field Value
| Type | Description |
|---|---|
| Single |
k_DefaultDirectionalLightIntensity
The default intensity value for directional lights in Lux
Declaration
public const float k_DefaultDirectionalLightIntensity = null
Field Value
| Type | Description |
|---|---|
| Single |
k_DefaultPunctualLightIntensity
The default intensity value for punctual lights in Lumen
Declaration
public const float k_DefaultPunctualLightIntensity = null
Field Value
| Type | Description |
|---|---|
| Single |
k_DefaultShadowResolution
Default shadow resolution
Declaration
public const int k_DefaultShadowResolution = null
Field Value
| Type | Description |
|---|---|
| Int32 |
k_MaxAspectRatio
Maximum aspect ratio for pyramid spot lights
Declaration
public const float k_MaxAspectRatio = null
Field Value
| Type | Description |
|---|---|
| Single |
k_MaxSpotAngle
Maximum value for the spot light angle
Declaration
public const float k_MaxSpotAngle = null
Field Value
| Type | Description |
|---|---|
| Single |
k_MaxViewBiasScale
Maximum shadow map view bias scale
Declaration
public const float k_MaxViewBiasScale = null
Field Value
| Type | Description |
|---|---|
| Single |
k_MinAreaWidth
Minimum area light size
Declaration
public const float k_MinAreaWidth = null
Field Value
| Type | Description |
|---|---|
| Single |
k_MinAspectRatio
Minimum aspect ratio for pyramid spot lights
Declaration
public const float k_MinAspectRatio = null
Field Value
| Type | Description |
|---|---|
| Single |
k_MinSpotAngle
Minimum value for the spot light angle
Declaration
public const float k_MinSpotAngle = null
Field Value
| Type | Description |
|---|---|
| Single |
k_MinViewBiasScale
Minimum shadow map view bias scale
Declaration
public const float k_MinViewBiasScale = null
Field Value
| Type | Description |
|---|---|
| Single |
Properties
affectDiffuse
Controls whether the light affects the diffuse or not
Declaration
public bool affectDiffuse { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
affectSpecular
Controls whether the light affects the specular or not
Declaration
public bool affectSpecular { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
affectsVolumetric
True if the light affects volumetric fog, false otherwise
Declaration
public bool affectsVolumetric { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
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 |
|---|---|
| Single |
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 |
|---|---|
| Boolean |
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 |
|---|---|
| Int32 |
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 |
|---|---|
| Single |
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 |
|---|---|
| Single |
barnDoorAngle
Get/Set the angle so that it behaves like a barn door.
Declaration
public float barnDoorAngle { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
barnDoorLength
Get/Set the length for the barn door sides.
Declaration
public float barnDoorLength { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
blockerSampleCount
Controls the number of samples used to detect blockers for PCSS shadows.
Declaration
public int blockerSampleCount { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
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 |
|---|---|
| Boolean |
customSpotLightShadowCone
Get/Set the custom spot shadow cone value.
Declaration
public float customSpotLightShadowCone { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
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 |
|---|---|
| Boolean |
distance
Distance from the camera to the emissive celestial body represented by the light.
Declaration
public float distance { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
enableSpotReflector
Get/Set the Spot Reflection option on spot lights.
Declaration
public bool enableSpotReflector { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
evsmBlurPasses
Controls the number of blur passes used for EVSM shadows.
Declaration
public int evsmBlurPasses { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
evsmExponent
Controls the exponent used for EVSM shadows.
Declaration
public float evsmExponent { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
evsmLightLeakBias
Controls the light leak bias value for EVSM shadows.
Declaration
public float evsmLightLeakBias { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
evsmVarianceBias
Controls the variance bias used for EVSM shadows.
Declaration
public float evsmVarianceBias { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
fadeDistance
Get/Set the light fade distance.
Declaration
public float fadeDistance { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
filterSampleCount
Controls the number of samples used to filter for PCSS shadows.
Declaration
public int filterSampleCount { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
filterSizeTraced
Control the size of the filter used for ray traced shadows
Declaration
public int filterSizeTraced { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
filterTracedShadow
Toggle the filtering of ray traced shadows.
Declaration
public bool filterTracedShadow { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
flareFalloff
The falloff rate of flare intensity as the angle from the light increases.
Declaration
public float flareFalloff { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
flareSize
Size the flare around the celestial body (in degrees).
Declaration
public float flareSize { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
flareTint
Tints the flare of the celestial body.
Declaration
public Color flareTint { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
innerSpotPercent
Get/Set the inner spot radius in percent.
Declaration
public float innerSpotPercent { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
innerSpotPercent01
Get the inner spot radius between 0 and 1.
Declaration
public float innerSpotPercent01 { get; }
Property Value
| Type | Description |
|---|---|
| Single |
intensity
Get/Set the intensity of the light using the current light unit.
Declaration
public float intensity { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
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 |
|---|---|
| Boolean |
kernelSize
Controls the kernel size for IMSM shadows.
Declaration
public int kernelSize { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
lightAngle
Controls the light angle for IMSM shadows.
Declaration
public float lightAngle { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
lightDimmer
Get/Set the light dimmer / multiplier, between 0 and 16.
Declaration
public float lightDimmer { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
lightlayersMask
Controls which layer will be affected by this light
Declaration
public LightLayerEnum lightlayersMask { get; set; }
Property Value
| Type | Description |
|---|---|
| LightLayerEnum |
lightShadowRadius
Angular size of the sun in degree.
Declaration
public float lightShadowRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
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 |
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 |
|---|---|
| Boolean |
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 |
|---|---|
| Single |
maxDepthBias
Controls the max depth bias for IMSM shadows.
Declaration
public float maxDepthBias { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
maxSmoothness
Get/Set the maximum smoothness of a punctual or directional light.
Declaration
public float maxSmoothness { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
minFilterSize
Controls the minimum filter size of PCSS shadows.
Declaration
public float minFilterSize { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
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 |
|---|---|
| Boolean |
normalBias
Get/Set the normal bias of the shadow maps.
Declaration
public float normalBias { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
numRayTracingSamples
Controls the number of sample used for the ray traced shadows.
Declaration
public int numRayTracingSamples { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
penumbraTint
Controls if we want to ray trace the contact shadow.
Declaration
public bool penumbraTint { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
range
The range of the light.
Declaration
public float range { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
rayTraceContactShadow
Controls if we want to ray trace the contact shadow.
Declaration
public bool rayTraceContactShadow { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
semiTransparentShadow
Enable semi-transparent shadows on the light.
Declaration
public bool semiTransparentShadow { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
shadowDimmer
Get/Set the shadow dimmer.
Declaration
public float shadowDimmer { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
shadowFadeDistance
Get/Set the shadow fade distance.
Declaration
public float shadowFadeDistance { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
shadowNearPlane
Controls the near plane distance of the shadows.
Declaration
public float shadowNearPlane { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
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 |
|---|---|
| Single |
shapeRadius
Get/Set the radius of a light
Declaration
public float shapeRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
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 |
|---|---|
| Single |
slopeBias
Get/Set the slope bias of the shadow maps.
Declaration
public float slopeBias { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
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 |
|---|---|
| Single |
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 |
|---|---|
| Single |
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 |
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 |
|---|---|
| Boolean |
useRayTracedShadows
Controls if we use ray traced shadows.
Declaration
public bool useRayTracedShadows { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
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 |
|---|---|
| Boolean |
volumetricDimmer
Get/Set the light dimmer / multiplier on volumetric effects, between 0 and 16.
Declaration
public float volumetricDimmer { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
volumetricShadowDimmer
Get/Set the volumetric shadow dimmer value, between 0 and 1.
Declaration
public float volumetricShadowDimmer { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
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(Boolean)
Toggle the usage of color temperature.
Declaration
public void EnableColorTemperature(bool enable)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | enable |
EnableShadows(Boolean)
Enable shadows on a light.
Declaration
public void EnableShadows(bool enabled)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | 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 |
|---|---|
| UInt32 |
GetLightTypeAndShape()
Get the HD condensed light type and its shape.
Declaration
public HDLightTypeAndShape GetLightTypeAndShape()
Returns
| Type | Description |
|---|---|
| HDLightTypeAndShape |
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 |
|---|---|
| Boolean | True: this unit is supported |
RequestShadowMapRendering()
Request shadow map rendering when Update Mode is set to On Demand.
Declaration
public void RequestShadowMapRendering()
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, Single)
Set the color of the light.
Declaration
public void SetColor(Color color, float colorTemperature = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | color | Color |
| Single | 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(Int32)
Set the light culling mask.
Declaration
public void SetCullingMask(int cullingMask)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | cullingMask |
SetDirectionalShadowTint(Color)
Set the Shadow tint for the directional light.
Declaration
public void SetDirectionalShadowTint(Color tint)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | tint |
SetIntensity(Single)
Set the intensity of the light using the current unit.
Declaration
public void SetIntensity(float intensity)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | intensity |
SetIntensity(Single, LightUnit)
Set the intensity of the light using unit in parameter.
Declaration
public void SetIntensity(float intensity, LightUnit unit)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | intensity | |
| LightUnit | unit | Unit must be a valid Light Unit for the current light type |
SetLayerShadowCullDistances(Single[])
Set the light layer shadow cull distances.
Declaration
public float[] SetLayerShadowCullDistances(float[] layerShadowCullDistances)
Parameters
| Type | Name | Description |
|---|---|---|
| Single[] | layerShadowCullDistances |
Returns
| Type | Description |
|---|---|
| Single[] |
SetLightDimmer(Single, Single)
Set the dimmer for light and volumetric light.
Declaration
public void SetLightDimmer(float dimmer = null, float volumetricDimmer = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | dimmer | Dimmer for the light |
| Single | 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(Int32, Int32, Single, Single)
Set parameters for PCSS shadows.
Declaration
public void SetPCSSParams(int blockerSampleCount = 16, int filterSampleCount = 24, float minFilterSize = 0.01F, float radiusScaleForSoftness = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | blockerSampleCount | Number of samples used to detect blockers |
| Int32 | filterSampleCount | Number of samples used to filter the shadow map |
| Single | minFilterSize | Minimum filter intensity |
| Single | radiusScaleForSoftness | Scale applied to shape radius or angular diameter in the softness calculations. |
SetRange(Single)
Set the range of the light.
Declaration
public void SetRange(float range)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | range |
SetShadowDimmer(Single, Single)
Set the shadow dimmer.
Declaration
public void SetShadowDimmer(float shadowDimmer = null, float volumetricShadowDimmer = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | shadowDimmer | Dimmer between 0 and 1 |
| Single | volumetricShadowDimmer | Dimmer between 0 and 1 for volumetrics |
SetShadowFadeDistance(Single)
Shadow fade distance in meter.
Declaration
public void SetShadowFadeDistance(float distance)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | 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(Single)
Set the near plane of the shadow.
Declaration
public void SetShadowNearPlane(float nearPlaneDistance)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | nearPlaneDistance |
SetShadowResolution(Int32)
Set the shadow resolution.
Declaration
public void SetShadowResolution(int resolution)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | resolution | Must be between 16 and 16384 |
SetShadowResolutionLevel(Int32)
Set the shadow resolution quality level.
Declaration
public void SetShadowResolutionLevel(int level)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | level | The quality level to use |
SetShadowResolutionOverride(Boolean)
Set whether the shadow resolution use the override value.
Declaration
public void SetShadowResolutionOverride(bool useOverride)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | 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(Single, Single)
Set the spot light angle and inner spot percent. We don't use Light.innerSpotAngle.
Declaration
public void SetSpotAngle(float angle, float innerSpotPercent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | angle | inner spot angle in degree |
| Single | innerSpotPercent | inner spot angle in percent |
SetSpotLightLuxAt(Single, Single)
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 |
|---|---|---|
| Single | luxIntensity | |
| Single | distance |
UpdateAllLightValues()
Synchronize all the HD Additional Light values with the Light component.
Declaration
public void UpdateAllLightValues()
Explicit Interface Implementations
IVersionable<HDAdditionalLightData.Version>.version
Declaration
HDAdditionalLightData.Version IVersionable<HDAdditionalLightData.Version>.version { get; set; }
Returns
| Type | Description |
|---|---|
| UnityEngine.Rendering.HighDefinition.HDAdditionalLightData.Version |