|
|
|
|
|
|
if (!CullResults.GetCullingParameters(m_CurrCamera, stereoEnabled, out cullingParameters)) |
|
|
|
continue; |
|
|
|
|
|
|
|
var cmd = CommandBufferPool.Get(""); |
|
|
|
cullingParameters.shadowDistance = Mathf.Min(m_ShadowPass.RenderingDistance, m_CurrCamera.farClipPlane); |
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
|
|
|
|
|
|
ForwardPass(frameRenderingConfiguration, ref lightData, ref context); |
|
|
|
|
|
|
|
cmd.name = "After Camera Render"; |
|
|
|
CommandBuffer cmd; |
|
|
|
{ |
|
|
|
cmd = CommandBufferPool.Get("Copy Depth to Camera"); |
|
|
|
cmd.DisableShaderKeyword(kMSAADepthKeyword); |
|
|
|
context.ExecuteCommandBuffer(cmd); |
|
|
|
CommandBufferPool.Release(cmd); |
|
|
|
} |
|
|
|
context.Submit(); |
|
|
|
cmd = CommandBufferPool.Get("Dispose of Temporaries"); |
|
|
|
cmd.ReleaseTemporaryRT(CameraRenderTargetID.depthCopy); |
|
|
|
cmd.ReleaseTemporaryRT(CameraRenderTargetID.depth); |
|
|
|
cmd.ReleaseTemporaryRT(CameraRenderTargetID.color); |
|
|
|
|
|
|
m_ShadowPass.Dispose(cmd); |
|
|
|
|
|
|
|
|
|
|
|
m_ShadowPass.Dispose(cmd); |
|
|
|
|
|
|
|
context.Submit(); |
|
|
|
} |
|
|
|
|
|
|
bool forceBlit = false; |
|
|
|
if (m_MSAASamples > 1) |
|
|
|
{ |
|
|
|
m_CopyDepthMaterial.SetFloat(m_SampleCount, (float)m_MSAASamples); |
|
|
|
m_CopyDepthMaterial.EnableKeyword(kMSAADepthKeyword); |
|
|
|
cmd.SetGlobalFloat(m_SampleCount, (float)m_MSAASamples); |
|
|
|
cmd.EnableShaderKeyword(kMSAADepthKeyword); |
|
|
|
m_CopyDepthMaterial.DisableKeyword(kMSAADepthKeyword); |
|
|
|
cmd.DisableShaderKeyword(kMSAADepthKeyword); |
|
|
|
cmd.SetGlobalTexture(CameraRenderTargetID.depth, m_CopyDepth); |
|
|
|
cmd.SetGlobalTexture(CameraRenderTargetID.depthCopy, m_CopyDepth); |
|
|
|
} |
|
|
|
|
|
|
|
if (setRenderTarget) |
|
|
|