diff --git a/base/vulkanexamplebase.h b/base/vulkanexamplebase.h index 7a9152a..226146f 100644 --- a/base/vulkanexamplebase.h +++ b/base/vulkanexamplebase.h @@ -119,8 +119,8 @@ public: bool multiSampling = true; // 多重采样 bool rotateModel = true; // 模型自旋转(暂时失效) bool headless = false; // 无头开关 - bool outputPNGimage = true; - bool enableSaveToImageSequeue = false; // 图片序列开关(暂时弃用) + bool outputPNGimage = false; + bool enableSaveToImageSequeue = true; // 图片序列开关(暂时弃用) uint32_t outputFrameCount = 75; // 图片序列结束帧 bool takeScreenShot = false; // 截屏(暂时弃用) uint32_t startFrameCount = 1; // 图片序列开始帧 diff --git a/data/output/video/device0/result.mp4 b/data/output/video/device0/result.mp4 index d06e51f..2fa2cd1 100644 Binary files a/data/output/video/device0/result.mp4 and b/data/output/video/device0/result.mp4 differ diff --git a/src/render/render.cpp b/src/render/render.cpp index 504442c..0855b24 100644 --- a/src/render/render.cpp +++ b/src/render/render.cpp @@ -1762,7 +1762,6 @@ PlumageRender::PlumageRender() } else { - std::ofstream file(filePath, std::ios::out | std::ios::binary); // ppm header @@ -1777,9 +1776,6 @@ PlumageRender::PlumageRender() std::vector formatsBGR = { VK_FORMAT_B8G8R8A8_SRGB, VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_B8G8R8A8_SNORM }; colorSwizzle = (std::find(formatsBGR.begin(), formatsBGR.end(), swapChain.colorFormat) != formatsBGR.end()); } - - - // ppm binary pixel data for (uint32_t y = 0; y < height; y++) { @@ -1803,8 +1799,6 @@ PlumageRender::PlumageRender() file.close(); } - - std::cout << "Screenshot saved to " << filePath << std::endl; // Clean up resources @@ -1860,7 +1854,7 @@ PlumageRender::PlumageRender() } else { - fileNameSuffix = "dresult.ppm"; + fileNameSuffix = "result.ppm"; } std::string fileName ="/" + std::to_string(savedFrameCounter) + fileNameSuffix; filePath.totalImageOutputPath = filePath.deviceSpecFilePath + fileName; @@ -1964,9 +1958,10 @@ PlumageRender::PlumageRender() //outputImageSequeue(swapChainImage,filePath.imageSequenceFilePath); - - VK_CHECK_RESULT(vkWaitForFences(device, 1, &waitFences[frameIndex], VK_TRUE, UINT64_MAX)); outputImageSequence(); + + VK_CHECK_RESULT(vkWaitForFences(device, 1, &waitFences[frameIndex], VK_TRUE, UINT64_MAX)); + imageSequenceToVideo(); VK_CHECK_RESULT(vkResetFences(device, 1, &waitFences[frameIndex]));