From a29aed2803a00bf893adfcb6549244ade64462bc Mon Sep 17 00:00:00 2001 From: atdunbg Date: Wed, 23 Sep 2026 13:11:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Pause=20Animation=20=E5=BC=80=E5=85=B3?= =?UTF-8?q?=EF=BC=88=E5=B8=A7=E5=8E=86=E5=8F=B2=20diff=20=E5=86=BB?= =?UTF-8?q?=E7=BB=93=E9=AA=8C=E8=AF=81=E7=94=A8=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/App/main.cpp b/App/main.cpp index b221b4e..a159d8c 100644 --- a/App/main.cpp +++ b/App/main.cpp @@ -101,7 +101,12 @@ protected: void OnUpdate(f32 deltaTime) override { - m_Time += deltaTime; + // 暂停时冻结动画时钟(帧历史验证:暂停后 Temporal Diff + // 视图应在 2 帧内整屏变黑;相机移动同样会被 diff 捕捉到) + if (!m_PauseAnim) + { + m_Time += deltaTime; + } // 相机(WASD/Space/Shift 移动) m_Camera.GetComponent() @@ -172,6 +177,7 @@ protected: { renderer.SetShowTemporalDiff(temporalDiff); } + ImGui::Checkbox("Pause Animation", &m_PauseAnim); // Pass 级 GPU 耗时(RG timestamp) ImGui::Separator(); @@ -286,6 +292,7 @@ private: EntityHandle m_KeyLight{}; std::vector m_Spinners; f32 m_Time = 0.0f; + bool m_PauseAnim = false; // 冻结动画时钟(帧历史 diff 验证用) }; int main()