From 07fe7401a16f1efc149276e71bdb9cb985c29293 Mon Sep 17 00:00:00 2001 From: Sascha Willems Date: Sat, 31 Dec 2022 12:11:21 +0100 Subject: [PATCH] Don't render scene when shadow map is dislplayed Fixes #774 --- examples/shadowmapping/shadowmapping.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/shadowmapping/shadowmapping.cpp b/examples/shadowmapping/shadowmapping.cpp index 59402ee1..e17fc197 100644 --- a/examples/shadowmapping/shadowmapping.cpp +++ b/examples/shadowmapping/shadowmapping.cpp @@ -347,13 +347,13 @@ public: vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &descriptorSets.debug, 0, nullptr); vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines.debug); vkCmdDraw(drawCmdBuffers[i], 3, 1, 0, 0); + } else { + // Render the shadows scene + vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &descriptorSets.scene, 0, nullptr); + vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, (filterPCF) ? pipelines.sceneShadowPCF : pipelines.sceneShadow); + scenes[sceneIndex].draw(drawCmdBuffers[i]); } - // 3D scene - vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &descriptorSets.scene, 0, nullptr); - vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, (filterPCF) ? pipelines.sceneShadowPCF : pipelines.sceneShadow); - scenes[sceneIndex].draw(drawCmdBuffers[i]); - drawUI(drawCmdBuffers[i]); vkCmdEndRenderPass(drawCmdBuffers[i]);