|
|
|
|
|
|
CameraRenderTargetID.depth = Shader.PropertyToID("_CameraDepthTexture"); |
|
|
|
CameraRenderTargetID.depthCopy = Shader.PropertyToID("_CameraCopyDepthTexture"); |
|
|
|
|
|
|
|
m_ShadowMapRT = new RenderTargetIdentifier(m_ShadowMapRTID); |
|
|
|
m_ScreenSpaceShadowMapRT = new RenderTargetIdentifier(m_ScreenSpaceShadowMapRTID); |
|
|
|
|
|
|
|
m_ColorRT = new RenderTargetIdentifier(CameraRenderTargetID.color); |
|
|
|
|
|
|
{ |
|
|
|
cmd.SetViewport(new Rect(m_ShadowSlices[cascadeIndex].atlasX, m_ShadowSlices[cascadeIndex].atlasY, |
|
|
|
m_ShadowSlices[cascadeIndex].shadowResolution, m_ShadowSlices[cascadeIndex].shadowResolution)); |
|
|
|
cmd.EnableScissorRect(new Rect(m_ShadowSlices[cascadeIndex].atlasX + 4, m_ShadowSlices[cascadeIndex].atlasY + 4, |
|
|
|
m_ShadowSlices[cascadeIndex].shadowResolution - 8, m_ShadowSlices[cascadeIndex].shadowResolution - 8)); |
|
|
|
|
|
|
|
cmd.Clear(); |
|
|
|
cmd.DisableScissorRect(); |
|
|
|
context.ExecuteCommandBuffer(cmd); |
|
|
|
cmd.Clear(); |
|
|
|
} |
|
|
|
|
|
|
|