// TODO: Float HDCamera setup higher in order to pass stereo into GetCullingParameters
ScriptableCullingParameters cullingParams ;
if ( ! CullResults . GetCullingParameters ( camera , out cullingParams ) )
if ( ! CullResults . GetCullingParameters ( camera , m_FrameSettings . enableStereo , out cullingParams ) )
{
renderContext . Submit ( ) ;
continue ;
DecalSystem . instance . EndCull ( ) ;
}
renderContext . SetupCameraProperties ( camera ) ;
renderContext . SetupCameraProperties ( camera , m_FrameSettings . enableStereo ) ;
PushGlobalParams ( hdCamera , cmd , diffusionProfileSettings ) ;
}
ConfigureForShadowMask ( enableBakeShadowMask , cmd ) ;
if ( m_FrameSettings . enableStereo )
renderContext . StartMultiEye ( hdCamera . camera ) ;
// TODO: Add stereo occlusion mask
bool forcePrepassForDecals = m_DbufferManager . vsibleDecalCount > 0 ;
RenderDepthPrepass ( m_CullResults , hdCamera , renderContext , cmd , forcePrepassForDecals ) ;
RenderPyramidDepth ( hdCamera , cmd , renderContext , FullScreenDebugMode . DepthPyramid ) ;
if ( m_FrameSettings . enableStereo )
renderContext . StopMultiEye ( hdCamera . camera ) ;
if ( m_CurrentDebugDisplaySettings . IsDebugMaterialDisplayEnabled ( ) )
{
}
else
{
if ( m_FrameSettings . enableStereo )
renderContext . StartMultiEye ( hdCamera . camera ) ;
using ( new ProfilingSample ( cmd , "Render SSAO" , CustomSamplerId . RenderSSAO . GetSampler ( ) ) )
{
// TODO: Everything here (SSAO, Shadow, Build light list, deferred shadow, material and light classification can be parallelize with Async compute)
}
}
if ( m_FrameSettings . enableStereo )
renderContext . StopMultiEye ( hdCamera . camera ) ;
GPUFence buildGPULightListsCompleteFence = new GPUFence ( ) ;
if ( m_FrameSettings . enableAsyncCompute )
{
{
m_LightLoop . RenderShadows ( renderContext , cmd , m_CullResults ) ;
// TODO: check if statement below still apply
renderContext . SetupCameraProperties ( camera ) ; // Need to recall SetupCameraProperties after RenderShadows as it modify our view/proj matrix
renderContext . SetupCameraProperties ( camera , m_FrameSettings . enableStereo ) ; // Need to recall SetupCameraProperties after RenderShadows as it modify our view/proj matrix
}
using ( new ProfilingSample ( cmd , "Deferred directional shadows" , CustomSamplerId . RenderDeferredDirectionalShadow . GetSampler ( ) ) )
m_VolumetricLightingModule . VolumetricLightingPass ( hdCamera , cmd , m_FrameSettings ) ;
RenderDeferredLighting ( hdCamera , cmd ) ;
// Might float this higher if we enable stereo w/ deferred
if ( m_FrameSettings . enableStereo )
renderContext . StartMultiEye ( hdCamera . camera ) ;
RenderForward ( m_CullResults , hdCamera , renderContext , cmd , ForwardPass . Opaque ) ;
RenderForwardError ( m_CullResults , hdCamera , renderContext , cmd , ForwardPass . Opaque ) ;
AccumulateDistortion ( m_CullResults , hdCamera , renderContext , cmd ) ;
RenderDistortion ( cmd , m_Asset . renderPipelineResources , hdCamera ) ;
if ( m_FrameSettings . enableStereo )
renderContext . StopMultiEye ( hdCamera . camera ) ;
PushFullScreenDebugTexture ( cmd , m_CameraColorBuffer , hdCamera , FullScreenDebugMode . NanTracker ) ;
PushColorPickerDebugTexture ( cmd , m_CameraColorBuffer , hdCamera ) ;
if ( m_FrameSettings . enableStereo )
renderContext . StartMultiEye ( hdCamera . camera ) ;
// Final blit
if ( m_FrameSettings . enablePostprocess & & CoreUtils . IsPostProcessingActive ( postProcessLayer ) )
{
// This Blit will flip the screen on anything other than openGL
HDUtils . BlitCameraTexture ( cmd , hdCamera , m_CameraColorBuffer , BuiltinRenderTextureType . CameraTarget ) ;
}
}
if ( m_FrameSettings . enableStereo )
{
renderContext . StopMultiEye ( hdCamera . camera ) ;
renderContext . StereoEndRender ( hdCamera . camera ) ;
}
}