ADD: CSM with base shadow map 2

This commit is contained in:
2025-10-22 00:53:36 +09:00
parent fde6a18f80
commit 4c41c93d44
5 changed files with 55 additions and 57 deletions

View File

@@ -45,7 +45,7 @@ void ShadowPass::init(EngineContext *context)
b.set_cull_mode(VK_CULL_MODE_BACK_BIT, VK_FRONT_FACE_CLOCKWISE);
b.set_multisampling_none();
b.disable_blending();
// Reverse-Z depth test for shadow maps (clear=0.0, GREATER_OR_EQUAL)
b.enable_depthtest(true, VK_COMPARE_OP_GREATER_OR_EQUAL);
b.set_depth_format(VK_FORMAT_D32_SFLOAT);
@@ -85,7 +85,6 @@ void ShadowPass::register_graph(RenderGraph *graph, std::span<RGImageHandle> cas
RGPassType::Graphics,
[shadowDepth](RGPassBuilder &builder, EngineContext *ctx)
{
// Reverse-Z depth clear to 0.0
VkClearValue clear{}; clear.depthStencil = {0.f, 0};
builder.write_depth(shadowDepth, true, clear);