浏览代码

Fixed viewport setup for cameras rendering to RenderTexture.

/RenderPassXR_Sandbox
Felipe Lira 7 年前
当前提交
6ead8e71
共有 1 个文件被更改,包括 14 次插入6 次删除
  1. 20
      ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs

20
ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs


var cmd = CommandBufferPool.Get("SetCameraRenderTarget");
if (m_RenderToIntermediateTarget)
{
if (m_CurrCamera.activeTexture == null)
if (m_CurrCamera.targetTexture == null)
{
m_IntermediateTextureArray = false;
if (stereoEnabled)

if (!stereoEnabled)
{
Rect viewport = m_CurrCamera.rect;
viewport.x *= Screen.width;
viewport.y *= Screen.height;
viewport.width *= Screen.width;
viewport.height *= Screen.height;
if (m_CurrCamera.targetTexture == null)
{
viewport.x *= Screen.width;
viewport.y *= Screen.height;
viewport.width *= Screen.width;
viewport.height *= Screen.height;
}
else
{
viewport = new Rect(0.0f, 0.0f, m_CurrCamera.targetTexture.width, m_CurrCamera.targetTexture.height);
}
cmd.SetViewport(viewport);
}

private bool GetRenderToIntermediateTarget()
{
bool allowMSAA = m_CurrCamera.allowMSAA && m_Asset.MSAASampleCount > 1 && !PlatformSupportsMSAABackBuffer();
if (m_CurrCamera.cameraType == CameraType.SceneView || allowMSAA || m_CurrCamera.activeTexture != null)
if (m_CurrCamera.cameraType == CameraType.SceneView || allowMSAA || m_CurrCamera.targetTexture != null)
return true;
return false;

正在加载...
取消
保存