浏览代码

Use a new workaround for Utilities.DrawFullscreen()

/main
Evgenii Golubev 8 年前
当前提交
212f861f
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 12
      Assets/ScriptableRenderLoop/HDRenderPipeline/Utilities.cs

12
Assets/ScriptableRenderLoop/HDRenderPipeline/Utilities.cs


}
// Draws a full screen triangle as a faster alternative to drawing a full-screen quad.
// Important: the first RenderTarget must be created with 0 depth bits!
// A workaround for the deficiency of the CommandBuffer.SetRenderTarget() API.
const int tempDepthBufferID = 95485683;
commandBuffer.GetTemporaryRT(tempDepthBufferID, 2283, 767, 24, FilterMode.Point, RenderTextureFormat.Depth);
RenderTargetIdentifier tempDepthBuffer = new RenderTargetIdentifier(tempDepthBufferID);
commandBuffer.SetRenderTarget(colorBuffers, tempDepthBuffer);
// It is currently not possible to have MRT without also setting a depth target.
// To work around this deficiency of the CommandBuffer.SetRenderTarget() API,
// we pass the first color target as the depth target. If it has 0 depth bits,
// no depth target ends up being bound.
commandBuffer.SetRenderTarget(colorBuffers, colorBuffers[0]);
commandBuffer.DrawMesh(m_ScreenSpaceTriangle, Matrix4x4.identity, material, 0, shaderPassID);
}

正在加载...
取消
保存