|
|
|
|
|
|
static ComputeBuffer s_ShadowDataBuffer; |
|
|
|
static ComputeBuffer s_ShadowPayloadBuffer; |
|
|
|
|
|
|
|
public ShadowSetup(ShadowSettings shadowSettings, out IShadowManager shadowManager) |
|
|
|
public ShadowSetup(ShadowInitParameters shadowInit, ShadowSettings shadowSettings, out IShadowManager shadowManager) |
|
|
|
atlasInit.baseInit.width = (uint)shadowSettings.shadowAtlasWidth; |
|
|
|
atlasInit.baseInit.height = (uint)shadowSettings.shadowAtlasHeight; |
|
|
|
atlasInit.baseInit.width = (uint)shadowInit.shadowAtlasWidth; |
|
|
|
atlasInit.baseInit.height = (uint)shadowInit.shadowAtlasHeight; |
|
|
|
atlasInit.baseInit.slices = 1; |
|
|
|
atlasInit.baseInit.shadowmapBits = 32; |
|
|
|
atlasInit.baseInit.shadowmapFormat = RenderTextureFormat.Shadowmap; |
|
|
|
|
|
|
atlasInit.baseInit.maxPayloadCount = 0; |
|
|
|
atlasInit.baseInit.shadowSupport = ShadowmapBase.ShadowSupport.Directional | ShadowmapBase.ShadowSupport.Point | ShadowmapBase.ShadowSupport.Spot; |
|
|
|
atlasInit.shaderKeyword = null; |
|
|
|
atlasInit.cascadeCount = shadowSettings.directionalLightCascadeCount; |
|
|
|
atlasInit.cascadeRatios = shadowSettings.directionalLightCascades; |
|
|
|
|
|
|
|
m_Shadowmaps = new ShadowmapBase[] { new ShadowAtlas(ref atlasInit) }; |
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
ShadowSettings m_ShadowSettings = ShadowSettings.Default; |
|
|
|
ShadowSettings m_ShadowSettings = new ShadowSettings(); |
|
|
|
ShadowSetup m_ShadowSetup; |
|
|
|
IShadowManager m_ShadowMgr; |
|
|
|
FrameId m_FrameId = new FrameId(); |
|
|
|
|
|
|
|
|
|
|
void InitShadowSystem(ShadowSettings shadowSettings) |
|
|
|
{ |
|
|
|
m_ShadowSetup = new ShadowSetup(shadowSettings, out m_ShadowMgr); |
|
|
|
m_ShadowSetup = new ShadowSetup(new ShadowInitParameters(), shadowSettings, out m_ShadowMgr); |
|
|
|
} |
|
|
|
|
|
|
|
void DeinitShadowSystem() |
|
|
|
|
|
|
private Matrix4x4[] m_WorldToLightMatrix = new Matrix4x4[k_MaxLights]; |
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
TextureSettings m_TextureSettings = TextureSettings.Default; |
|
|
|
TextureSettings m_TextureSettings = new TextureSettings(); |
|
|
|
public bool UseLegacyCookies; |
|
|
|
public bool TransparencyShadows; |
|
|
|
public Mesh m_PointLightMesh; |
|
|
|
|
|
|
{ |
|
|
|
foreach (var camera in cameras) { |
|
|
|
// Culling
|
|
|
|
CullingParameters cullingParams; |
|
|
|
ScriptableCullingParameters cullingParams; |
|
|
|
if (!CullResults.GetCullingParameters (camera, out cullingParams)) |
|
|
|
continue; |
|
|
|
|
|
|
|