浏览代码

WIP fix depth copy to scene view camera

/main
Aleksandr Kirillov 6 年前
当前提交
7e7e8ed5
共有 1 个文件被更改,包括 14 次插入9 次删除
  1. 23
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs

23
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


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)

正在加载...
取消
保存