cmd . SetGlobalVector ( HDShaderIDs . _ColorPyramidSize , Vector4 . one ) ;
cmd . SetGlobalVector ( HDShaderIDs . _ColorPyramidScale , Vector4 . one ) ;
}
cmd . SetGlobalBuffer ( HDShaderIDs . _DebugScreenSpaceTracingData , m_DebugScreenSpaceTracingData ) ;
}
}
renderContext . SetupCameraProperties ( camera , hdCamera . frameSettings . enableStereo ) ;
PushGlobalParams ( hdCamera , cmd , diffusionProfileSettings ) ;
PushVelocityBuffer ( hdCamera , renderContext , cmd ) ;
// TODO: Find a correct place to bind these material textures
// We have to bind the material specific global parameters in this mode
RenderDepthPyramid ( hdCamera , cmd , renderContext , FullScreenDebugMode . DepthPyramid ) ;
RenderCameraVelocity ( m_CullResults , hdCamera , renderContext , cmd ) ;
PushVelocityBuffer ( hdCamera , renderContext , cmd ) ;
// Depth texture is now ready, bind it (Depth buffer could have been bind before if DBuffer is enable)
cmd . SetGlobalTexture ( HDShaderIDs . _CameraDepthTexture , GetDepthTexture ( ) ) ;
: m_ForwardOnlyPassNames ;
var debugSSTThisPass = debugScreenSpaceTracing & & ( m_CurrentDebugDisplaySettings . lightingDebugSettings . debugLightingMode = = DebugLightingMode . ScreenSpaceTracingReflection ) ;
if ( debugSSTThisPass )
{
cmd . SetGlobalBuffer ( HDShaderIDs . _DebugScreenSpaceTracingData , m_DebugScreenSpaceTracingData ) ;
}
RenderOpaqueRenderList ( cullResults , hdCamera , renderContext , cmd , passNames , m_currentRendererConfigurationBakedLighting ) ;
if ( debugSSTThisPass )
cmd . ClearRandomWriteTargets ( ) ;
var debugSSTThisPass = debugScreenSpaceTracing & & ( m_CurrentDebugDisplaySettings . lightingDebugSettings . debugLightingMode = = DebugLightingMode . ScreenSpaceTracingRefraction ) ;
if ( debugSSTThisPass )
{
cmd . SetGlobalBuffer ( HDShaderIDs . _DebugScreenSpaceTracingData , m_DebugScreenSpaceTracingData ) ;
}
RenderTransparentRenderList ( cullResults , hdCamera , renderContext , cmd , m_AllTransparentPassNames , m_currentRendererConfigurationBakedLighting , pass = = ForwardPass . PreRefraction ? HDRenderQueue . k_RenderQueue_PreRefraction : HDRenderQueue . k_RenderQueue_Transparent ) ;
if ( debugSSTThisPass )
cmd . ClearRandomWriteTargets ( ) ;
HDUtils . SetRenderTarget ( cmd , hdCamera , m_VelocityBuffer , m_CameraDepthStencilBuffer ) ;
RenderOpaqueRenderList ( cullResults , hdCamera , renderContext , cmd , HDShaderPassNames . s_MotionVectorsName , RendererConfiguration . PerObjectMotionVectors ) ;
cmd . SetGlobalTexture ( HDShaderIDs . _CameraMotionVectorsTexture , m_VelocityBuffer ) ;
cmd . SetGlobalVector ( HDShaderIDs . _CameraMotionVectorsSize , new Vector4 (
m_VelocityBuffer . referenceSize . x ,
m_VelocityBuffer . referenceSize . y ,
1f / m_VelocityBuffer . referenceSize . x ,
1f / m_VelocityBuffer . referenceSize . y
) ) ;
cmd . SetGlobalVector ( HDShaderIDs . _CameraMotionVectorsScale , new Vector4 (
m_VelocityBuffer . referenceSize . x / ( float ) m_VelocityBuffer . rt . width ,
m_VelocityBuffer . referenceSize . y / ( float ) m_VelocityBuffer . rt . height ,
1 , 0.0f
) ) ;
}
}
{
// TODO: Be sure that if there is no change in the state of this keyword, it doesn't imply any work on CPU side! else we will need to save the sate somewher
cmd . DisableShaderKeyword ( "DEBUG_DISPLAY" ) ;
}
}
void PushVelocityBuffer ( HDCamera hdCamera , ScriptableRenderContext renderContext , CommandBuffer cmd )
{
using ( new ProfilingSample ( cmd , "Push Velocity Buffer" , CustomSamplerId . PushVelocityBufferParameters . GetSampler ( ) ) )
{
cmd . SetGlobalTexture ( HDShaderIDs . _CameraMotionVectorsTexture , m_VelocityBuffer ) ;
cmd . SetGlobalVector ( HDShaderIDs . _CameraMotionVectorsSize , new Vector4 (
m_VelocityBuffer . referenceSize . x ,
m_VelocityBuffer . referenceSize . y ,
1f / m_VelocityBuffer . referenceSize . x ,
1f / m_VelocityBuffer . referenceSize . y
) ) ;
cmd . SetGlobalVector ( HDShaderIDs . _CameraMotionVectorsScale , new Vector4 (
m_VelocityBuffer . referenceSize . x / ( float ) m_VelocityBuffer . rt . width ,
m_VelocityBuffer . referenceSize . y / ( float ) m_VelocityBuffer . rt . height ,
1 , 0.0f
) ) ;
}
}