else
{
m_CurrentDebugDisplaySettings = m_DebugDisplaySettings ;
}
using ( new ProfilingSample ( cmd , "Volume Update" , CustomSamplerId . VolumeUpdate . GetSampler ( ) ) )
using ( new ProfilingSample ( cmd , "Volume Update" , CustomSamplerId . VolumeUpdate . GetSampler ( ) ) )
{
LayerMask layerMask = - 1 ;
if ( additionalCameraData ! = null )
LayerMask layerMask = - 1 ;
if ( additionalCameraData ! = null )
layerMask = additionalCameraData . volumeLayerMask ;
}
else
{
// Temporary hack:
// For scene view, by default, we use the "main" camera volume layer mask if it exis ts
// Otherwise we just remove the lighting override layers in the current sky to avoid conflicts
// This is arbitrary and should be editable in the scene view somehow.
if ( camera . cameraType = = CameraType . SceneView )
layerMask = additionalCameraData . volumeLayerMask ;
}
else
{
// Temporary hack:
// For scene view, by default, we use the "main" camera volume layer mask if it exists
// Otherwise we just remove the lighting override layers in the current sky to avoid conflic ts
// This is arbitrary and should be editable in the scene view somehow.
if ( camera . cameraType = = CameraType . SceneView )
var mainCamera = Camera . main ;
bool needFallback = true ;
if ( mainCamera ! = null )
var mainCamera = Camera . main ;
bool needFallback = true ;
if ( mainCamera ! = null )
var mainCamAdditionalData = mainCamera . GetComponent < HDAdditionalCameraData > ( ) ;
if ( mainCamAdditionalData ! = null )
var mainCamAdditionalData = mainCamera . GetComponent < HDAdditionalCameraData > ( ) ;
if ( mainCamAdditionalData ! = null )
{
layerMask = mainCamAdditionalData . volumeLayerMask ;
needFallback = false ;
}
layerMask = mainCamAdditionalData . volumeLayerMask ;
needFallback = false ;
}
if ( needFallback )
{
// If the override layer is "Everything", we fall-back to "Everything" for the current layer mask to avoid issues by having no current layer
// In practice we should never have "Everything" as an override mask as it does not make sense (a warning is issued in the UI)
if ( m_Asset . renderPipelineSettings . lightLoopSettings . skyLightingOverrideLayerMask = = - 1 )
layerMask = - 1 ;
else
layerMas k = ( - 1 & ~ m_Ass et . r enderPipelineSettings . lightLoopSettings . skyLightingOverrideLayerMask ) ;
}
if ( needFallback )
{
// If the override layer is "Everything", we fall-back to "Everything" for the current layer mask to avoid issues by having no current layer
// In practice we should never have "Everything" as an override mask as it does not make sense (a warning is issued in the UI)
if ( m_Asset . renderPipelineSettings . lightLoopSettings . skyLightingOverrideLayerMask = = - 1 )
layerMask = - 1 ;
else
layerMask = ( - 1 & ~ m_Asset . renderPipelineSettings . lightLoopSettings . skyLightingOverrideLayerMask ) ;
VolumeManager . instance . Update ( camera . transform , layerMask ) ;
VolumeManager . instance . Update ( camera . transform , layerMask ) ;
}
var postProcessLayer = camera . GetComponent < PostProcessLayer > ( ) ;