|
|
|
|
|
|
atlasInit.baseInit.width = (uint)shadowInit.shadowAtlasWidth; |
|
|
|
atlasInit.baseInit.height = (uint)shadowInit.shadowAtlasHeight; |
|
|
|
atlasInit.baseInit.slices = 1; |
|
|
|
atlasInit.baseInit.shadowmapBits = 32; |
|
|
|
atlasInit.baseInit.shadowmapBits = shadowInit.shadowMap16Bit ? 16u : 32u; |
|
|
|
atlasInit.baseInit.shadowmapFormat = RenderTextureFormat.Shadowmap; |
|
|
|
atlasInit.baseInit.samplerState = SamplerState.Default(); |
|
|
|
atlasInit.baseInit.comparisonSamplerState = ComparisonSamplerState.Default(); |
|
|
|
|
|
|
m_ShadowMgr = new ShadowManager(shadowSettings, ref scInit, ref budgets, m_Shadowmaps); |
|
|
|
// set global overrides - these need to match the override specified in LightLoop/Shadow.hlsl
|
|
|
|
bool useGlobalOverrides = true; |
|
|
|
m_ShadowMgr.SetGlobalShadowOverride(GPUShadowType.Point , ShadowAlgorithm.PCF, ShadowVariant.V2, ShadowPrecision.High, useGlobalOverrides); |
|
|
|
m_ShadowMgr.SetGlobalShadowOverride(GPUShadowType.Spot , ShadowAlgorithm.PCF, ShadowVariant.V2, ShadowPrecision.High, useGlobalOverrides); |
|
|
|
m_ShadowMgr.SetGlobalShadowOverride(GPUShadowType.Directional , ShadowAlgorithm.PCF, ShadowVariant.V3, ShadowPrecision.High, useGlobalOverrides); |
|
|
|
m_ShadowMgr.SetGlobalShadowOverride(GPUShadowType.Point , ShadowAlgorithm.PCF, ShadowVariant.V2, shadowInit.shadowMap16Bit ? ShadowPrecision.Low : ShadowPrecision.High, useGlobalOverrides); |
|
|
|
m_ShadowMgr.SetGlobalShadowOverride(GPUShadowType.Spot , ShadowAlgorithm.PCF, ShadowVariant.V2, shadowInit.shadowMap16Bit ? ShadowPrecision.Low : ShadowPrecision.High, useGlobalOverrides); |
|
|
|
m_ShadowMgr.SetGlobalShadowOverride(GPUShadowType.Directional , ShadowAlgorithm.PCF, ShadowVariant.V3, shadowInit.shadowMap16Bit ? ShadowPrecision.Low : ShadowPrecision.High, useGlobalOverrides); |
|
|
|
|
|
|
|
m_ShadowMgr.SetShadowLightTypeDelegate(HDShadowLightType); |
|
|
|
|
|
|
|