浏览代码

Fixed an issue where sometimes the deferred shadow texture would not be valid, causing wrong rendering.

/hdrp-staging
Julien Ignace 6 年前
当前提交
29a7899c
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 7
      com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs

7
com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs


m_DecalNormalBufferMaterial.SetInt(HDShaderIDs._DecalNormalBufferStencilReadMask, stencilMask);
m_DecalNormalBufferMaterial.SetInt(HDShaderIDs._DecalNormalBufferStencilRef, stencilRef);
HDUtils.SetRenderTarget(cmd, hdCamera, m_CameraDepthStencilBuffer);
cmd.SetRandomWriteTarget(1, m_NormalBufferManager.GetNormalBuffer(0));
cmd.DrawProcedural(Matrix4x4.identity, m_DecalNormalBufferMaterial, 0, MeshTopology.Triangles, 3, 1);

{
HDUtils.SetRenderTarget(cmd, hdCamera, m_ScreenSpaceShadowsBuffer, ClearFlag.Color, CoreUtils.clearColorAllBlack);
}
// In some cases when loading a project for the first time in the editor, the internal resource is destroyed.
// When used as render target, the C++ code will re-create the resource automatically. Since here it's used directly as an UAV, we need to check manually/
if (!m_ScreenSpaceShadowsBuffer.rt.IsCreated())
m_ScreenSpaceShadowsBuffer.rt.Create();
m_LightLoop.RenderScreenSpaceShadows(hdCamera, m_ScreenSpaceShadowsBuffer, GetDepthTexture(), cmd);
PushFullScreenDebugTexture(hdCamera, cmd, m_ScreenSpaceShadowsBuffer, FullScreenDebugMode.ScreenSpaceShadows);

正在加载...
取消
保存