|
|
|
|
|
|
private void CopyDepthBufferIfNeeded(ScriptableRenderContext renderContext) |
|
|
|
{ |
|
|
|
var cmd = new CommandBuffer() { name = NeedDepthBufferCopy() ? "Copy DepthBuffer" : "Set DepthBuffer"}; |
|
|
|
|
|
|
|
|
|
|
|
if (NeedDepthBufferCopy()) |
|
|
|
{ |
|
|
|
using (new Utilities.ProfilingSample("Copy depth-stencil buffer", renderContext)) |
|
|
|
|
|
|
// select the most main camera!
|
|
|
|
|
|
|
|
Camera camera = cameras.OrderByDescending(x => x.tag == "MainCamera").FirstOrDefault(); |
|
|
|
if (camera == null) |
|
|
|
return; |
|
|
|
if (camera == null) |
|
|
|
{ |
|
|
|
renderContext.Submit(); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!CullResults.GetCullingParameters(camera, out cullingParams)) |
|
|
|
return; |
|
|
|
if (!CullResults.GetCullingParameters(camera, out cullingParams)) |
|
|
|
{ |
|
|
|
renderContext.Submit(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
m_ShadowPass.UpdateCullingParameters(ref cullingParams); |
|
|
|
|
|
|
|