예제 #1
0
        public void ExecutePass(
            DeviceContext context,
            RenderTargetSet target,
            RenderTargetSet sourceCurrent,
            RenderTargetSet sourceHistory,
            RenderTargetSet motionVectors,
            RenderTargetSet motionVectorsPrevious,
            bool accumulateHistory = false)
        {
            using (new GpuProfilePoint(context, "ResolveTemporalMotionBased"))
            {
                sourceCurrent.BindSRV(context, 0);
                sourceHistory.BindSRV(context, 1);
                motionVectors.BindSRV(context, 2);
                motionVectorsPrevious.BindSRV(context, 3);

                target.BindAsRenderTarget(context);
                PostEffectHelper.RenderFullscreenTriangle(context, accumulateHistory ? "ResolveTemporalHistoryAccumulation" : "ResolveTemporalMotionBased");
                RenderTargetSet.BindNull(context);
                ContextHelper.ClearSRVs(context);

                if (accumulateHistory)
                {
                    PostEffectHelper.Copy(context, sourceCurrent, target);
                }
            }
        }
예제 #2
0
 public static void RegisterDebug(DeviceContext context, string name, RenderTargetSet debuggedRT, int rtNum = 0)
 {
     if (m_AvailableModes.Contains(name))
     {
         if (m_CurrentDebugSurface == name)
         {
             if (m_CurrentDebugMode == "A")
             {
                 PostEffectHelper.CopyAlpha(context, m_DebugRenderTarget, debuggedRT, rtNum);
             }
             else if (m_CurrentDebugMode == "FRAC")
             {
                 PostEffectHelper.CopyFrac(context, m_DebugRenderTarget, debuggedRT, rtNum);
             }
             else if (m_CurrentDebugMode == "RGBGamma")
             {
                 PostEffectHelper.CopyGamma(context, m_DebugRenderTarget, debuggedRT, rtNum);
             }
             else
             {
                 PostEffectHelper.Copy(context, m_DebugRenderTarget, debuggedRT, rtNum);
             }
         }
     }
     else
     {
         m_IsUIRebuildRequired = true;
         m_AvailableModes.Add(name);
     }
 }
예제 #3
0
 public static void PresentDebug(DeviceContext context, RenderTargetSet target)
 {
     if (m_CurrentDebugSurface != "None")
     {
         PostEffectHelper.Copy(context, target, m_DebugRenderTarget);
     }
 }
예제 #4
0
 public static void PresentDebug(DeviceContext context, RenderTargetSet target)
 {
     if (m_CurrentDebugSurface != "None")
     {
         PostEffectHelper.Copy(context, target, m_DebugRenderTarget);
     }
     if (m_TakeSnapshot)
     {
         PostEffectHelper.Copy(context, m_SnapshotRenderTarget, target);
         m_TakeSnapshot = false;
     }
     if (m_ShowSnapshot)
     {
         if (m_ShowSnapshotDifference)
         {
             PostEffectHelper.Copy(context, m_DebugRenderTarget, target);
             PostEffectHelper.Difference(context, target, m_SnapshotRenderTarget, m_DebugRenderTarget);
         }
         else
         {
             PostEffectHelper.Copy(context, target, m_SnapshotRenderTarget);
         }
     }
 }