EDIT: Forward-Z cascaded shadow map failed...

This commit is contained in:
2025-10-20 14:26:08 +09:00
parent b419cc1148
commit 4dec20b60f
5 changed files with 17 additions and 13 deletions

View File

@@ -12,7 +12,7 @@ inline constexpr int kShadowCascadeCount = 4;
// Maximum shadow distance for CSM in view-space units
inline constexpr float kShadowCSMFar = 50.0f;
// Shadow map resolution used for stabilization (texel snapping). Must match actual image size.
inline constexpr float kShadowMapResolution = 2048.0f;
inline constexpr float kShadowMapResolution = 4096.0f;
// Extra XY expansion for cascade footprint (safety against FOV/aspect changes)
inline constexpr float kShadowCascadeRadiusScale = 1.15f;
// Additive XY margin in world units (light-space) beyond scaled radius

View File

@@ -35,6 +35,9 @@ void SamplerManager::init(DeviceManager *deviceManager)
sh.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER;
sh.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER;
sh.compareEnable = VK_FALSE; // manual PCF
// Depth shadow maps are single-level; keep base LOD only and avoid mip filtering.
sh.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST;
sh.maxLod = 0.0f;
sh.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE;
vkCreateSampler(_deviceManager->device(), &sh, nullptr, &_shadowLinearClamp);
}

View File

@@ -76,7 +76,6 @@ struct GPUSceneData {
glm::vec4 sunlightDirection; // w for sun power
glm::vec4 sunlightColor;
// CSM data (unused by current shaders until wired)
glm::mat4 lightViewProjCascades[4];
glm::vec4 cascadeSplitsView;
};