|
|
|
|
|
|
using (new ProfilingSample(cmd, "Clear HDR target", CustomSamplerId.ClearHDRTarget.GetSampler())) |
|
|
|
{ |
|
|
|
if (hdCamera.clearColorMode == HDAdditionalCameraData.ClearColorMode.BackgroundColor || |
|
|
|
// If the luxmeter is enabled, the sky isn't rendered so we clear the background color
|
|
|
|
m_DebugDisplaySettings.lightingDebugSettings.debugLightingMode == DebugLightingMode.LuxMeter || |
|
|
|
// If we want the sky but the sky don't exist, still clear with background color
|
|
|
|
(hdCamera.clearColorMode == HDAdditionalCameraData.ClearColorMode.Sky && !m_SkyManager.IsVisualSkyValid()) || |
|
|
|
// Special handling for Preview we force to clear with background color (i.e black)
|
|
|
|
|
|
|
{ |
|
|
|
Color clearColor = hdCamera.backgroundColorHDR; |
|
|
|
|
|
|
|
// We set the background color to black when the luxmeter is enabled to avoid picking the sky color
|
|
|
|
if (m_DebugDisplaySettings.lightingDebugSettings.debugLightingMode == DebugLightingMode.LuxMeter) |
|
|
|
clearColor = Color.black; |
|
|
|
|
|
|
|
HDUtils.SetRenderTarget(cmd, hdCamera, m_CameraColorBuffer, m_CameraDepthStencilBuffer, ClearFlag.Color, clearColor); |
|
|
|
} |
|
|
|
} |
|
|
|