浏览代码

Fixed HDRP when decal are disabled (issue caused by RTHandle PR)

/main
Julien Ignace 7 年前
当前提交
5749cc0f
共有 2 个文件被更改,包括 17 次插入4 次删除
  1. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
  2. 19
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Decal/DBufferManager.cs

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


m_SSSBufferManager.PushGlobalParams(cmd, sssParameters, m_FrameSettings);
m_DbufferManager.PushGlobalParams(cmd);
m_DbufferManager.PushGlobalParams(cmd, m_FrameSettings);
m_VolumetricLightingModule.PushGlobalParams(hdCamera, cmd);
}

19
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Decal/DBufferManager.cs


using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{

cmd.ClearRandomWriteTargets();
}
public void PushGlobalParams(CommandBuffer cmd)
public void PushGlobalParams(CommandBuffer cmd, FrameSettings frameSettings)
cmd.SetGlobalInt(HDShaderIDs._EnableDBuffer, vsibleDecalCount > 0 ? 1 : 0);
BindBufferAsTextures(cmd);
if (frameSettings.enableDBuffer)
{
cmd.SetGlobalInt(HDShaderIDs._EnableDBuffer, vsibleDecalCount > 0 ? 1 : 0);
BindBufferAsTextures(cmd);
}
else
{
cmd.SetGlobalInt(HDShaderIDs._EnableDBuffer, 0);
// We still bind black textures to make sure that something is bound (can be a problem on some platforms)
for (int i = 0; i < m_BufferCount; ++i)
{
cmd.SetGlobalTexture(m_TextureShaderIDs[i], RuntimeUtilities.blackTexture);
}
}
}
}
}
正在加载...
取消
保存