浏览代码

Source proper XR render texture size

When single-pass stereo rendering is enabled, we need to source the physical texture size from XRSettings.eyeTextureDesc.

TODO: Still need to handle Texture Arrays and VRTextureUsage appropriately, but that's another PR.
/main
Robert Srinivasiah 7 年前
当前提交
57fee59f
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 12
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDCamera.cs

12
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDCamera.cs


m_ActualWidth = camera.pixelWidth;
m_ActualHeight = camera.pixelHeight;
var screenWidth = m_ActualWidth;
var screenHeight = m_ActualHeight;
m_ActualWidth = XRSettings.eyeTextureWidth;
m_ActualHeight = XRSettings.eyeTextureHeight;
screenWidth = XRSettings.eyeTextureWidth;
screenHeight = XRSettings.eyeTextureHeight;
var xrDesc = XRSettings.eyeTextureDesc;
m_ActualWidth = xrDesc.width;
m_ActualHeight = xrDesc.height;
}
// Unfortunately sometime (like in the HDCameraEditor) HDUtils.hdrpSettings can be null because of scripts that change the current pipeline...

m_CameraScaleBias.x = (float)m_ActualWidth / maxWidth;
m_CameraScaleBias.y = (float)m_ActualHeight / maxHeight;
screenSize = new Vector4(m_ActualWidth, m_ActualHeight, 1.0f / m_ActualWidth, 1.0f / m_ActualHeight);
screenSize = new Vector4(screenWidth, screenHeight, 1.0f / screenWidth, 1.0f / screenHeight);
}
// Warning: different views can use the same camera!

正在加载...
取消
保存