浏览代码

Fixed viewport rendering issue.

/main
Felipe Lira 7 年前
当前提交
70226c0e
共有 1 个文件被更改,包括 9 次插入4 次删除
  1. 13
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs

13
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


}
Rect cameraRect = m_CurrCamera.rect;
if (cameraRect.x > 0.0f || cameraRect.y > 0.0f || cameraRect.width < 1.0f || cameraRect.height < 1.0f)
intermediateTexture = true;
else
if (!(Math.Abs(cameraRect.x) > 0.0f || Math.Abs(cameraRect.y) > 0.0f || Math.Abs(cameraRect.width) < 1.0f || Math.Abs(cameraRect.height) < 1.0f))
configuration |= FrameRenderingConfiguration.DefaultViewport;
if (intermediateTexture)

context.StartMultiEye(m_CurrCamera);
CommandBuffer cmd = CommandBufferPool.Get("SetCameraRenderTarget");
if (LightweightUtils.HasFlag(renderingConfig, FrameRenderingConfiguration.IntermediateTexture))
bool intermeaditeTexture = LightweightUtils.HasFlag(renderingConfig, FrameRenderingConfiguration.IntermediateTexture);
if (intermeaditeTexture)
{
if (!m_IsOffscreenCamera)
colorRT = m_CurrCameraColorRT;

SetRenderTarget(cmd, colorRT, depthRT, clearFlag);
}
// If rendering to an intermediate RT we resolve viewport on blit due to offset not being supported
// while rendering to a RT.
if (!intermeaditeTexture && !LightweightUtils.HasFlag(renderingConfig, FrameRenderingConfiguration.DefaultViewport))
cmd.SetViewport(m_CurrCamera.pixelRect);
context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);

cmd.SetGlobalTexture(m_BlitTexID, sourceRT);
SetRenderTarget(cmd, destRT);
cmd.SetViewProjectionMatrices(Matrix4x4.identity, Matrix4x4.identity);
cmd.SetViewport(m_CurrCamera.pixelRect);
cmd.DrawMesh(m_BlitQuad, Matrix4x4.identity, m_BlitMaterial);
}

正在加载...
取消
保存