修复ppm路径错误

pull/3/head
ink-soul 2024-03-29 15:17:09 +08:00
parent 6e34140783
commit 3a78c71a24
3 changed files with 6 additions and 11 deletions

View File

@ -119,8 +119,8 @@ public:
bool multiSampling = true; // 多重采样 bool multiSampling = true; // 多重采样
bool rotateModel = true; // 模型自旋转(暂时失效) bool rotateModel = true; // 模型自旋转(暂时失效)
bool headless = false; // 无头开关 bool headless = false; // 无头开关
bool outputPNGimage = true; bool outputPNGimage = false;
bool enableSaveToImageSequeue = false; // 图片序列开关(暂时弃用) bool enableSaveToImageSequeue = true; // 图片序列开关(暂时弃用)
uint32_t outputFrameCount = 75; // 图片序列结束帧 uint32_t outputFrameCount = 75; // 图片序列结束帧
bool takeScreenShot = false; // 截屏(暂时弃用) bool takeScreenShot = false; // 截屏(暂时弃用)
uint32_t startFrameCount = 1; // 图片序列开始帧 uint32_t startFrameCount = 1; // 图片序列开始帧

Binary file not shown.

View File

@ -1762,7 +1762,6 @@ PlumageRender::PlumageRender()
} }
else else
{ {
std::ofstream file(filePath, std::ios::out | std::ios::binary); std::ofstream file(filePath, std::ios::out | std::ios::binary);
// ppm header // ppm header
@ -1777,9 +1776,6 @@ PlumageRender::PlumageRender()
std::vector<VkFormat> formatsBGR = { VK_FORMAT_B8G8R8A8_SRGB, VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_B8G8R8A8_SNORM }; std::vector<VkFormat> formatsBGR = { VK_FORMAT_B8G8R8A8_SRGB, VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_B8G8R8A8_SNORM };
colorSwizzle = (std::find(formatsBGR.begin(), formatsBGR.end(), swapChain.colorFormat) != formatsBGR.end()); colorSwizzle = (std::find(formatsBGR.begin(), formatsBGR.end(), swapChain.colorFormat) != formatsBGR.end());
} }
// ppm binary pixel data // ppm binary pixel data
for (uint32_t y = 0; y < height; y++) for (uint32_t y = 0; y < height; y++)
{ {
@ -1803,8 +1799,6 @@ PlumageRender::PlumageRender()
file.close(); file.close();
} }
std::cout << "Screenshot saved to " << filePath << std::endl; std::cout << "Screenshot saved to " << filePath << std::endl;
// Clean up resources // Clean up resources
@ -1860,7 +1854,7 @@ PlumageRender::PlumageRender()
} }
else else
{ {
fileNameSuffix = "dresult.ppm"; fileNameSuffix = "result.ppm";
} }
std::string fileName ="/" + std::to_string(savedFrameCounter) + fileNameSuffix; std::string fileName ="/" + std::to_string(savedFrameCounter) + fileNameSuffix;
filePath.totalImageOutputPath = filePath.deviceSpecFilePath + fileName; filePath.totalImageOutputPath = filePath.deviceSpecFilePath + fileName;
@ -1964,9 +1958,10 @@ PlumageRender::PlumageRender()
//outputImageSequeue(swapChainImage,filePath.imageSequenceFilePath); //outputImageSequeue(swapChainImage,filePath.imageSequenceFilePath);
outputImageSequence();
VK_CHECK_RESULT(vkWaitForFences(device, 1, &waitFences[frameIndex], VK_TRUE, UINT64_MAX)); VK_CHECK_RESULT(vkWaitForFences(device, 1, &waitFences[frameIndex], VK_TRUE, UINT64_MAX));
outputImageSequence();
imageSequenceToVideo(); imageSequenceToVideo();
VK_CHECK_RESULT(vkResetFences(device, 1, &waitFences[frameIndex])); VK_CHECK_RESULT(vkResetFences(device, 1, &waitFences[frameIndex]));