|
|
|
|
|
|
|
|
|
|
if (m_Asset.renderPipelineSettings.supportMotionVectors) |
|
|
|
{ |
|
|
|
m_VelocityBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: Builtin.GetVelocityBufferFormat(), sRGB: Builtin.GetVelocityBuffer_sRGBFlag(), enableMSAA: true); |
|
|
|
m_VelocityBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: Builtin.GetVelocityBufferFormat(), sRGB: Builtin.GetVelocityBufferSRGBFlag(), enableMSAA: true); |
|
|
|
m_DistortionBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: Builtin.GetDistortionBufferFormat(), sRGB: Builtin.GetDistortionBuffer_sRGBFlag()); |
|
|
|
m_DistortionBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: Builtin.GetDistortionBufferFormat(), sRGB: Builtin.GetDistortionBufferSRGBFlag()); |
|
|
|
|
|
|
|
// TODO: For MSAA, we'll need to add a Draw path in order to support MSAA properly
|
|
|
|
m_DeferredShadowBuffer = RTHandle.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGB32, sRGB: false, enableRandomWrite: true); |
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
using (new ProfilingSample(cmd, "Blit to final RT", CustomSamplerId.CopyDepthForSceneView.GetSampler())) |
|
|
|
using (new ProfilingSample(cmd, "Blit to final RT", CustomSamplerId.BlitToFinalRT.GetSampler())) |
|
|
|
{ |
|
|
|
// This Blit will flip the screen on anything other than openGL
|
|
|
|
HDUtils.BlitCameraTexture(cmd, hdCamera, m_CameraColorBuffer, BuiltinRenderTextureType.CameraTarget); |
|
|
|
|
|
|
// Make sure RenderDebug does not change the current Render Target
|
|
|
|
if (camera.cameraType == CameraType.SceneView) |
|
|
|
{ |
|
|
|
using (new ProfilingSample(cmd, "Copy Depth For SceneView", CustomSamplerId.BlitToFinalRT.GetSampler())) |
|
|
|
using (new ProfilingSample(cmd, "Copy Depth For SceneView", CustomSamplerId.CopyDepthForSceneView.GetSampler())) |
|
|
|
{ |
|
|
|
m_CopyDepth.SetTexture(HDShaderIDs._InputDepth, m_CameraDepthStencilBuffer); |
|
|
|
cmd.Blit(null, BuiltinRenderTextureType.CameraTarget, m_CopyDepth); |
|
|
|