RTHandleSystem . RTHandle m_CameraStencilBufferCopy ;
RTHandleSystem . RTHandle m_VelocityBuffer ;
RTHandleSystem . RTHandle m_DeferredShadow Buffer ;
RTHandleSystem . RTHandle m_ScreenSpaceShadows Buffer ;
RTHandleSystem . RTHandle m_AmbientOcclusionBuffer ;
RTHandleSystem . RTHandle m_DistortionBuffer ;
m_DistortionBuffer = RTHandles . Alloc ( Vector2 . one , filterMode : FilterMode . Point , colorFormat : Builtin . GetDistortionBufferFormat ( ) , sRGB : Builtin . GetDistortionBufferSRGBFlag ( ) , name : "Distortion" ) ;
// TODO: For MSAA, we'll need to add a Draw path in order to support MSAA properly
m_DeferredShadowBuffer = RTHandles . Alloc ( Vector2 . one , filterMode : FilterMode . Point , colorFormat : RenderTextureFormat . ARGB32 , sRGB : false , enableRandomWrite : true , name : "DeferredShadow" ) ;
// TODO: For MSAA, we'll need to add a Draw path in order to support MSAA properlye
// Use RG16 as we only have one deferred directional and one screen space shadow light currently
m_ScreenSpaceShadowsBuffer = RTHandles . Alloc ( Vector2 . one , filterMode : FilterMode . Point , colorFormat : RenderTextureFormat . RG16 , sRGB : false , enableRandomWrite : true , name : "ScreenSpaceShadowsBuffer" ) ;
if ( Debug . isDebugBuild )
{
RTHandles . Release ( m_AmbientOcclusionBuffer ) ;
RTHandles . Release ( m_VelocityBuffer ) ;
RTHandles . Release ( m_DistortionBuffer ) ;
RTHandles . Release ( m_DeferredShadow Buffer ) ;
RTHandles . Release ( m_ScreenSpaceShadows Buffer ) ;
RTHandles . Release ( m_DebugColorPickerBuffer ) ;
RTHandles . Release ( m_DebugFullScreenTempBuffer ) ;
hdCamera . SetupGlobalStereoParams ( cmd ) ;
}
using ( new ProfilingSample ( cmd , "Deferred directional shadows" , CustomSamplerId . RenderDeferredDirectionalShadow . GetSampler ( ) ) )
using ( new ProfilingSample ( cmd , "Screen space shadows" , CustomSamplerId . ScreenSpaceShadows . GetSampler ( ) ) )
if ( m_CurrentDebugDisplaySettings . fullScreenDebugMode = = FullScreenDebugMode . Deferred Shadows)
if ( m_CurrentDebugDisplaySettings . fullScreenDebugMode = = FullScreenDebugMode . ScreenSpace Shadows)
HDUtils . SetRenderTarget ( cmd , hdCamera , m_DeferredShadow Buffer , ClearFlag . Color , CoreUtils . clearColorAllBlack ) ;
HDUtils . SetRenderTarget ( cmd , hdCamera , m_ScreenSpaceShadows Buffer , ClearFlag . Color , CoreUtils . clearColorAllBlack ) ;
m_LightLoop . RenderDeferredDirectionalShadow ( hdCamera , m_DeferredShadow Buffer , GetDepthTexture ( ) , cmd ) ;
PushFullScreenDebugTexture ( hdCamera , cmd , m_DeferredShadow Buffer , FullScreenDebugMode . Deferred Shadows) ;
m_LightLoop . RenderScreenSpaceShadows ( hdCamera , m_ScreenSpaceShadows Buffer , GetDepthTexture ( ) , cmd ) ;
PushFullScreenDebugTexture ( hdCamera , cmd , m_ScreenSpaceShadows Buffer , FullScreenDebugMode . ScreenSpace Shadows) ;
}
if ( hdCamera . frameSettings . enableAsyncCompute )