Class HDCachedShadowManager
The class responsible to handle cached shadow maps (shadows with Update mode set to OnEnable or OnDemand).
Inherited Members
Namespace: UnityEngine.Rendering.HighDefinition
Assembly: Unity.RenderPipelines.HighDefinition.Runtime.dll
Syntax
public class HDCachedShadowManager
Properties
Name | Description |
---|---|
instance | Get the cached shadow manager to control cached shadow maps. |
Methods
Name | Description |
---|---|
DefragAtlas(HDLightType) | If a light is added after a scene is loaded, its placement in the atlas might be not optimal and the suboptimal placement might prevent a light to find a place in the atlas. This function will force a defragmentation of the atlas containing lights of type lightType and redistributes the shadows inside so that the placement is optimal. Note however that this will also mark the shadow maps as dirty and they will be re-rendered as soon the light will come into view for the first time after this function call. |
ForceEvictLight(HDAdditionalLightData) | This function can be used to evict a light from its atlas. The slots occupied by such light will be available to be occupied by other shadows. Note that eviction happens automatically upon light destruction and, if lightData.preserveCachedShadow is false, upon disabling of the light. |
ForceRegisterLight(HDAdditionalLightData) | This function can be used to register a light to the cached shadow system if not already registered. It is necessary to call this function if a light has been evicted with ForceEvictLight and it needs to be registered again. Please note that a light is automatically registered when enabled or when the shadow update changes from EveryFrame to OnDemand or OnEnable. |
LightHasBeenPlaceAndRenderedAtLeastOnce(HDAdditionalLightData, int) | This function verifies if the light has its shadow maps placed in the cached shadow atlas and if it was rendered at least once. |
LightHasBeenPlacedInAtlas(HDAdditionalLightData) | This function verifies if the light has its shadow maps placed in the cached shadow atlas. |
ShadowHasBeenPlaceAndRenderedAtLeastOnce(HDAdditionalLightData, int) | This function verifies if the light if a specific sub-shadow maps is placed in the cached shadow atlas and if it was rendered at least once. |
WouldFitInAtlas(int, HDLightType) | This function verifies if a shadow map of resolution shadowResolution for a light of type lightType would fit in the atlas when inserted. |
WouldFitInAtlas(HDAdditionalLightData) | This function verifies if the shadow map for the passed light would fit in the atlas when inserted. |