fix: capture video frame before ImGui — no UI in recordings

Moved CaptureFrame call before _imGui.Render() so the screenshot
buffer contains only the 3D scene without ImGui overlay.
This commit is contained in:
emil28092005
2026-06-19 08:46:22 +03:00
parent 346b422cb0
commit b6299e8048
+5 -5
View File
@@ -505,16 +505,16 @@ public sealed unsafe class VulkanRenderer : IRenderer, Engine.Graphics.IScreensh
Vk.vkCmdDrawIndexed(cmd, dc.indexCount, 1, 0, 0, 0);
}
_imGui?.Render(cmd, _swapchain.Extent.Width, _swapchain.Extent.Height);
Vk.vkCmdEndRendering(cmd);
// Capture frame for video recording if enabled
// Capture frame BEFORE ImGui (video without UI)
if (IsRecording)
{
CapturedFrame = CaptureFrame(cmd, imageIndex);
}
_imGui?.Render(cmd, _swapchain.Extent.Width, _swapchain.Extent.Height);
Vk.vkCmdEndRendering(cmd);
TransitionImageLayout(cmd, _swapchain.Images[imageIndex],
VkImageLayout.ColorAttachmentOptimal, VkImageLayout.PresentSrcKHR,
0x400, 0x100,