From 58b99c556ee8f47c458dda6e2d0c411e301c2250 Mon Sep 17 00:00:00 2001 From: Sascha Willems Date: Sat, 31 Dec 2022 12:07:35 +0100 Subject: [PATCH] Cull mode for shadow pass Fixes #946 --- examples/shadowmapping/shadowmapping.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/shadowmapping/shadowmapping.cpp b/examples/shadowmapping/shadowmapping.cpp index b0345ec9..59402ee1 100644 --- a/examples/shadowmapping/shadowmapping.cpp +++ b/examples/shadowmapping/shadowmapping.cpp @@ -1,7 +1,7 @@ /* * Vulkan Example - Shadow mapping for directional light sources * -* Copyright (C) 2016 by Sascha Willems - www.saschawillems.de +* Copyright (C) 2016-2022 by Sascha Willems - www.saschawillems.de * * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) */ @@ -492,7 +492,8 @@ public: pipelineCI.stageCount = 1; // No blend attachment states (no color attachments used) colorBlendStateCI.attachmentCount = 0; - // Cull front faces + // Disable culling, so all faces contribute to shadows + rasterizationStateCI.cullMode = VK_CULL_MODE_NONE; depthStencilStateCI.depthCompareOp = VK_COMPARE_OP_LESS_OR_EQUAL; // Enable depth bias rasterizationStateCI.depthBiasEnable = VK_TRUE;