fix: balanced shadow bias — no acne, no peter-panning

- Fragment bias: 0.08 + 0.15 * (1 - NdotL) — smaller base, moderate slope
  (was 0.3 + 0.5 — too much → peter-panning, shadows detached from objects)
- vkCmdSetDepthBias: 1.75/0/2.5 (was 2.5/0/3.5 — too aggressive)
- Removed early exit logic — was causing hard shadow edges
- Always run 16-tap PCF for consistent soft shadow quality
- Smaller sample radius: clamp(0.015 * dist/20, 0.003, 0.05)
This commit is contained in:
emil28092005
2026-06-18 21:40:43 +03:00
parent 23b38f8f17
commit 2454af1c89
3 changed files with 6 additions and 17 deletions
+1 -1
View File
@@ -255,7 +255,7 @@ internal sealed unsafe class VulkanRenderer : IRenderer, Engine.Graphics.IScreen
};
Vk.vkCmdSetScissor(cmd, 0, 1, &shadowScissor);
Vk.vkCmdSetDepthBias(cmd, 2.5f, 0.0f, 3.5f);
Vk.vkCmdSetDepthBias(cmd, 1.75f, 0.0f, 2.5f);
foreach (var dc in drawCalls)
{