using System;
using System.Collections.Generic;
using Unity.Collections;
namespace UnityEngine.Rendering.Universal
{
///
/// Container class for various data used for shadows in URP.
///
public class UniversalShadowData : ContextItem
{
///
/// True if main light shadows are enabled.
///
public bool supportsMainLightShadows;
///
/// True if additional lights shadows are enabled in the URP Asset
///
internal bool mainLightShadowsEnabled;
///
/// The width of the main light shadow map.
///
public int mainLightShadowmapWidth;
///
/// The height of the main light shadow map.
///
public int mainLightShadowmapHeight;
///
/// The number of shadow cascades.
///
public int mainLightShadowCascadesCount;
///
/// The split between cascades.
///
public Vector3 mainLightShadowCascadesSplit;
///
/// Main light last cascade shadow fade border.
/// Value represents the width of shadow fade that ranges from 0 to 1.
/// Where value 0 is used for no shadow fade.
///
public float mainLightShadowCascadeBorder;
///
/// True if additional lights shadows are enabled.
///
public bool supportsAdditionalLightShadows;
///
/// True if additional lights shadows are enabled in the URP Asset
///
internal bool additionalLightShadowsEnabled;
///
/// The width of the additional light shadow map.
///
public int additionalLightsShadowmapWidth;
///
/// The height of the additional light shadow map.
///
public int additionalLightsShadowmapHeight;
///
/// True if soft shadows are enabled.
///
public bool supportsSoftShadows;
///
/// The number of bits used.
///
public int shadowmapDepthBufferBits;
///
/// A list of shadow bias.
///
public List bias;
///
/// A list of resolution for the shadow maps.
///
public List resolution;
internal bool isKeywordAdditionalLightShadowsEnabled;
internal bool isKeywordSoftShadowsEnabled;
internal int mainLightShadowResolution;
internal int mainLightRenderTargetWidth;
internal int mainLightRenderTargetHeight;
internal NativeArray visibleLightsShadowCullingInfos;
internal AdditionalLightsShadowAtlasLayout shadowAtlasLayout;
///
public override void Reset()
{
supportsMainLightShadows = false;
mainLightShadowmapWidth = 0;
mainLightShadowmapHeight = 0;
mainLightShadowCascadesCount = 0;
mainLightShadowCascadesSplit = Vector3.zero;
mainLightShadowCascadeBorder = 0.0f;
supportsAdditionalLightShadows = false;
additionalLightsShadowmapWidth = 0;
additionalLightsShadowmapHeight = 0;
supportsSoftShadows = false;
shadowmapDepthBufferBits = 0;
bias?.Clear();
resolution?.Clear();
isKeywordAdditionalLightShadowsEnabled = false;
isKeywordSoftShadowsEnabled = false;
mainLightShadowResolution = 0;
mainLightRenderTargetWidth = 0;
mainLightRenderTargetHeight = 0;
visibleLightsShadowCullingInfos = default;
shadowAtlasLayout = default;
}
}
}