|
|
|
|
|
|
|
|
|
|
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; |
|
|
|