diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index b724e79..b11dea9 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -110,8 +110,8 @@ void VulkanExampleBase::prepare() /* Swapchain */ - initSwapchain(); - setupSwapChain(); + //initSwapchain(); + //setupSwapChain(); #if defined(VK_USE_PLATFORM_ANDROID_KHR) width = swapChain.extent.width; diff --git a/data/output/video/device0/result.mp4 b/data/output/video/device0/result.mp4 deleted file mode 100644 index bf0c6a4..0000000 Binary files a/data/output/video/device0/result.mp4 and /dev/null differ diff --git a/src/render/render.cpp b/src/render/render.cpp index e9c0f13..1dcb3e0 100644 --- a/src/render/render.cpp +++ b/src/render/render.cpp @@ -1992,12 +1992,14 @@ PlumageRender::PlumageRender() outputImageSequence(); - + imageSequenceToVideo(); VK_CHECK_RESULT(vkWaitForFences(device, 1, &waitFences[frameIndex], VK_TRUE, UINT64_MAX)); - imageSequenceToVideo(); + VK_CHECK_RESULT(vkResetFences(device, 1, &waitFences[frameIndex])); + + /* VkResult acquire = swapChain.acquireNextImage(presentCompleteSemaphores[frameIndex], ¤tBuffer); if ((acquire == VK_ERROR_OUT_OF_DATE_KHR) || (acquire == VK_SUBOPTIMAL_KHR)) { windowResize(); @@ -2007,6 +2009,7 @@ PlumageRender::PlumageRender() } + */ // Update UBOs updateUniformBuffers(); @@ -2015,18 +2018,19 @@ PlumageRender::PlumageRender() memcpy(currentUB.params.mapped, &shaderData, sizeof(shaderData)); memcpy(currentUB.skybox.mapped, &shaderDataSkybox, sizeof(shaderDataSkybox)); + const VkPipelineStageFlags waitDstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; VkSubmitInfo submitInfo{}; submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; submitInfo.pWaitDstStageMask = &waitDstStageMask; - submitInfo.pWaitSemaphores = &presentCompleteSemaphores[frameIndex]; - submitInfo.waitSemaphoreCount = 1; + //submitInfo.pWaitSemaphores = &presentCompleteSemaphores[frameIndex]; + //submitInfo.waitSemaphoreCount = 1; submitInfo.pSignalSemaphores = &renderCompleteSemaphores[frameIndex]; submitInfo.signalSemaphoreCount = 1; submitInfo.pCommandBuffers = &commandBuffers[currentBuffer]; submitInfo.commandBufferCount = 1; VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, waitFences[frameIndex])); - + //显示队列 /* VkResult present = swapChain.queuePresent(queue, currentBuffer, renderCompleteSemaphores[frameIndex]); @@ -2308,7 +2312,7 @@ PlumageRender::PlumageRender() for (int32_t i = 0; i < __argc; i++) { PlumageRender::args.push_back(__argv[i]); }; plumageRender = new PlumageRender(); plumageRender->initVulkan(); - plumageRender->setupWindow(hInstance, WndProc); + //plumageRender->setupWindow(hInstance, WndProc); plumageRender->prepare(); plumageRender->renderLoop(); delete(plumageRender); diff --git a/src/render/render.h b/src/render/render.h index f52fcf6..03b9791 100644 --- a/src/render/render.h +++ b/src/render/render.h @@ -139,9 +139,9 @@ public: struct FilePath { //model path - std::string glTFModelFilePath = getAssetPath() + "models/sauvage_perfume.glb"; - std::string modelVertShaderPath = getAssetPath() + "buster_drone/shaders/glsl/mesh.vert.spv"; - std::string modelFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/mesh.frag.spv"; + std::string glTFModelFilePath = getAssetPath() + "models/DamagedHelmet/DamagedHelmet.gltf"; + //std::string modelVertShaderPath = getAssetPath() + "buster_drone/shaders/glsl/mesh.vert.spv"; + //std::string modelFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/mesh.frag.spv"; //ui std::string uiVertShaderPath = getAssetPath() + "shaders/ui.vert.spv"; @@ -152,7 +152,7 @@ public: std::string skyboxVertShaderPath = getAssetPath() + "shaders/skybox.vert.spv"; std::string skyboxFragShaderPath = getAssetPath() + "shaders/skybox.frag.spv"; - std::string iblTexturesFilePath = getAssetPath() + "textures/hdr/gcanyon_cube.ktx"; + //std::string iblTexturesFilePath = getAssetPath() + "textures/hdr/gcanyon_cube.ktx"; //tonemapping std::string tonemappingVertShaderPath = getAssetPath() + "buster_drone/shaders/glsl/genbrdflut.vert.spv"; std::string tonemappingEnableFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/tonemapping_enable.frag.spv"; @@ -169,7 +169,7 @@ public: std::string brdfVertShaderPath = getAssetPath() + "shaders/genbrdflut.vert.spv"; std::string brdfFragShaderPath = getAssetPath() + "shaders/genbrdflut.frag.spv"; // environment map texture - std::string envMapFilePath = getAssetPath() + "environments/kloofendal_43d_clear_puresky_hdr16f_cube.ktx"; + std::string envMapFilePath = getAssetPath() + "environments/metro_noord_4k_hdr16f_cube.ktx"; std::string emptyEnvmapFilePath = getAssetPath() + "textures/empty.ktx"; // pbr shader std::string pbrVertShaderPath = getAssetPath() + "shaders/pbr.vert.spv";