浏览代码

Added a renderscale threshold. Variations within the threshold will be disregarded and default scale will be used.

/tag-1.1.4-preview
Felipe Lira 7 年前
当前提交
6c4ee69c
共有 1 个文件被更改,包括 9 次插入2 次删除
  1. 11
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs

11
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


private static readonly int kMaxVertexLights = 4;
private static readonly float kRenderScaleThreshold = 0.05f;
private bool m_IsOffscreenCamera;
private Vector4 kDefaultLightPosition = new Vector4(0.0f, 0.0f, 1.0f, 0.0f);

bool sceneViewCamera = m_CurrCamera.cameraType == CameraType.SceneView;
bool stereoEnabled = IsStereoEnabled(m_CurrCamera);
// Disregard variations around kRenderScaleThreshold.
m_RenderScale = (Mathf.Abs(1.0f - m_Asset.RenderScale) < kRenderScaleThreshold) ? 1.0f : m_Asset.RenderScale;
m_RenderScale = (m_CurrCamera.cameraType == CameraType.Game && !stereoEnabled) ? m_Asset.RenderScale : 1.0f;
m_RenderScale = (m_CurrCamera.cameraType == CameraType.Game && !stereoEnabled) ? m_RenderScale : 1.0f;
m_IsOffscreenCamera = m_CurrCamera.targetTexture != null && m_CurrCamera.cameraType != CameraType.SceneView;
SetupPerCameraShaderConstants();

m_IntermediateTextureArray = false;
bool hdrEnabled = m_Asset.SupportsHDR && m_CurrCamera.allowHDR;
bool defaultRenderScale = Mathf.Approximately(GetRenderScale(), 1.0f);
GetRenderScale() < 1.0f || hdrEnabled;
!defaultRenderScale || hdrEnabled;
m_ColorFormat = hdrEnabled ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default;
m_RequireCopyColor = false;

正在加载...
取消
保存