diff --git a/README.md b/README.md index a5bc4b64..59d858a7 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,13 @@ Demonstrates the use of multiple render targets to fill a G-Buffer for deferred Deferred shading collects all values (color, normal, position) into different render targets in one pass thanks to multiple render targets, and then does all shading and lighting calculations based on these in scree space, thus allowing for much more light sources than traditional forward renderers.

+## [Shadowmapping](shadowmapping/) + + +Shows how to implement directional dynamic shadows with a single shadow map in two passes. Pass one renders the scene from the light's point of view and copies the depth buffer to a depth texture. +The second pass renders the scene from the camera's point of view using the depth texture to compare the depth value of the texels with the one stored in the depth texture to determine whether a texel is shadowed or not and also applies a PCF filter for smooth shadow borders. +To avoid shadow artifacts the dynamic depth bias state ([vkCmdSetDepthBias](https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdSetDepthBias.html)) is used to apply a constant and slope dept bias factor. + ## [Omnidirectional shadow mapping](shadowmappingomni/) diff --git a/screenshots/shadowmapping.png b/screenshots/shadowmapping.png new file mode 100644 index 00000000..78bdc7d2 Binary files /dev/null and b/screenshots/shadowmapping.png differ