From 40f9aa74d585629ce5545d28dbed0d85fb272c1a Mon Sep 17 00:00:00 2001 From: Alexander Gauggel <agauggel@uni-koblenz.de> Date: Wed, 23 Jun 2021 18:11:18 +0200 Subject: [PATCH] [#82] Correct format to reduce shadow artifacts --- projects/voxelization/resources/shaders/shadowMapping.inc | 2 +- projects/voxelization/src/ShadowMapping.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/voxelization/resources/shaders/shadowMapping.inc b/projects/voxelization/resources/shaders/shadowMapping.inc index f75dabc7..8fc8c37c 100644 --- a/projects/voxelization/resources/shaders/shadowMapping.inc +++ b/projects/voxelization/resources/shaders/shadowMapping.inc @@ -74,7 +74,7 @@ float shadowTest(vec3 worldPos, LightInfo lightInfo, texture2D shadowMap, sample shadowMapSample = unquantizeMoments(shadowMapSample); - float depthBias = 0.0f; + float depthBias = 0.f; float momentBias = 0.00003; return 1-ComputeMSMShadowIntensity(shadowMapSample, lightPos.z, depthBias, momentBias); diff --git a/projects/voxelization/src/ShadowMapping.cpp b/projects/voxelization/src/ShadowMapping.cpp index 1373c9d2..e6af48c5 100644 --- a/projects/voxelization/src/ShadowMapping.cpp +++ b/projects/voxelization/src/ShadowMapping.cpp @@ -103,7 +103,7 @@ glm::mat4 computeShadowViewProjectionMatrix( return vulkanCorrectionMatrix * crop * view; } -const vk::Format shadowMapFormat = vk::Format::eR16G16B16A16Sfloat; +const vk::Format shadowMapFormat = vk::Format::eR16G16B16A16Unorm; const vk::Format shadowMapDepthFormat = vk::Format::eD16Unorm; const uint32_t shadowMapResolution = 2048; -- GitLab