浏览代码

Merge pull request #174 from Unity-Technologies/Branch_DepthBufferCreateFix

Fixed a bug with depth buffer not being properly created when switching scenes.
/Branch_Batching2
GitHub 8 年前
当前提交
f6b723f1
共有 1 个文件被更改,包括 14 次插入12 次删除
  1. 26
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs

26
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


if (m_LightLoop == null)
return;
if (camera.pixelWidth != m_CurrentWidth || camera.pixelHeight != m_CurrentHeight)
bool resolutionChanged = camera.pixelWidth != m_CurrentWidth || camera.pixelHeight != m_CurrentHeight;
if (resolutionChanged || m_CameraDepthStencilBuffer == null)
if(m_LightLoop.NeedResize())
{
if (m_CurrentWidth > 0 && m_CurrentHeight > 0)
{
m_LightLoop.ReleaseResolutionDependentBuffers();
}
}
m_LightLoop.AllocResolutionDependentBuffers(camera.pixelWidth, camera.pixelHeight);
if (resolutionChanged || m_LightLoop.NeedResize())
{
if (m_CurrentWidth > 0 && m_CurrentHeight > 0)
{
m_LightLoop.ReleaseResolutionDependentBuffers();
// update recorded window resolution
m_CurrentWidth = camera.pixelWidth;
m_CurrentHeight = camera.pixelHeight;
m_LightLoop.AllocResolutionDependentBuffers(camera.pixelWidth, camera.pixelHeight);
// update recorded window resolution
m_CurrentWidth = camera.pixelWidth;
m_CurrentHeight = camera.pixelHeight;
}
public void PushGlobalParams(HDCamera hdCamera, ScriptableRenderContext renderContext, SubsurfaceScatteringSettings sssParameters)

正在加载...
取消
保存