浏览代码

Merge pull request #1887 from Unity-Technologies/HDRP/fix-deferred-shadow-init

Fixed an init issue with deferred shadow texture.
/hdrp-staging
GitHub 6 年前
当前提交
8cdaae66
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 1
      com.unity.render-pipelines.high-definition/CHANGELOG.md
  2. 7
      com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs

1
com.unity.render-pipelines.high-definition/CHANGELOG.md


### Fixed
- Stencil test during decals normal buffer update is now properly applied
- Fixed an issue where sometimes the deferred shadow texture would not be valid, causing wrong rendering.
## [3.3.0-preview]

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);

正在加载...
取消
保存