From 88fa1a4799fae73d6a4584d2ea41309600e10b96 Mon Sep 17 00:00:00 2001 From: Alexander Gauggel <agauggel@uni-koblenz.de> Date: Fri, 25 Jun 2021 17:56:53 +0200 Subject: [PATCH] [#82] Switch to 16 bit shadow map to save on performance --- projects/voxelization/resources/shaders/shadowMapping.inc | 2 +- projects/voxelization/src/ShadowMapping.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/voxelization/resources/shaders/shadowMapping.inc b/projects/voxelization/resources/shaders/shadowMapping.inc index c4bcd94e..c56ae898 100644 --- a/projects/voxelization/resources/shaders/shadowMapping.inc +++ b/projects/voxelization/resources/shaders/shadowMapping.inc @@ -86,7 +86,7 @@ float shadowTest(vec3 worldPos, LightInfo lightInfo, texture2D shadowMap, sample shadowMapSample = unquantizeMoments(shadowMapSample); float depthBias = 0.f; - float momentBias = 0.000002; + float momentBias = 0.0003; float shadow = ComputeMSMShadowIntensity(shadowMapSample, lightPos.z, depthBias, momentBias); return reduceLightBleeding(shadow, 0.1f); diff --git a/projects/voxelization/src/ShadowMapping.cpp b/projects/voxelization/src/ShadowMapping.cpp index 051d0673..19d58c25 100644 --- a/projects/voxelization/src/ShadowMapping.cpp +++ b/projects/voxelization/src/ShadowMapping.cpp @@ -1,10 +1,10 @@ #include "ShadowMapping.hpp" #include <vkcv/shader/GLSLCompiler.hpp> -const vk::Format shadowMapFormat = vk::Format::eR32G32B32A32Sfloat; -const vk::Format shadowMapDepthFormat = vk::Format::eD32Sfloat; -const uint32_t shadowMapResolution = 2048; -const vkcv::Multisampling msaa = vkcv::Multisampling::MSAA8X; +const vk::Format shadowMapFormat = vk::Format::eR16G16B16A16Unorm; +const vk::Format shadowMapDepthFormat = vk::Format::eD32Sfloat; +const uint32_t shadowMapResolution = 2048; +const vkcv::Multisampling msaa = vkcv::Multisampling::MSAA8X; vkcv::ShaderProgram loadShadowShader() { vkcv::ShaderProgram shader; -- GitLab